mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Don't delete certs. on account creation, & assure that only one instance of LocalKeyStore is created.
This commit is contained in:
parent
765b390eb5
commit
9333f4f7f4
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user