summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/settings/SecuritySettings.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index ab58dd5..7ca5815 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -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