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