Change registration state on dialer's status bar after removing an account

This commit is contained in:
Sylvain Berfini 2013-11-05 17:27:04 +01:00
parent cb7e2925ad
commit 0e437a4a32
2 changed files with 8 additions and 6 deletions

View file

@ -135,12 +135,6 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
return true;
}
};
OnPreferenceChangeListener deleteChangedListener = new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
return true;
}
};
private void manageAccountPreferencesFields(PreferenceScreen parent) {
boolean isDefaultAccount = mPrefs.getDefaultAccountIndex() == n;

View file

@ -24,6 +24,7 @@ import org.linphone.core.LinphoneAuthInfo;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCore.FirewallPolicy;
import org.linphone.core.LinphoneCore.MediaEncryption;
import org.linphone.core.LinphoneCore.RegistrationState;
import org.linphone.core.LinphoneCore.Transports;
import org.linphone.core.LinphoneCoreException;
import org.linphone.core.LinphoneCoreFactory;
@ -402,6 +403,13 @@ public class LinphonePreferences {
LinphoneProxyConfig proxyCfg = getProxyConfig(n);
if (proxyCfg != null)
getLc().removeProxyConfig(proxyCfg);
if (getLc().getProxyConfigList().length == 0) {
// TODO: remove once issue http://bugs.linphone.org/view.php?id=984 will be fixed
LinphoneActivity.instance().getStatusFragment().registrationStateChanged(RegistrationState.RegistrationNone);
} else {
getLc().refreshRegisters();
}
}
// End of accounts settings