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

Commit 7d66a0a4 authored by Michele Berionne's avatar Michele Berionne
Browse files

Fix deadlock between UiccController and UiccProfile

Bug: 192003927
Test: manual
Change-Id: I3eb0fdee38a17b66d744c84278c05391c7397c6a
Merged-In: I1f46b5e1cf5b76ac674eacd09ee9352bb8ba9291
parent 9a11271e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ public class UiccProfile extends IccCard {
    private RegistrantList mOperatorBrandOverrideRegistrants = new RegistrantList();

    private final int mPhoneId;
    private final PinStorage mPinStorage;

    private static final int EVENT_RADIO_OFF_OR_UNAVAILABLE = 1;
    private static final int EVENT_ICC_LOCKED = 2;
@@ -280,7 +281,7 @@ public class UiccProfile extends IccCard {
                        // An error occurred during automatic PIN verification. At this point,
                        // clear the cache and propagate the state.
                        loge("An error occurred during internal PIN verification");
                        UiccController.getInstance().getPinStorage().clearPin(mPhoneId);
                        mPinStorage.clearPin(mPhoneId);
                        updateExternalState();
                    } else {
                        log("Internal PIN verification was successful!");
@@ -320,6 +321,7 @@ public class UiccProfile extends IccCard {
            // for RadioConfig<1.2 eid is not known when the EuiccCard is constructed
            ((EuiccCard) mUiccCard).registerForEidReady(mHandler, EVENT_EID_READY, null);
        }
        mPinStorage = UiccController.getInstance().getPinStorage();

        update(c, ci, ics);
        ci.registerForOffOrNotAvailable(mHandler, EVENT_RADIO_OFF_OR_UNAVAILABLE, null);
@@ -625,7 +627,7 @@ public class UiccProfile extends IccCard {
                // If the PIN code is required and an available cached PIN is available, intercept
                // the update of external state and perform an internal PIN verification.
                if (lockedState == IccCardConstants.State.PIN_REQUIRED) {
                    String pin = UiccController.getInstance().getPinStorage().getPin(mPhoneId);
                    String pin = mPinStorage.getPin(mPhoneId);
                    if (!pin.isEmpty()) {
                        log("PIN_REQUIRED[" + mPhoneId + "] - Cache present");
                        mCi.supplyIccPin(pin, mHandler.obtainMessage(EVENT_SUPPLY_ICC_PIN_DONE));