diff options
author | Ahmed ElArabawy <arabawy@google.com> | 2018-03-29 23:31:47 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-03-29 23:31:47 +0000 |
commit | 9bb500a762043adce2fafe06ea3deddd7e8b5889 (patch) | |
tree | fac1f0ab6bf7f4ab760f45f0676d370e7aaf35ae /service | |
parent | 453bfc87609e12da3e831caca0e206eadaf8f186 (diff) | |
parent | a7e4dbab8c8cb4a024b8170c626f526ef322c818 (diff) |
Merge "WifiStateMachine: Act on reported EapFailure error" into pi-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiStateMachine.java | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index efa93223e..2effc4ab4 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -4320,8 +4320,9 @@ public class WifiStateMachine extends StateMachine { mSupplicantStateTracker.sendMessage(WifiMonitor.AUTHENTICATION_FAILURE_EVENT); int disableReason = WifiConfiguration.NetworkSelectionStatus .DISABLED_AUTHENTICATION_FAILURE; + reasonCode = message.arg1; // Check if this is a permanent wrong password failure. - if (isPermanentWrongPasswordFailure(mTargetNetworkId, message.arg1)) { + if (isPermanentWrongPasswordFailure(mTargetNetworkId, reasonCode)) { disableReason = WifiConfiguration.NetworkSelectionStatus .DISABLED_BY_WRONG_PASSWORD; WifiConfiguration targetedNetwork = @@ -4330,6 +4331,8 @@ public class WifiStateMachine extends StateMachine { mWrongPasswordNotifier.onWrongPasswordError( targetedNetwork.SSID); } + } else if (reasonCode == WifiManager.ERROR_AUTH_FAILURE_EAP_FAILURE) { + handleEapAuthFailure(mTargetNetworkId, message.arg2); } mWifiConfigManager.updateNetworkSelectionStatus( mTargetNetworkId, disableReason); @@ -4860,6 +4863,25 @@ public class WifiStateMachine extends StateMachine { return TextUtils.equals(config.FQDN, providerFqdn); } + private void handleEapAuthFailure(int networkId, int errorCode) { + WifiConfiguration targetedNetwork = + mWifiConfigManager.getConfiguredNetwork(mTargetNetworkId); + if (targetedNetwork != null) { + switch (targetedNetwork.enterpriseConfig.getEapMethod()) { + case WifiEnterpriseConfig.Eap.SIM: + case WifiEnterpriseConfig.Eap.AKA: + case WifiEnterpriseConfig.Eap.AKA_PRIME: + if (errorCode == WifiNative.EAP_SIM_VENDOR_SPECIFIC_CERT_EXPIRED) { + getTelephonyManager().resetCarrierKeysForImsiEncryption(); + } + break; + + default: + // Do Nothing + } + } + } + private class WifiNetworkAgent extends NetworkAgent { public WifiNetworkAgent(Looper l, Context c, String TAG, NetworkInfo ni, NetworkCapabilities nc, LinkProperties lp, int score, NetworkMisc misc) { |