diff options
author | Ecco Park <eccopark@google.com> | 2018-09-13 21:03:30 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-09-13 21:03:30 +0000 |
commit | cbb8527acff680300c7d853318ed3afbd0663078 (patch) | |
tree | a891f4b4fb4b536e826fda5bc3b21289eb2d06d1 | |
parent | 2f92e30191ba70cb945266154b730fe210a428bc (diff) | |
parent | 21d4c6e06c6235c8971324be1bace324ba2b7481 (diff) |
Merge "Cleaning up unnecessary code for TLS reconnect sequence."
4 files changed, 1 insertions, 76 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index f376a6d5f..7781805b2 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -547,9 +547,6 @@ public class ClientModeImpl extends StateMachine { /* Supplicant is trying to associate to a given BSSID */ static final int CMD_TARGET_BSSID = BASE + 141; - /* Reload all networks and reconnect */ - static final int CMD_RELOAD_TLS_AND_RECONNECT = BASE + 142; - static final int CMD_START_CONNECT = BASE + 143; private static final int NETWORK_STATUS_UNWANTED_DISCONNECT = 0; @@ -732,11 +729,6 @@ public class ClientModeImpl extends StateMachine { */ private final WorkSource mLastRunningWifiUids = new WorkSource(); - /* - * Note if we have seen the user sign in - */ - private boolean mFirstUserSignOnSeen = false; - private TelephonyManager mTelephonyManager; private TelephonyManager getTelephonyManager() { if (mTelephonyManager == null) { @@ -1574,13 +1566,6 @@ public class ClientModeImpl extends StateMachine { } /** - * Reload networks and then reconnect; helps load correct data for TLS networks - */ - public void reloadTlsNetworksAndReconnect() { - sendMessage(CMD_RELOAD_TLS_AND_RECONNECT); - } - - /** * Add a network synchronously * * @return network id of the new network @@ -3436,9 +3421,6 @@ public class ClientModeImpl extends StateMachine { case CMD_DISABLE_EPHEMERAL_NETWORK: mMessageHandlingStatus = MESSAGE_HANDLING_STATUS_DISCARD; break; - case CMD_RELOAD_TLS_AND_RECONNECT: - mFirstUserSignOnSeen = true; - break; case CMD_SET_OPERATIONAL_MODE: // using the CMD_SET_OPERATIONAL_MODE (sent at front of queue) to trigger the // state transitions performed in setOperationalMode. @@ -4158,20 +4140,6 @@ public class ClientModeImpl extends StateMachine { mLastConnectAttemptTimestamp = mClock.getWallClockMillis(); mWifiNative.reassociate(mInterfaceName); break; - case CMD_RELOAD_TLS_AND_RECONNECT: - // TODO(b/64033284): determine if this code is still necessary - if (mFirstUserSignOnSeen) { - // a user has already been seen, nothing to do - break; - } - if (mWifiConfigManager.needsUnlockedKeyStore()) { - logd("Reconnecting to give a chance to un-connected TLS networks"); - mWifiNative.disconnect(mInterfaceName); - mLastConnectAttemptTimestamp = mClock.getWallClockMillis(); - mWifiNative.reconnect(mInterfaceName); - } - mFirstUserSignOnSeen = true; - break; case CMD_START_ROAM: mMessageHandlingStatus = MESSAGE_HANDLING_STATUS_DISCARD; return HANDLED; diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java index 40f487471..b21ff0647 100644 --- a/service/java/com/android/server/wifi/WifiConfigManager.java +++ b/service/java/com/android/server/wifi/WifiConfigManager.java @@ -2494,23 +2494,6 @@ public class WifiConfigManager { } /** - * Any network using certificates to authenticate access requires unlocked key store; unless - * the certificates can be stored with hardware encryption - * - * @return true if we need an unlocked keystore, false otherwise. - */ - public boolean needsUnlockedKeyStore() { - for (WifiConfiguration config : getInternalConfiguredNetworks()) { - if (WifiConfigurationUtil.isConfigForEapNetwork(config)) { - if (mWifiKeyStore.needsSoftwareBackedKeyStore(config.enterpriseConfig)) { - return true; - } - } - } - return false; - } - - /** * Helper method to perform the following operations during user switch/unlock: * - Remove private networks of the old user. * - Load from the new user store file. diff --git a/service/java/com/android/server/wifi/WifiKeyStore.java b/service/java/com/android/server/wifi/WifiKeyStore.java index e36c50188..3054fe5e0 100644 --- a/service/java/com/android/server/wifi/WifiKeyStore.java +++ b/service/java/com/android/server/wifi/WifiKeyStore.java @@ -269,25 +269,4 @@ public class WifiKeyStore { } return true; } - - /** - * Checks whether the configuration requires a software backed keystore or not. - * @param config WifiEnterprise config instance pointing to the enterprise configuration of the - * network. - */ - public static boolean needsSoftwareBackedKeyStore(WifiEnterpriseConfig config) { - String client = config.getClientCertificateAlias(); - if (!TextUtils.isEmpty(client)) { - // a valid client certificate is configured - - // BUGBUG(b/29578316): keyStore.get() never returns certBytes; because it is not - // taking WIFI_UID as a parameter. It always looks for certificate - // with SYSTEM_UID, and never finds any Wifi certificates. Assuming that - // all certificates need software keystore until we get the get() API - // fixed. - return true; - } - return false; - } - } diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index e3dbc3ebf..fc7e66481 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -2362,12 +2362,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); - if (action.equals(Intent.ACTION_USER_PRESENT)) { - // TLS networks can't connect until user unlocks keystore. KeyStore - // unlocks when the user punches PIN after the reboot. So use this - // trigger to get those networks connected. - mClientModeImpl.reloadTlsNetworksAndReconnect(); - } else if (action.equals(Intent.ACTION_USER_REMOVED)) { + if (action.equals(Intent.ACTION_USER_REMOVED)) { int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0); mClientModeImpl.removeUserConfigs(userHandle); } else if (action.equals(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED)) { |