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

Commit c28d7322 authored by Amit Mahajan's avatar Amit Mahajan Committed by android-build-merger
Browse files

Merge "Avoid deadlock in getIccSimChallengeResponse() when disposing IccRecords"

am: 1288d456

Change-Id: I31842b5585293487ec8b6a8c347f197f33e3c01c
parents 8033cae2 1288d456
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -176,6 +176,14 @@ public abstract class IccRecords extends Handler implements IccConstants {
     */
     */
    public void dispose() {
    public void dispose() {
        mDestroyed.set(true);
        mDestroyed.set(true);

        // It is possible that there is another thread waiting for the response
        // to requestIccSimAuthentication() in getIccSimChallengeResponse().
        auth_rsp = null;
        synchronized (mLock) {
            mLock.notifyAll();
        }

        mParentApp = null;
        mParentApp = null;
        mFh = null;
        mFh = null;
        mCi = null;
        mCi = null;
@@ -693,6 +701,11 @@ public abstract class IccRecords extends Handler implements IccConstants {
            return null;
            return null;
        }
        }


        if (auth_rsp == null) {
            loge("getIccSimChallengeResponse: No authentication response");
            return null;
        }

        if (DBG) log("getIccSimChallengeResponse: return auth_rsp");
        if (DBG) log("getIccSimChallengeResponse: return auth_rsp");


        return android.util.Base64.encodeToString(auth_rsp.payload, android.util.Base64.NO_WRAP);
        return android.util.Base64.encodeToString(auth_rsp.payload, android.util.Base64.NO_WRAP);