Don't enable SIM PIN Lock menu if SIM is not available

Bug: 5774681
Change-Id: I1edd1447ff83ab8cf9e8a1eb8fbd85ef0becdce7
This commit is contained in:
Kazuhiro Ondo
2011-12-16 15:34:13 -06:00
committed by John Wang
parent 2bccd7f4a7
commit a98c353f8b

View File

@@ -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