Update enterprise API usage
Also, remove the unnecessary keystore lock/unlock checks since these are now controlled at lockscreen Change-Id: If65c4029d4cf2b8377fbc3512c9f691572125995
This commit is contained in:
@@ -46,7 +46,6 @@ import android.preference.Preference;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.security.Credentials;
|
||||
import android.security.KeyStore;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
@@ -135,8 +134,6 @@ public class WifiSettings extends SettingsPreferenceFragment
|
||||
|
||||
private AtomicBoolean mConnected = new AtomicBoolean(false);
|
||||
|
||||
private int mKeyStoreNetworkId = INVALID_NETWORK_ID;
|
||||
|
||||
private WifiDialog mDialog;
|
||||
|
||||
private TextView mEmptyView;
|
||||
@@ -412,12 +409,6 @@ public class WifiSettings extends SettingsPreferenceFragment
|
||||
}
|
||||
|
||||
getActivity().registerReceiver(mReceiver, mFilter);
|
||||
if (mKeyStoreNetworkId != INVALID_NETWORK_ID &&
|
||||
KeyStore.getInstance().state() == KeyStore.State.UNLOCKED) {
|
||||
mWifiManager.connect(mKeyStoreNetworkId, mConnectListener);
|
||||
}
|
||||
mKeyStoreNetworkId = INVALID_NETWORK_ID;
|
||||
|
||||
updateAccessPoints();
|
||||
}
|
||||
|
||||
@@ -560,10 +551,8 @@ public class WifiSettings extends SettingsPreferenceFragment
|
||||
switch (item.getItemId()) {
|
||||
case MENU_ID_CONNECT: {
|
||||
if (mSelectedAccessPoint.networkId != INVALID_NETWORK_ID) {
|
||||
if (!requireKeyStore(mSelectedAccessPoint.getConfig())) {
|
||||
mWifiManager.connect(mSelectedAccessPoint.networkId,
|
||||
mConnectListener);
|
||||
}
|
||||
mWifiManager.connect(mSelectedAccessPoint.networkId,
|
||||
mConnectListener);
|
||||
} else if (mSelectedAccessPoint.security == AccessPoint.SECURITY_NONE) {
|
||||
/** Bypass dialog for unsecured networks */
|
||||
mSelectedAccessPoint.generateOpenNetworkConfig();
|
||||
@@ -700,16 +689,6 @@ public class WifiSettings extends SettingsPreferenceFragment
|
||||
&& telephonyManager.getSimState() != TelephonyManager.SIM_STATE_UNKNOWN;
|
||||
}
|
||||
|
||||
private boolean requireKeyStore(WifiConfiguration config) {
|
||||
if (WifiConfigController.requireKeyStore(config) &&
|
||||
KeyStore.getInstance().state() != KeyStore.State.UNLOCKED) {
|
||||
mKeyStoreNetworkId = config.networkId;
|
||||
Credentials.getInstance().unlock(getActivity());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the latest access points available with supplimental information like
|
||||
* the strength of network and the security for it.
|
||||
@@ -971,7 +950,6 @@ public class WifiSettings extends SettingsPreferenceFragment
|
||||
|
||||
if (config == null) {
|
||||
if (mSelectedAccessPoint != null
|
||||
&& !requireKeyStore(mSelectedAccessPoint.getConfig())
|
||||
&& mSelectedAccessPoint.networkId != INVALID_NETWORK_ID) {
|
||||
mWifiManager.connect(mSelectedAccessPoint.networkId,
|
||||
mConnectListener);
|
||||
@@ -981,7 +959,7 @@ public class WifiSettings extends SettingsPreferenceFragment
|
||||
mWifiManager.save(config, mSaveListener);
|
||||
}
|
||||
} else {
|
||||
if (configController.isEdit() || requireKeyStore(config)) {
|
||||
if (configController.isEdit()) {
|
||||
mWifiManager.save(config, mSaveListener);
|
||||
} else {
|
||||
mWifiManager.connect(config, mConnectListener);
|
||||
|
Reference in New Issue
Block a user