Merge "KeyStore: stop using state()"
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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());
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user