Fix accounts multiple display if first one disabled

This commit is contained in:
Sylvain Berfini 2012-10-23 16:50:08 +02:00
parent 3f710190ca
commit 14d506e813

View file

@ -577,12 +577,14 @@ public final class LinphoneManager implements LinphoneCoreListener {
} }
public void initAccounts() throws LinphoneCoreException { public void initAccounts() throws LinphoneCoreException {
boolean cleanBefore = true;
for (int i = 0; i < getPrefExtraAccountsNumber(); i++) { for (int i = 0; i < getPrefExtraAccountsNumber(); i++) {
String key = i == 0 ? "" : String.valueOf(i); String key = i == 0 ? "" : String.valueOf(i);
if (getPrefBoolean(getString(R.string.pref_disable_account_key) + key, false)) { if (!getPrefBoolean(getString(R.string.pref_disable_account_key) + key, false)) {
continue; initAccount(key, cleanBefore, i == getPrefInt(R.string.pref_default_account_key, 0));
cleanBefore = false;
} }
initAccount(key, i == 0, i == getPrefInt(R.string.pref_default_account_key, 0));
} }
LinphoneProxyConfig lDefaultProxyConfig = mLc.getDefaultProxyConfig(); LinphoneProxyConfig lDefaultProxyConfig = mLc.getDefaultProxyConfig();