Merge "KeyStore: stop using state()"

This commit is contained in:
Kenny Root
2013-02-14 20:18:11 +00:00
committed by Gerrit Code Review
3 changed files with 5 additions and 7 deletions

View File

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

View File

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

View File

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