Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 102289f9 authored by Junda Liu's avatar Junda Liu Committed by Android (Google) Code Review
Browse files

Merge "support authType for sim challenge." into nyc-dev

parents c77603fe 976973b8
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
        }
    }

    public String getIccSimChallengeResponse(int subId, int appType, String data)
    public String getIccSimChallengeResponse(int subId, int appType, int authType, String data)
            throws RemoteException {
        Phone phone = getPhone(subId);
        enforcePrivilegedPermissionOrCarrierPrivilege(phone);
@@ -396,21 +396,13 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
                    + " specified type -- " + appType);
        }

        int authContext = uiccApp.getAuthContext();

        if (data.length() < 32) {
            /* must use EAP_SIM context */
            loge("data is too small to use EAP_AKA, using EAP_SIM instead");
            authContext = UiccCardApplication.AUTH_CONTEXT_EAP_SIM;
        }

        if(authContext == UiccCardApplication.AUTH_CONTEXT_UNDEFINED) {
            loge("getIccSimChallengeResponse() authContext undefined for app type " +
                    appType);
        if(authType != UiccCardApplication.AUTH_CONTEXT_EAP_SIM &&
                authType != UiccCardApplication.AUTH_CONTEXT_EAP_AKA) {
            loge("getIccSimChallengeResponse() unsupported authType: " + authType);
            return null;
        }

        return uiccApp.getIccRecords().getIccSimChallengeResponse(authContext, data);
        return uiccApp.getIccRecords().getIccSimChallengeResponse(authType, data);
    }

    public String getGroupIdLevel1(String callingPackage) {
+3 −3
Original line number Diff line number Diff line
@@ -55,9 +55,9 @@ public class UiccCardApplication {
    /**
     * These values are for authContext (parameter P2) per 3GPP TS 31.102 (Section 7.1.2)
     */
    public static final int AUTH_CONTEXT_EAP_SIM = 128;
    public static final int AUTH_CONTEXT_EAP_AKA = 129;
    public static final int AUTH_CONTEXT_UNDEFINED = -1;
    public static final int AUTH_CONTEXT_EAP_SIM = PhoneConstants.AUTH_CONTEXT_EAP_SIM;
    public static final int AUTH_CONTEXT_EAP_AKA = PhoneConstants.AUTH_CONTEXT_EAP_AKA;
    public static final int AUTH_CONTEXT_UNDEFINED = PhoneConstants.AUTH_CONTEXT_UNDEFINED;

    private final Object  mLock = new Object();
    private UiccCard      mUiccCard; //parent