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

Commit 36c71e9d authored by Mattias Nilsson's avatar Mattias Nilsson
Browse files

Disable "SIM card lock" when the SIM card is PUK-blocked

For an inserted PUK-blocked SIM card we should not allow
to open lock settings. Add a check for SIM_STATE_PERM_DISABLED
and disable "SIM card lock".

Test: Insert a PUK blocked card and check SIM card lock
Bug: 230370597
Change-Id: I8b468cefe95fb8bd66ab91d6c4569ddb01473fbe
parent 3671fb84
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -95,7 +95,8 @@ public class SimLockPreferenceController extends BasePreferenceController {
        for (SubscriptionInfo subInfo : subInfoList) {
        for (SubscriptionInfo subInfo : subInfoList) {
            final int simState = mTelephonyManager.getSimState(subInfo.getSimSlotIndex());
            final int simState = mTelephonyManager.getSimState(subInfo.getSimSlotIndex());
            if ((simState != TelephonyManager.SIM_STATE_ABSENT)
            if ((simState != TelephonyManager.SIM_STATE_ABSENT)
                    && (simState != TelephonyManager.SIM_STATE_UNKNOWN)) {
                    && (simState != TelephonyManager.SIM_STATE_UNKNOWN)
                    && (simState != TelephonyManager.SIM_STATE_PERM_DISABLED)) {
                return true;
                return true;
            }
            }
        }
        }