Commits

Anonymous committed bbe409d Merge

Merge "KeyStore: stop using state()"

  • Participants
  • Parent commits 5c879e4, ca714d8

Comments (0)

Files changed (3)

File src/com/android/settings/SecuritySettings.java

                     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());
         }
     }
 

File src/com/android/settings/vpn2/VpnSettings.java

         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());

File src/com/android/settings/wifi/WifiSettings.java

         }
 
         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;
    }
 
     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;