diff options
author | Junda Liu <junda@google.com> | 2016-04-05 17:03:30 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-04-05 17:03:32 +0000 |
commit | 3c81a8ca9afd89f19114e042b91fef594e68f412 (patch) | |
tree | 74dcd77001a388a1f2a75f7c6dcde8711d5d1290 /service | |
parent | b2040e483314ba96a9cbda4d1f24209006fce4d8 (diff) | |
parent | 5ee2476aa8320de89c47697c66e67b8c08864973 (diff) |
Merge "Use new ICC authentication API for wifi statemachine." into nyc-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiStateMachine.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 48397cae5..1fa247645 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -9021,18 +9021,15 @@ public class WifiStateMachine extends StateMachine implements WifiNative.PnoEven String base64Challenge = android.util.Base64.encodeToString( rand, android.util.Base64.NO_WRAP); - /* - * First, try with appType = 2 => USIM according to - * com.android.internal.telephony.PhoneConstants#APPTYPE_xxx - */ - int appType = 2; - String tmResponse = tm.getIccSimChallengeResponse(appType, base64Challenge); + + // Try USIM first for authentication. + String tmResponse = tm.getIccAuthentication(tm.APPTYPE_USIM, + tm.AUTHTYPE_EAP_SIM, base64Challenge); if (tmResponse == null) { /* Then, in case of failure, issue may be due to sim type, retry as a simple sim - * appType = 1 => SIM */ - appType = 1; - tmResponse = tm.getIccSimChallengeResponse(appType, base64Challenge); + tmResponse = tm.getIccAuthentication(tm.APPTYPE_SIM, + tm.AUTHTYPE_EAP_SIM, base64Challenge); } logv("Raw Response - " + tmResponse); @@ -9126,8 +9123,8 @@ public class WifiStateMachine extends StateMachine implements WifiNative.PnoEven TelephonyManager tm = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); if (tm != null) { - int appType = 2; // 2 => USIM - tmResponse = tm.getIccSimChallengeResponse(appType, base64Challenge); + tmResponse = tm.getIccAuthentication(tm.APPTYPE_USIM, + tm.AUTHTYPE_EAP_AKA, base64Challenge); logv("Raw Response - " + tmResponse); } else { loge("could not get telephony manager"); |