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

Commit ca714d8d authored by Kenny Root's avatar Kenny Root
Browse files

KeyStore: stop using state()

Change-Id: Ia8fc945666c59c0b9a9bd6f890cc2a6b8859e1d4
parent 5c879e48
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -407,9 +407,9 @@ public class SecuritySettings extends SettingsPreferenceFragment
                    Settings.System.TEXT_SHOW_PASSWORD, 1) != 0);
        }

        KeyStore.State state = KeyStore.getInstance().state();
        if (mResetCredentials != null) {
            mResetCredentials.setEnabled(state != KeyStore.State.UNINITIALIZED);
            KeyStore keyStore = KeyStore.getInstance();
            mResetCredentials.setEnabled(!keyStore.isUnlocked());
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ public class VpnSettings extends SettingsPreferenceFragment implements
        super.onResume();

        // Check KeyStore here, so others do not need to deal with it.
        if (mKeyStore.state() != KeyStore.State.UNLOCKED) {
        if (!mKeyStore.isUnlocked()) {
            if (!mUnlocking) {
                // Let us unlock KeyStore. See you later!
                Credentials.getInstance().unlock(getActivity());
+2 −4
Original line number Diff line number Diff line
@@ -412,8 +412,7 @@ public class WifiSettings extends SettingsPreferenceFragment
        }

        getActivity().registerReceiver(mReceiver, mFilter);
        if (mKeyStoreNetworkId != INVALID_NETWORK_ID &&
                KeyStore.getInstance().state() == KeyStore.State.UNLOCKED) {
        if (mKeyStoreNetworkId != INVALID_NETWORK_ID && KeyStore.getInstance().isUnlocked()) {
            mWifiManager.connect(mKeyStoreNetworkId, mConnectListener);
        }
        mKeyStoreNetworkId = INVALID_NETWORK_ID;
@@ -701,8 +700,7 @@ public class WifiSettings extends SettingsPreferenceFragment
   }

    private boolean requireKeyStore(WifiConfiguration config) {
        if (WifiConfigController.requireKeyStore(config) &&
                KeyStore.getInstance().state() != KeyStore.State.UNLOCKED) {
        if (WifiConfigController.requireKeyStore(config) && !KeyStore.getInstance().isUnlocked()) {
            mKeyStoreNetworkId = config.networkId;
            Credentials.getInstance().unlock(getActivity());
            return true;