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

Commit b106d4b1 authored by Hung-ying Tyan's avatar Hung-ying Tyan
Browse files

Fix potential hang in getIccSimChallengeResponse

When calling TelephonyManager.getIccSimChallengeResponse with appType
APPTYPE_ISIM, the Phone process will hang in
IccRecords.getIccSimChallengeResponse because the response event 90
(i.e., EVENT_AKA_AUTHENTICATE_DONE) collides with the ISIM authentication
response event in IsimUiccRecords and thus it will be wrongly handled in
IsimUiccRecords instead of IccRecords.

Change-Id: I485fef52144fd011d9d1ef6eaf3625fc320c8980
parent 78232be3
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public final class IsimUiccRecords extends IccRecords implements IsimRecords {

    private static final int EVENT_APP_READY = 1;
    private static final int EVENT_ISIM_REFRESH = 31;
    private static final int EVENT_AKA_AUTHENTICATE_DONE          = 90;
    private static final int EVENT_ISIM_AUTHENTICATE_DONE          = 91;

    // ISIM EF records (see 3GPP TS 31.103)
    private String mIsimImpi;               // IMS private user identity
@@ -130,9 +130,9 @@ public final class IsimUiccRecords extends IccRecords implements IsimRecords {
                    }
                    break;

                case EVENT_AKA_AUTHENTICATE_DONE:
                case EVENT_ISIM_AUTHENTICATE_DONE:
                    ar = (AsyncResult)msg.obj;
                    log("EVENT_AKA_AUTHENTICATE_DONE");
                    log("EVENT_ISIM_AUTHENTICATE_DONE");
                    if (ar.exception != null) {
                        log("Exception ISIM AKA: " + ar.exception);
                    } else {
@@ -437,7 +437,7 @@ public final class IsimUiccRecords extends IccRecords implements IsimRecords {
        if (DBG) log("getIsimChallengeResponse-nonce:"+nonce);
        try {
            synchronized(mLock) {
                mCi.requestIsimAuthentication(nonce,obtainMessage(EVENT_AKA_AUTHENTICATE_DONE));
                mCi.requestIsimAuthentication(nonce,obtainMessage(EVENT_ISIM_AUTHENTICATE_DONE));
                try {
                    mLock.wait();
                } catch (InterruptedException e) {