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

Commit aa97bf2e 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

am: c28d7322

Change-Id: I532502339d0c0a8ef5bb92214b2a8e965bec813f
parents 1a8d8682 c28d7322
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -176,6 +176,14 @@ public abstract class IccRecords extends Handler implements IccConstants {
     */
    public void dispose() {
        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;
        mFh = null;
        mCi = null;
@@ -693,6 +701,11 @@ public abstract class IccRecords extends Handler implements IccConstants {
            return null;
        }

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

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

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