OSDN Git Service

remove lockscreen widget checkbox when there's no lockscreen.
authorChris Wren <cwren@android.com>
Tue, 29 Oct 2013 16:30:35 +0000 (12:30 -0400)
committerChris Wren <cwren@android.com>
Tue, 29 Oct 2013 17:42:05 +0000 (13:42 -0400)
Bug: 11190345
Change-Id: I1b48e7a6a70226b103d8a6a27bd3374ff8349b3f

src/com/android/settings/SecuritySettings.java

index e002264..e4dcea1 100644 (file)
@@ -245,7 +245,8 @@ public class SecuritySettings extends RestrictedSettingsFragment
         // Enable or disable keyguard widget checkbox based on DPM state
         mEnableKeyguardWidgets = (CheckBoxPreference) root.findPreference(KEY_ENABLE_WIDGETS);
         if (mEnableKeyguardWidgets != null) {
-            if (ActivityManager.isLowRamDeviceStatic()) {
+            if (ActivityManager.isLowRamDeviceStatic()
+                    || mLockPatternUtils.isLockScreenDisabled()) {
                 // Widgets take a lot of RAM, so disable them on low-memory devices
                 PreferenceGroup securityCategory
                         = (PreferenceGroup) root.findPreference(KEY_SECURITY_CATEGORY);