Fix link account and fix some bugs in the assistant
This commit is contained in:
parent
1e322f80d8
commit
919d36c3f4
12 changed files with 96 additions and 27 deletions
|
@ -9,7 +9,6 @@
|
||||||
android:background="@color/colorF"
|
android:background="@color/colorF"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:layout_alignParentTop="true">
|
android:layout_alignParentTop="true">
|
||||||
|
|
||||||
<org.linphone.ui.EraseButton
|
<org.linphone.ui.EraseButton
|
||||||
|
|
|
@ -49,3 +49,4 @@ username_length=-1
|
||||||
username_max_length=64
|
username_max_length=64
|
||||||
username_min_length=1
|
username_min_length=1
|
||||||
username_regex=^[a-z0-9_.\-]*$
|
username_regex=^[a-z0-9_.\-]*$
|
||||||
|
xmlrpc_url=https://sip3.linphone.org:444/inapp.php
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
<integer name="popup_time_interval">86400</integer><!-- Time between two inapp notifications in seconds -->
|
<integer name="popup_time_interval">86400</integer><!-- Time between two inapp notifications in seconds -->
|
||||||
|
|
||||||
<!-- Assistant -->
|
<!-- Assistant -->
|
||||||
<string name="wizard_url">https://sip3.linphone.org:444/wizard.php</string><!-- Url of the xmlrpc script -->
|
|
||||||
<bool name="assistant_allow_username">true</bool> <!-- Allow to use an username instead of the phone number for account creation -->
|
<bool name="assistant_allow_username">true</bool> <!-- Allow to use an username instead of the phone number for account creation -->
|
||||||
<bool name="assistant_use_linphone_login_as_first_fragment">false</bool><!-- Start assistant in loginFragment view instead of menu -->
|
<bool name="assistant_use_linphone_login_as_first_fragment">false</bool><!-- Start assistant in loginFragment view instead of menu -->
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
<string name="link">Link</string>
|
<string name="link">Link</string>
|
||||||
<string name="link_account_popup">Do you want to link the account %s with your phone number ?</string>
|
<string name="link_account_popup">Do you want to link the account %s with your phone number ?</string>
|
||||||
<string name="maybe_later">Maybe later</string>
|
<string name="maybe_later">Maybe later</string>
|
||||||
|
<string name="link_account">Link account</string>
|
||||||
|
|
||||||
<!-- Launch screen -->
|
<!-- Launch screen -->
|
||||||
<string name="app_description">the <i>libre</i> SIP client</string>
|
<string name="app_description">the <i>libre</i> SIP client</string>
|
||||||
|
@ -60,7 +61,6 @@
|
||||||
<string name="welcome">Welcome</string>
|
<string name="welcome">Welcome</string>
|
||||||
<string name="assistant">Assistant</string>
|
<string name="assistant">Assistant</string>
|
||||||
<string name="assistant_create_account">Create account</string>
|
<string name="assistant_create_account">Create account</string>
|
||||||
<string name="assistant_link_account">Link account</string>
|
|
||||||
<string name="assistant_continue">Continue</string>
|
<string name="assistant_continue">Continue</string>
|
||||||
<string name="assistant_activate">Activate account</string>
|
<string name="assistant_activate">Activate account</string>
|
||||||
<string name="assistant_finish">Finish configuration</string>
|
<string name="assistant_finish">Finish configuration</string>
|
||||||
|
|
|
@ -133,12 +133,12 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
private LinearLayout mTabBar;
|
private LinearLayout mTabBar;
|
||||||
|
|
||||||
private DrawerLayout sideMenu;
|
private DrawerLayout sideMenu;
|
||||||
private String[] sideMenuItems;
|
|
||||||
private RelativeLayout sideMenuContent, quitLayout, defaultAccount;
|
private RelativeLayout sideMenuContent, quitLayout, defaultAccount;
|
||||||
private ListView accountsList, sideMenuItemList;
|
private ListView accountsList, sideMenuItemList;
|
||||||
private ImageView menu;
|
private ImageView menu;
|
||||||
private boolean fetchedContactsOnce = false;
|
private boolean fetchedContactsOnce = false;
|
||||||
private boolean doNotGoToCallActivity = false;
|
private boolean doNotGoToCallActivity = false;
|
||||||
|
private List<String> sideMenuItems;
|
||||||
|
|
||||||
static final boolean isInstanciated() {
|
static final boolean isInstanciated() {
|
||||||
return instance != null;
|
return instance != null;
|
||||||
|
@ -235,6 +235,14 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
|
|
||||||
refreshAccounts();
|
refreshAccounts();
|
||||||
|
|
||||||
|
if(state.equals(RegistrationState.RegistrationOk) && LinphonePreferences.instance().getLinkPopupTime() != ""){
|
||||||
|
if(getResources().getBoolean(R.bool.use_phone_number_validation)) {
|
||||||
|
if (LinphonePreferences.instance().getLinkPopupTime() == null || (LinphonePreferences.instance().getLinkPopupTime() != null && !LinphonePreferences.instance().getLinkPopupTime().equals(""))){
|
||||||
|
isAccountWithAlias();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(state.equals(RegistrationState.RegistrationFailed) && newProxyConfig) {
|
if(state.equals(RegistrationState.RegistrationFailed) && newProxyConfig) {
|
||||||
newProxyConfig = false;
|
newProxyConfig = false;
|
||||||
if (proxy.getError() == Reason.BadCredentials) {
|
if (proxy.getError() == Reason.BadCredentials) {
|
||||||
|
@ -1346,12 +1354,6 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
isTrialAccount();
|
isTrialAccount();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getResources().getBoolean(R.bool.use_phone_number_validation)) {
|
|
||||||
if (LinphonePreferences.instance().getLinkPopupTime() == null || (LinphonePreferences.instance().getLinkPopupTime() != null && !LinphonePreferences.instance().getLinkPopupTime().equals(""))){
|
|
||||||
isAccountWithAlias();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateMissedChatCount();
|
updateMissedChatCount();
|
||||||
if(LinphonePreferences.instance().isFriendlistsubscriptionEnabled() && LinphoneManager.getLc().getDefaultProxyConfig() != null){
|
if(LinphonePreferences.instance().isFriendlistsubscriptionEnabled() && LinphoneManager.getLc().getDefaultProxyConfig() != null){
|
||||||
LinphoneManager.getInstance().subscribeFriendList(true);
|
LinphoneManager.getInstance().subscribeFriendList(true);
|
||||||
|
@ -1481,13 +1483,14 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initSideMenu() {
|
public void initSideMenu() {
|
||||||
|
|
||||||
sideMenu = (DrawerLayout) findViewById(R.id.side_menu);
|
sideMenu = (DrawerLayout) findViewById(R.id.side_menu);
|
||||||
|
sideMenuItems = new ArrayList<String>();
|
||||||
|
sideMenuItems.add(getResources().getString(R.string.menu_assistant));
|
||||||
|
sideMenuItems.add(getResources().getString(R.string.menu_settings));
|
||||||
if(getResources().getBoolean(R.bool.enable_in_app_purchase)){
|
if(getResources().getBoolean(R.bool.enable_in_app_purchase)){
|
||||||
sideMenuItems = new String[]{getResources().getString(R.string.menu_assistant),getResources().getString(R.string.menu_settings),getResources().getString(R.string.inapp), getResources().getString(R.string.menu_about)};
|
sideMenuItems.add(getResources().getString(R.string.inapp));
|
||||||
} else {
|
|
||||||
sideMenuItems = new String[]{getResources().getString(R.string.menu_assistant),getResources().getString(R.string.menu_settings),getResources().getString(R.string.menu_about)};
|
|
||||||
}
|
}
|
||||||
|
sideMenuItems.add(getResources().getString(R.string.menu_about));
|
||||||
sideMenuContent = (RelativeLayout) findViewById(R.id.side_menu_content);
|
sideMenuContent = (RelativeLayout) findViewById(R.id.side_menu_content);
|
||||||
sideMenuItemList = (ListView)findViewById(R.id.item_list);
|
sideMenuItemList = (ListView)findViewById(R.id.item_list);
|
||||||
menu = (ImageView) findViewById(R.id.side_menu_button);
|
menu = (ImageView) findViewById(R.id.side_menu_button);
|
||||||
|
@ -1686,7 +1689,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
private void isAccountWithAlias(){
|
private void isAccountWithAlias(){
|
||||||
if(LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
if(LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
||||||
LinphoneAccountCreator accountCreator;
|
LinphoneAccountCreator accountCreator;
|
||||||
accountCreator = new LinphoneAccountCreatorImpl(LinphoneManager.getLc(), getResources().getString(R.string.wizard_url));
|
accountCreator = new LinphoneAccountCreatorImpl(LinphoneManager.getLc(), LinphonePreferences.instance().getXmlrpcUrl());
|
||||||
accountCreator.setDomain(getResources().getString(R.string.default_domain));
|
accountCreator.setDomain(getResources().getString(R.string.default_domain));
|
||||||
accountCreator.setListener(this);
|
accountCreator.setListener(this);
|
||||||
accountCreator.setUsername(LinphonePreferences.instance().getAccountUsername(LinphonePreferences.instance().getDefaultAccountIndex()));
|
accountCreator.setUsername(LinphonePreferences.instance().getAccountUsername(LinphonePreferences.instance().getDefaultAccountIndex()));
|
||||||
|
|
|
@ -1350,6 +1350,14 @@ public class LinphonePreferences {
|
||||||
return purchasables;
|
return purchasables;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getXmlrpcUrl(){
|
||||||
|
return getConfig().getString("assistant", "xmlrpc_url", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setXmlrpcUrl(String url){
|
||||||
|
getConfig().setString("assistant", "xmlrpc_url", url);
|
||||||
|
}
|
||||||
|
|
||||||
public String getInappPopupTime(){
|
public String getInappPopupTime(){
|
||||||
return getConfig().getString("app", "inapp_popup_time", null);
|
return getConfig().getString("app", "inapp_popup_time", null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,8 @@ import org.linphone.LinphoneUtils;
|
||||||
import org.linphone.LinphonePreferences.AccountBuilder;
|
import org.linphone.LinphonePreferences.AccountBuilder;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.StatusFragment;
|
import org.linphone.StatusFragment;
|
||||||
|
import org.linphone.core.LinphoneAccountCreator;
|
||||||
|
import org.linphone.core.LinphoneAccountCreatorImpl;
|
||||||
import org.linphone.core.LinphoneAddress;
|
import org.linphone.core.LinphoneAddress;
|
||||||
import org.linphone.core.LinphoneAddress.TransportType;
|
import org.linphone.core.LinphoneAddress.TransportType;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
|
@ -65,7 +67,7 @@ import android.widget.Toast;
|
||||||
/**
|
/**
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
*/
|
*/
|
||||||
public class AssistantActivity extends Activity implements OnClickListener, ActivityCompat.OnRequestPermissionsResultCallback {
|
public class AssistantActivity extends Activity implements OnClickListener, ActivityCompat.OnRequestPermissionsResultCallback, LinphoneAccountCreator.LinphoneAccountCreatorListener {
|
||||||
private static AssistantActivity instance;
|
private static AssistantActivity instance;
|
||||||
private ImageView back, cancel;
|
private ImageView back, cancel;
|
||||||
private AssistantFragmentsEnum currentFragment;
|
private AssistantFragmentsEnum currentFragment;
|
||||||
|
@ -82,6 +84,7 @@ private static AssistantActivity instance;
|
||||||
private boolean remoteProvisioningInProgress;
|
private boolean remoteProvisioningInProgress;
|
||||||
private boolean echoCancellerAlreadyDone;
|
private boolean echoCancellerAlreadyDone;
|
||||||
private static final int PERMISSIONS_REQUEST_RECORD_AUDIO = 201;
|
private static final int PERMISSIONS_REQUEST_RECORD_AUDIO = 201;
|
||||||
|
private LinphoneAccountCreator accountCreator;
|
||||||
|
|
||||||
public CountryListFragment.Country country;
|
public CountryListFragment.Country country;
|
||||||
public String phone_number;
|
public String phone_number;
|
||||||
|
@ -119,6 +122,10 @@ private static AssistantActivity instance;
|
||||||
mPrefs = LinphonePreferences.instance();
|
mPrefs = LinphonePreferences.instance();
|
||||||
status.enableSideMenu(false);
|
status.enableSideMenu(false);
|
||||||
|
|
||||||
|
accountCreator = new LinphoneAccountCreatorImpl(LinphoneManager.getLc(), LinphonePreferences.instance().getXmlrpcUrl());
|
||||||
|
accountCreator.setDomain(getResources().getString(R.string.default_domain));
|
||||||
|
accountCreator.setListener(this);
|
||||||
|
|
||||||
mListener = new LinphoneCoreListenerBase() {
|
mListener = new LinphoneCoreListenerBase() {
|
||||||
@Override
|
@Override
|
||||||
public void registrationState(LinphoneCore lc, LinphoneProxyConfig cfg, RegistrationState state, String smessage) {
|
public void registrationState(LinphoneCore lc, LinphoneProxyConfig cfg, RegistrationState state, String smessage) {
|
||||||
|
@ -133,7 +140,7 @@ private static AssistantActivity instance;
|
||||||
if (state == RegistrationState.RegistrationOk) {
|
if (state == RegistrationState.RegistrationOk) {
|
||||||
if (progress != null) progress.dismiss();
|
if (progress != null) progress.dismiss();
|
||||||
if (LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
if (LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
||||||
success();
|
accountCreator.isAccountUsed();
|
||||||
}
|
}
|
||||||
} else if (state == RegistrationState.RegistrationFailed) {
|
} else if (state == RegistrationState.RegistrationFailed) {
|
||||||
if (progress != null) progress.dismiss();
|
if (progress != null) progress.dismiss();
|
||||||
|
@ -222,6 +229,9 @@ private static AssistantActivity instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
|
if(isLink){
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (currentFragment == firstFragment) {
|
if (currentFragment == firstFragment) {
|
||||||
LinphonePreferences.instance().firstLaunchSuccessful();
|
LinphonePreferences.instance().firstLaunchSuccessful();
|
||||||
if (getResources().getBoolean(R.bool.assistant_cancel_move_to_back)) {
|
if (getResources().getBoolean(R.bool.assistant_cancel_move_to_back)) {
|
||||||
|
@ -435,6 +445,8 @@ private static AssistantActivity instance;
|
||||||
address.setDisplayName(displayName);
|
address.setDisplayName(displayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
boolean isMainAccountLinphoneDotOrg = domain.equals(getString(R.string.default_domain));
|
boolean isMainAccountLinphoneDotOrg = domain.equals(getString(R.string.default_domain));
|
||||||
AccountBuilder builder = new AccountBuilder(LinphoneManager.getLc())
|
AccountBuilder builder = new AccountBuilder(LinphoneManager.getLc())
|
||||||
.setUsername(username)
|
.setUsername(username)
|
||||||
|
@ -466,6 +478,10 @@ private static AssistantActivity instance;
|
||||||
|
|
||||||
mPrefs.setStunServer(getString(R.string.default_stun));
|
mPrefs.setStunServer(getString(R.string.default_stun));
|
||||||
mPrefs.setIceEnabled(true);
|
mPrefs.setIceEnabled(true);
|
||||||
|
|
||||||
|
accountCreator.setPassword(password);
|
||||||
|
accountCreator.setHa1(ha1);
|
||||||
|
accountCreator.setUsername(username);
|
||||||
} else {
|
} else {
|
||||||
String forcedProxy = "";
|
String forcedProxy = "";
|
||||||
if (!TextUtils.isEmpty(forcedProxy)) {
|
if (!TextUtils.isEmpty(forcedProxy)) {
|
||||||
|
@ -610,4 +626,45 @@ private static AssistantActivity instance;
|
||||||
status.setLinphoneCoreListener();
|
status.setLinphoneCoreListener();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccountCreatorIsAccountUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||||
|
if(status.equals(LinphoneAccountCreator.Status.AccountExistWithAlias)){
|
||||||
|
success();
|
||||||
|
} else {
|
||||||
|
isLink = true;
|
||||||
|
displayCreateAccount();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccountCreatorAccountCreated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccountCreatorAccountActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccountCreatorAccountLinkedWithPhoneNumber(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccountCreatorPhoneNumberLinkActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccountCreatorIsAccountActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccountCreatorPhoneAccountRecovered(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
import org.linphone.LinphoneManager;
|
import org.linphone.LinphoneManager;
|
||||||
|
import org.linphone.LinphonePreferences;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.core.LinphoneXmlRpcRequest;
|
import org.linphone.core.LinphoneXmlRpcRequest;
|
||||||
import org.linphone.core.LinphoneXmlRpcRequest.LinphoneXmlRpcRequestListener;
|
import org.linphone.core.LinphoneXmlRpcRequest.LinphoneXmlRpcRequestListener;
|
||||||
|
@ -81,7 +82,7 @@ public class CreateAccountActivationFragment extends Fragment implements Linphon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
xmlRpcSession = new LinphoneXmlRpcSessionImpl(LinphoneManager.getLcIfManagerNotDestroyedOrNull(), getString(R.string.wizard_url));
|
xmlRpcSession = new LinphoneXmlRpcSessionImpl(LinphoneManager.getLcIfManagerNotDestroyedOrNull(), LinphonePreferences.instance().getXmlrpcUrl());
|
||||||
xmlRpcRequest = new LinphoneXmlRpcRequestImpl("check_account_validated", LinphoneXmlRpcRequest.ArgType.Int);
|
xmlRpcRequest = new LinphoneXmlRpcRequestImpl("check_account_validated", LinphoneXmlRpcRequest.ArgType.Int);
|
||||||
xmlRpcRequest.setListener(this);
|
xmlRpcRequest.setListener(this);
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class CreateAccountCodeActivationFragment extends Fragment implements Lin
|
||||||
linkAccount = getArguments().getBoolean("LinkAccount");
|
linkAccount = getArguments().getBoolean("LinkAccount");
|
||||||
|
|
||||||
code_length = LinphonePreferences.instance().getCodeLength();
|
code_length = LinphonePreferences.instance().getCodeLength();
|
||||||
accountCreator = new LinphoneAccountCreatorImpl(LinphoneManager.getLc(), getResources().getString(R.string.wizard_url));
|
accountCreator = new LinphoneAccountCreatorImpl(LinphoneManager.getLc(), LinphonePreferences.instance().getXmlrpcUrl());
|
||||||
accountCreator.setDomain(getResources().getString(R.string.default_domain));
|
accountCreator.setDomain(getResources().getString(R.string.default_domain));
|
||||||
accountCreator.setListener(this);
|
accountCreator.setListener(this);
|
||||||
accountCreator.setUsername(username);
|
accountCreator.setUsername(username);
|
||||||
|
@ -160,7 +160,7 @@ public class CreateAccountCodeActivationFragment extends Fragment implements Lin
|
||||||
if(status.equals(LinphoneAccountCreator.Status.Ok)){
|
if(status.equals(LinphoneAccountCreator.Status.Ok)){
|
||||||
LinphonePreferences.instance().setLinkPopupTime("");
|
LinphonePreferences.instance().setLinkPopupTime("");
|
||||||
AssistantActivity.instance().hideKeyboard();
|
AssistantActivity.instance().hideKeyboard();
|
||||||
AssistantActivity.instance().finish();
|
AssistantActivity.instance().success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ import org.linphone.R;
|
||||||
import org.linphone.core.LinphoneAccountCreator;
|
import org.linphone.core.LinphoneAccountCreator;
|
||||||
import org.linphone.core.LinphoneAccountCreatorImpl;
|
import org.linphone.core.LinphoneAccountCreatorImpl;
|
||||||
import org.linphone.core.LinphoneProxyConfig;
|
import org.linphone.core.LinphoneProxyConfig;
|
||||||
import org.linphone.mediastream.Log;
|
|
||||||
|
|
||||||
import android.accounts.Account;
|
import android.accounts.Account;
|
||||||
import android.accounts.AccountManager;
|
import android.accounts.AccountManager;
|
||||||
|
@ -81,7 +80,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
|
||||||
View view = inflater.inflate(R.layout.assistant_account_creation, container, false);
|
View view = inflater.inflate(R.layout.assistant_account_creation, container, false);
|
||||||
|
|
||||||
//Initialize accountCreator
|
//Initialize accountCreator
|
||||||
accountCreator = new LinphoneAccountCreatorImpl(LinphoneManager.getLc(), getResources().getString(R.string.wizard_url));
|
accountCreator = new LinphoneAccountCreatorImpl(LinphoneManager.getLc(), LinphonePreferences.instance().getXmlrpcUrl());
|
||||||
accountCreator.setDomain(getResources().getString(R.string.default_domain));
|
accountCreator.setDomain(getResources().getString(R.string.default_domain));
|
||||||
accountCreator.setListener(this);
|
accountCreator.setListener(this);
|
||||||
|
|
||||||
|
@ -192,8 +191,8 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
|
||||||
passwordConfirmLayout.setVisibility(View.GONE);
|
passwordConfirmLayout.setVisibility(View.GONE);
|
||||||
emailLayout.setVisibility(View.GONE);
|
emailLayout.setVisibility(View.GONE);
|
||||||
|
|
||||||
createAccount.setText(getResources().getString(R.string.assistant_link_account));
|
createAccount.setText(getResources().getString(R.string.link_account));
|
||||||
assisstantTitle.setText(getResources().getString(R.string.assistant_link_account));
|
assisstantTitle.setText(getResources().getString(R.string.link_account));
|
||||||
}
|
}
|
||||||
addUsernameHandler(usernameEdit, null);
|
addUsernameHandler(usernameEdit, null);
|
||||||
|
|
||||||
|
@ -570,7 +569,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
|
||||||
@Override
|
@Override
|
||||||
public void onAccountCreatorAccountCreated(LinphoneAccountCreator accountCreator, Status status) {
|
public void onAccountCreatorAccountCreated(LinphoneAccountCreator accountCreator, Status status) {
|
||||||
if(status.equals(Status.AccountCreated)) {
|
if(status.equals(Status.AccountCreated)) {
|
||||||
if(useEmail.isChecked()){
|
if(useEmail.isChecked() || !getResources().getBoolean(R.bool.use_phone_number_validation)){
|
||||||
AssistantActivity.instance().displayAssistantConfirm(getUsername(), passwordEdit.getText().toString());
|
AssistantActivity.instance().displayAssistantConfirm(getUsername(), passwordEdit.getText().toString());
|
||||||
} else {
|
} else {
|
||||||
AssistantActivity.instance().displayAssistantCodeConfirm(getUsername(), phoneNumberEdit.getText().toString(), getCountryCode(), false);
|
AssistantActivity.instance().displayAssistantCodeConfirm(getUsername(), phoneNumberEdit.getText().toString(), getCountryCode(), false);
|
||||||
|
|
|
@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.linphone.LinphoneManager;
|
import org.linphone.LinphoneManager;
|
||||||
|
import org.linphone.LinphonePreferences;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.LinphoneCore.EcCalibratorStatus;
|
import org.linphone.core.LinphoneCore.EcCalibratorStatus;
|
||||||
|
@ -73,7 +74,7 @@ public class EchoCancellerCalibrationFragment extends Fragment implements Linpho
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
xmlRpcSession = new LinphoneXmlRpcSessionImpl(LinphoneManager.getLcIfManagerNotDestroyedOrNull(), getString(R.string.wizard_url));
|
xmlRpcSession = new LinphoneXmlRpcSessionImpl(LinphoneManager.getLcIfManagerNotDestroyedOrNull(), LinphonePreferences.instance().getXmlrpcUrl());
|
||||||
xmlRpcRequest = new LinphoneXmlRpcRequestImpl("add_ec_calibration_result", LinphoneXmlRpcRequest.ArgType.None);
|
xmlRpcRequest = new LinphoneXmlRpcRequestImpl("add_ec_calibration_result", LinphoneXmlRpcRequest.ArgType.None);
|
||||||
xmlRpcRequest.setListener(this);
|
xmlRpcRequest.setListener(this);
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
import org.linphone.LinphoneManager;
|
import org.linphone.LinphoneManager;
|
||||||
|
import org.linphone.LinphonePreferences;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.compatibility.Compatibility;
|
import org.linphone.compatibility.Compatibility;
|
||||||
import org.linphone.core.LinphoneAccountCreator;
|
import org.linphone.core.LinphoneAccountCreator;
|
||||||
|
@ -62,7 +63,7 @@ public class LinphoneLoginFragment extends Fragment implements CompoundButton.On
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.assistant_linphone_login, container, false);
|
View view = inflater.inflate(R.layout.assistant_linphone_login, container, false);
|
||||||
|
|
||||||
accountCreator = new LinphoneAccountCreatorImpl(LinphoneManager.getLc(), getResources().getString(R.string.wizard_url));
|
accountCreator = new LinphoneAccountCreatorImpl(LinphoneManager.getLc(), LinphonePreferences.instance().getXmlrpcUrl());
|
||||||
accountCreator.setListener(this);
|
accountCreator.setListener(this);
|
||||||
|
|
||||||
String url = "http://linphone.org/free-sip-service.html&action=recover";
|
String url = "http://linphone.org/free-sip-service.html&action=recover";
|
||||||
|
|
Loading…
Reference in a new issue