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

Commit 9fb7b17c authored by Kazuhiro Ondo's avatar Kazuhiro Ondo Committed by Android Git Automerger
Browse files

am a98c353f: Don\'t enable SIM PIN Lock menu if SIM is not available

* commit 'a98c353f':
  Don't enable SIM PIN Lock menu if SIM is not available
parents e8b0e7d3 a98c353f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -185,6 +185,14 @@ public class SecuritySettings extends SettingsPreferenceFragment
        if ((TelephonyManager.PHONE_TYPE_CDMA == tm.getCurrentPhoneType()) &&
                (tm.getLteOnCdmaMode() != Phone.LTE_ON_CDMA_TRUE)) {
            root.removePreference(root.findPreference(KEY_SIM_LOCK));
        } else {
            // Disable SIM lock if sim card is missing or unknown
            if ((TelephonyManager.getDefault().getSimState() ==
                                 TelephonyManager.SIM_STATE_ABSENT) ||
                (TelephonyManager.getDefault().getSimState() ==
                                 TelephonyManager.SIM_STATE_UNKNOWN)) {
                root.findPreference(KEY_SIM_LOCK).setEnabled(false);
            }
        }

        // Show password