From 41745a430d1a3bd2bda9b313a9b35c35182adabd Mon Sep 17 00:00:00 2001 From: Selim Gurun Date: Tue, 17 Jun 2014 10:24:44 -0700 Subject: [PATCH] Gray out the selection while the key is not available. Bug: 15607413 The old logic was simply making it not selectable. This will disable it and gray it out providing better feedback. Change-Id: Iaeaae43f28100ba1a1550db0a919172a249054e8 --- src/com/android/settings/DevelopmentSettings.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index 87b1f32b4eb..90aee7d1c92 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -360,8 +360,10 @@ public class DevelopmentSettings extends SettingsPreferenceFragment mWebViewDataReductionProxy = findAndInitCheckboxPref(WEBVIEW_DATA_REDUCTION_PROXY_KEY); String key = Settings.Global.getString(getActivity().getContentResolver(), Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); - // Make it not selectable if the key is not available for some reason. - mWebViewDataReductionProxy.setSelectable(key != null && !key.isEmpty()); + // Disable the selection if the key is not available for some reason. + if (key == null || key.isEmpty()) { + disableForUser(mWebViewDataReductionProxy); + } } private ListPreference addListPreference(String prefKey) {