summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuhiro Ondo <kazuhiro.ondo@motorola.com>2011-12-16 15:34:13 -0600
committerJohn Wang <johnwang@google.com>2011-12-20 14:30:15 -0800
commita98c353f8b18607f0c2e9af26b91bf6ffbe8dc78 (patch)
tree21e05b99b757953d0e598eadd00664c15836941c
parent2bccd7f4a7793fd78dd9c83e9fe613ea9e32513b (diff)
downloadSettings-a98c353f8b18607f0c2e9af26b91bf6ffbe8dc78.tar.gz
Don't enable SIM PIN Lock menu if SIM is not availableandroid-cts-verifier-4.0.3_r1
Bug: 5774681 Change-Id: I1edd1447ff83ab8cf9e8a1eb8fbd85ef0becdce7
-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 ab58dd50945..7ca58152c0f 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