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

Commit 1288d456 authored by Amit Mahajan's avatar Amit Mahajan Committed by Gerrit Code Review
Browse files

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

parents 8033cae2 346d3b47
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);