Don't delete certs. on account creation, & assure that only one instance of LocalKeyStore is created.

This commit is contained in:
Joe Steele 2013-12-03 19:03:41 -05:00 committed by cketti
parent 8d85fe7e9e
commit 255bf1fb36
2 changed files with 5 additions and 1 deletions

View File

@ -1900,6 +1900,10 @@ public class Account implements BaseAccount {
}
String oldHost = uri.getHost();
int oldPort = uri.getPort();
if (oldPort == -1) {
// This occurs when a new account is created
return;
}
if (!newHost.equals(oldHost) || newPort != oldPort) {
LocalKeyStore localKeyStore = LocalKeyStore.getInstance(context);
localKeyStore.deleteCertificate(oldHost, oldPort);

View File

@ -24,7 +24,7 @@ public class LocalKeyStore {
private static LocalKeyStore sInstance;
public static LocalKeyStore getInstance(Context context) {
public synchronized static LocalKeyStore getInstance(Context context) {
if (sInstance == null) {
sInstance = new LocalKeyStore(context);
}