Fix register fail on delete account

This commit is contained in:
Erwan Croze 2017-05-12 16:44:14 +02:00
parent f74d504f86
commit 014d896333
3 changed files with 8 additions and 14 deletions

View file

@ -476,9 +476,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;
}
});

View file

@ -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()));

View file

@ -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