Do not enable bandwidth reduction settings if key is not available

Bug: 15607413

If bandwidth reduction settings are enabled when a key is not ready
yet, webview network connections stall due to a bug in M36 of chrome.
Do not let it enabled via settings app.

Change-Id: I7dc80c33f72ab59de68f919ef227d5227e6b923d
This commit is contained in:
Selim Gurun
2014-06-16 16:45:53 -07:00
parent 5884f7ff5e
commit 48afff27a2

View File

@@ -358,6 +358,10 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
mAllPrefs.add(mProcessStats);
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());
}
private ListPreference addListPreference(String prefKey) {
@@ -1250,8 +1254,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
private void updateWebViewDataReductionProxyOptions() {
updateCheckBox(mWebViewDataReductionProxy, Settings.Secure.getInt(
getActivity().getContentResolver(),
Settings.Secure.WEBVIEW_DATA_REDUCTION_PROXY, 0) != 0);
getActivity().getContentResolver(),
Settings.Secure.WEBVIEW_DATA_REDUCTION_PROXY, 0) != 0);
}
@Override