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

Commit 682428cb authored by Wink Saville's avatar Wink Saville Committed by Android (Google) Code Review
Browse files

Merge "Fake sim status changed appropriately" into jb-mr1-dev

parents 205e3cb5 f860a3f4
Loading
Loading
Loading
Loading
+23 −10
Original line number Diff line number Diff line
@@ -2347,26 +2347,39 @@ public final class RIL extends BaseCommands implements CommandsInterface {
            }
        }

        // Some devices do not send RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED so fake it.
        // See b/7255789
        // Here and below fake RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED, see b/7255789.
        // This is needed otherwise we don't automatically transition to the main lock
        // screen when the pin or puk is entered incorrectly.
        switch (rr.mRequest) {
            case RIL_REQUEST_ENTER_SIM_PIN:
            case RIL_REQUEST_ENTER_SIM_PUK:
            case RIL_REQUEST_ENTER_SIM_PIN2:
            case RIL_REQUEST_ENTER_SIM_PUK2:
                if (mIccStatusChangedRegistrants != null) {
                    if (RILJ_LOGD) {
                        riljLog("ON enter sim puk fakeSimStatusChanged: reg count="
                                + mIccStatusChangedRegistrants.size());
                    }
                    mIccStatusChangedRegistrants.notifyRegistrants();
                }
                break;
        }

        if (error != 0) {
            switch (rr.mRequest) {
                case RIL_REQUEST_ENTER_SIM_PIN:
                case RIL_REQUEST_ENTER_SIM_PIN2:
                case RIL_REQUEST_CHANGE_SIM_PIN:
                case RIL_REQUEST_CHANGE_SIM_PIN2:
                case RIL_REQUEST_SET_FACILITY_LOCK:
                    if (mIccStatusChangedRegistrants != null) {
                        if (RILJ_LOGD) {
                    riljLog("fakeSimStatusChanged: reg count="
                            riljLog("ON some errors fakeSimStatusChanged: reg count="
                                    + mIccStatusChangedRegistrants.size());
                        }
                if (mIccStatusChangedRegistrants != null) {
                        mIccStatusChangedRegistrants.notifyRegistrants();
                    }
                    break;
            }

        if (error != 0) {
            rr.onError(error, ret);
            rr.release();
            return;