Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9333f4f7 authored by Joe Steele's avatar Joe Steele
Browse files

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

Don't delete certs. on account creation, & assure that only one instance of LocalKeyStore is created.
parent 765b390e
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1900,6 +1900,10 @@ public class Account implements BaseAccount {
        }
        }
        String oldHost = uri.getHost();
        String oldHost = uri.getHost();
        int oldPort = uri.getPort();
        int oldPort = uri.getPort();
        if (oldPort == -1) {
            // This occurs when a new account is created
            return;
        }
        if (!newHost.equals(oldHost) || newPort != oldPort) {
        if (!newHost.equals(oldHost) || newPort != oldPort) {
            LocalKeyStore localKeyStore = LocalKeyStore.getInstance(context);
            LocalKeyStore localKeyStore = LocalKeyStore.getInstance(context);
            localKeyStore.deleteCertificate(oldHost, oldPort);
            localKeyStore.deleteCertificate(oldHost, oldPort);
+1 −1
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@ public class LocalKeyStore {
    private static LocalKeyStore sInstance;
    private static LocalKeyStore sInstance;




    public static LocalKeyStore getInstance(Context context) {
    public synchronized static LocalKeyStore getInstance(Context context) {
        if (sInstance == null) {
        if (sInstance == null) {
            sInstance = new LocalKeyStore(context);
            sInstance = new LocalKeyStore(context);
        }
        }