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

Commit d2537ec6 authored by Rakesh Pallerla's avatar Rakesh Pallerla Committed by Steve Kondik
Browse files

Telephony: Disable PIN Toggle option if SIM is in Locked state.

When user presses cancel in PIN lock screen, card will be in
LOCKED state and hence cannot access SIM for any transactions.

So Disable PIN Toggle option in Locked State.

Change-Id: Id569c9976c6fb9a3b2490577c80348cf2f2489ab
CRs-Fixed: 576782
parent 776e9b92
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -124,9 +124,17 @@ public class IccLockSettings extends PreferenceActivity
        public void onReceive(Context context, Intent intent) {
            final String action = intent.getAction();
            if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(action)) {
                if (mPhone.getIccCard().getState().isPinLocked()) {
                    //Code control lands up here only if user pressed cancel for PIN unlock.
                    //So disable the pin toggle option as card is in LOCKED state.
                    mPinToggle.setChecked(true);
                    mPinToggle.setEnabled(false);
                } else {
                    mPinToggle.setEnabled(true);
                    mHandler.sendMessage(mHandler.obtainMessage(MSG_SIM_STATE_CHANGED));
                }
            }
        }
    };

    // For top-level settings screen to query