From 1a6e3e175d8ccb5884d147bcda1c77af1f6c35ff Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Wed, 10 Oct 2012 23:56:53 +0200 Subject: Disable security widgets for now Change-Id: Ia4627d697514c4029fb0fb3250d674ed25495f97 --- src/com/android/settings/SecuritySettings.java | 31 ++++++++++++++++++-------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'src/com') diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index f56fc25..2ddd41f 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -39,6 +39,7 @@ import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; +import android.preference.PreferenceCategory; import android.preference.PreferenceGroup; import android.preference.PreferenceScreen; import android.provider.Settings; @@ -99,7 +100,6 @@ public class SecuritySettings extends SettingsPreferenceFragment DevicePolicyManager mDPM; private ChooseLockSettingsHelper mChooseLockSettingsHelper; - private Preference mUserSelectedWidget; private LockPatternUtils mLockPatternUtils; private ListPreference mLockAfter; @@ -232,32 +232,45 @@ public class SecuritySettings extends SettingsPreferenceFragment } } - mUserSelectedWidget = root.findPreference(KEY_CHOOSE_LOCKSCREEN_STATUS_WIDGET); - if (mUserSelectedWidget != null) { + Preference pickStatusWidget = root.findPreference(KEY_CHOOSE_LOCKSCREEN_STATUS_WIDGET); + if (pickStatusWidget != null) { AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getActivity()); int appWidgetId = getStatusAppWidgetId(); if (appWidgetId == -1) { - mUserSelectedWidget.setSummary(getResources().getString(R.string.widget_default)); + pickStatusWidget.setSummary(getResources().getString(R.string.widget_default)); } else { AppWidgetProviderInfo appWidget = appWidgetManager.getAppWidgetInfo(appWidgetId); if (appWidget != null) { - mUserSelectedWidget.setSummary(appWidget.label); + pickStatusWidget.setSummary(appWidget.label); } } + // TEMP: disable this for now + PreferenceCategory security = + (PreferenceCategory) root.findPreference(KEY_SECURITY_CATEGORY); + if (security != null) { + security.removePreference(pickStatusWidget); + } } - mUserSelectedWidget = root.findPreference(KEY_CHOOSE_USER_SELECTED_LOCKSCREEN_WIDGET); - if (mUserSelectedWidget != null) { + Preference pickLockscreenWidget = + root.findPreference(KEY_CHOOSE_USER_SELECTED_LOCKSCREEN_WIDGET); + if (pickLockscreenWidget != null) { AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getActivity()); int appWidgetId = getUserSelectedAppWidgetId(); if (appWidgetId == -1) { - mUserSelectedWidget.setSummary(getResources().getString(R.string.widget_none)); + pickLockscreenWidget.setSummary(getResources().getString(R.string.widget_none)); } else { AppWidgetProviderInfo appWidget = appWidgetManager.getAppWidgetInfo(appWidgetId); if (appWidget != null) { - mUserSelectedWidget.setSummary(appWidget.label); + pickLockscreenWidget.setSummary(appWidget.label); } } + // TEMP: disable this for now + PreferenceCategory security = + (PreferenceCategory) root.findPreference(KEY_SECURITY_CATEGORY); + if (security != null) { + security.removePreference(pickLockscreenWidget); + } } // Append the rest of the settings -- cgit v1.1