Fix assistant
Add prefix on proxy config Link phone number on the right account
This commit is contained in:
parent
c914916e66
commit
254daec287
3 changed files with 9 additions and 3 deletions
|
@ -254,6 +254,7 @@ public class AccountPreferencesFragment extends PreferencesListFragment implemen
|
|||
assistant.setClass(LinphoneActivity.instance(), AssistantActivity.class);
|
||||
assistant.putExtra("LinkPhoneNumber", true);
|
||||
assistant.putExtra("FromPref", true);
|
||||
assistant.putExtra("AccountNumber", n);
|
||||
startActivity(assistant);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -376,6 +376,9 @@ private static AssistantActivity instance;
|
|||
if (LinphonePreferences.instance() != null)
|
||||
proxyConfig.setContactUriParameters(LinphonePreferences.instance().getPushNotificationRegistrationID());
|
||||
|
||||
if (accountCreator.getPhoneNumber() != null && accountCreator.getPhoneNumber().length() > 0)
|
||||
proxyConfig.setDialPrefix(accountCreator.getPrefix(accountCreator.getPhoneNumber()));
|
||||
|
||||
proxyConfig.done();
|
||||
|
||||
authInfo = LinphoneCoreFactory.instance().createAuthInfo(
|
||||
|
|
|
@ -44,7 +44,7 @@ public class CreateAccountCodeActivationFragment extends Fragment implements Lin
|
|||
private TextView title, phonenumber;
|
||||
private EditText code;
|
||||
private boolean recoverAccount = false, linkAccount = false;
|
||||
private int code_length;
|
||||
private int code_length, accountNumber;
|
||||
private ImageView back;
|
||||
private Button checkAccount;
|
||||
private LinphoneAccountCreator accountCreator;
|
||||
|
@ -59,6 +59,7 @@ public class CreateAccountCodeActivationFragment extends Fragment implements Lin
|
|||
dialcode = getArguments().getString("Dialcode");
|
||||
recoverAccount = getArguments().getBoolean("RecoverAccount");
|
||||
linkAccount = getArguments().getBoolean("LinkAccount");
|
||||
accountNumber = getArguments().getInt("AccountNumber");
|
||||
|
||||
code_length = LinphonePreferences.instance().getCodeLength();
|
||||
accountCreator = LinphoneCoreFactory.instance().createAccountCreator(LinphoneManager.getLc(), LinphonePreferences.instance().getXmlrpcUrl());
|
||||
|
@ -118,8 +119,8 @@ public class CreateAccountCodeActivationFragment extends Fragment implements Lin
|
|||
}
|
||||
|
||||
private void linkAccount(){
|
||||
accountCreator.setUsername(LinphonePreferences.instance().getAccountUsername(LinphonePreferences.instance().getDefaultAccountIndex()));
|
||||
accountCreator.setHa1(LinphonePreferences.instance().getAccountHa1(LinphonePreferences.instance().getDefaultAccountIndex()));
|
||||
accountCreator.setUsername(LinphonePreferences.instance().getAccountUsername(accountNumber));
|
||||
accountCreator.setHa1(LinphonePreferences.instance().getAccountHa1(accountNumber));
|
||||
accountCreator.activatePhoneNumberLink();
|
||||
}
|
||||
|
||||
|
@ -179,6 +180,7 @@ public class CreateAccountCodeActivationFragment extends Fragment implements Lin
|
|||
return;
|
||||
}
|
||||
if(status.equals(LinphoneAccountCreator.RequestStatus.Ok)){
|
||||
LinphonePreferences.instance().setPrefix(accountNumber, accountCreator.getPrefix(accountCreator.getPhoneNumber()));
|
||||
LinphonePreferences.instance().setLinkPopupTime("");
|
||||
AssistantActivity.instance().hideKeyboard();
|
||||
AssistantActivity.instance().success();
|
||||
|
|
Loading…
Reference in a new issue