Fix register fail on delete account
This commit is contained in:
parent
8a7e6facd9
commit
b6bf0bb74e
3 changed files with 8 additions and 14 deletions
|
@ -523,9 +523,9 @@ public class AccountPreferencesFragment extends PreferencesListFragment implemen
|
|||
delete.setEnabled(!isNewAccount);
|
||||
delete.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
mPrefs.deleteAccount(n);
|
||||
mPrefs.deleteAccount(n);
|
||||
LinphoneActivity.instance().displaySettings();
|
||||
LinphoneActivity.instance().refreshAccounts();
|
||||
LinphoneActivity.instance().displaySettings();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1590,13 +1590,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
|||
statusFragment.resetAccountStatus();
|
||||
LinphoneManager.getInstance().subscribeFriendList(false);
|
||||
|
||||
defaultAccount.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
LinphoneActivity.instance().displayAccountSettings(0);
|
||||
openOrCloseSideMenu(false);
|
||||
}
|
||||
});
|
||||
defaultAccount.setOnClickListener(null);
|
||||
} else {
|
||||
address.setText(proxy.getAddress().asStringUriOnly());
|
||||
displayName.setText(LinphoneUtils.getAddressDisplayName(proxy.getAddress()));
|
||||
|
|
|
@ -783,11 +783,6 @@ public class LinphonePreferences {
|
|||
}
|
||||
|
||||
public void deleteAccount(int n) {
|
||||
LinphoneAuthInfo authInfo = getAuthInfo(n);
|
||||
if (authInfo != null) {
|
||||
getLc().removeAuthInfo(authInfo);
|
||||
}
|
||||
|
||||
LinphoneProxyConfig proxyCfg = getProxyConfig(n);
|
||||
if (proxyCfg != null)
|
||||
getLc().removeProxyConfig(proxyCfg);
|
||||
|
@ -797,6 +792,11 @@ public class LinphonePreferences {
|
|||
getLc().setDefaultProxyConfig(null);
|
||||
}
|
||||
|
||||
LinphoneAuthInfo authInfo = getAuthInfo(n);
|
||||
if (authInfo != null) {
|
||||
getLc().removeAuthInfo(authInfo);
|
||||
}
|
||||
|
||||
getLc().refreshRegisters();
|
||||
}
|
||||
// End of accounts settings
|
||||
|
|
Loading…
Reference in a new issue