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