Fix defaultProxyConfig when account deleted
This commit is contained in:
parent
7afb2dd8db
commit
c0b68ae6e5
1 changed files with 15 additions and 0 deletions
|
@ -615,6 +615,20 @@ public class LinphonePreferences {
|
||||||
public boolean isAccountEnabled(int n) {
|
public boolean isAccountEnabled(int n) {
|
||||||
return getProxyConfig(n).registerEnabled();
|
return getProxyConfig(n).registerEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetDefaultProxyConfig(){
|
||||||
|
int count = getLc().getProxyConfigList().length;
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
|
if (isAccountEnabled(i)) {
|
||||||
|
getLc().setDefaultProxyConfig(getProxyConfig(i));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getLc().getDefaultProxyConfig() == null){
|
||||||
|
getLc().setDefaultProxyConfig(getProxyConfig(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void deleteAccount(int n) {
|
public void deleteAccount(int n) {
|
||||||
final LinphoneAuthInfo authInfo = getAuthInfo(n);
|
final LinphoneAuthInfo authInfo = getAuthInfo(n);
|
||||||
|
@ -638,6 +652,7 @@ public class LinphonePreferences {
|
||||||
// TODO: remove once issue http://bugs.linphone.org/view.php?id=984 will be fixed
|
// TODO: remove once issue http://bugs.linphone.org/view.php?id=984 will be fixed
|
||||||
LinphoneActivity.instance().getStatusFragment().registrationStateChanged(RegistrationState.RegistrationNone);
|
LinphoneActivity.instance().getStatusFragment().registrationStateChanged(RegistrationState.RegistrationNone);
|
||||||
} else {
|
} else {
|
||||||
|
resetDefaultProxyConfig();
|
||||||
getLc().refreshRegisters();
|
getLc().refreshRegisters();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue