diff options
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 b24d89519..c30af3c99 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -4306,8 +4306,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 = @@ -4316,6 +4317,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); @@ -4846,6 +4849,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) { |