From 5c68e12493d3c81324179c7c3ba6cd58279d648b Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Wed, 23 May 2012 15:42:46 -0700 Subject: [PATCH] Don't show SIM LOCK settings if there's no Icc card. Bug: 6525359 Change-Id: I7bf2a1799ca3032a5dbfa15320d862195b9659f7 --- src/com/android/settings/SecuritySettings.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index 88a2d339de1..8196d0b079b 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -201,10 +201,9 @@ public class SecuritySettings extends SettingsPreferenceFragment // Append the rest of the settings addPreferencesFromResource(R.xml.security_settings_misc); - // Do not display SIM lock for CDMA phone + // Do not display SIM lock for devices without an Icc card TelephonyManager tm = TelephonyManager.getDefault(); - if ((TelephonyManager.PHONE_TYPE_CDMA == tm.getCurrentPhoneType()) && - (tm.getLteOnCdmaMode() != Phone.LTE_ON_CDMA_TRUE)) { + if (!tm.hasIccCard()) { root.removePreference(root.findPreference(KEY_SIM_LOCK)); } else { // Disable SIM lock if sim card is missing or unknown