diff options
author | Mathew Inwood <mathewi@google.com> | 2011-10-06 02:11:15 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-06 02:11:15 -0700 |
commit | 6907bea676e806fff847746465b836bd9ed39213 (patch) | |
tree | 3d17833d5288c35324e041a4b27e7c75ee8f5116 /src/com/android/browser/preferences | |
parent | b742d80e5eee20626d0ed4024d7d7bb51c402cee (diff) | |
parent | 825fba7eb4dae7911f84d8a48a662c4cd6a4db1f (diff) | |
download | packages_apps_Browser-6907bea676e806fff847746465b836bd9ed39213.zip packages_apps_Browser-6907bea676e806fff847746465b836bd9ed39213.tar.gz packages_apps_Browser-6907bea676e806fff847746465b836bd9ed39213.tar.bz2 |
Merge "Allow default preload setting to be configured via Gservices."
Diffstat (limited to 'src/com/android/browser/preferences')
-rw-r--r-- | src/com/android/browser/preferences/BandwidthPreferencesFragment.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/com/android/browser/preferences/BandwidthPreferencesFragment.java b/src/com/android/browser/preferences/BandwidthPreferencesFragment.java index 18b9fa4..2c147cc 100644 --- a/src/com/android/browser/preferences/BandwidthPreferencesFragment.java +++ b/src/com/android/browser/preferences/BandwidthPreferencesFragment.java @@ -16,12 +16,11 @@ package com.android.browser.preferences; -import android.content.res.Resources; import android.os.Bundle; -import android.preference.Preference; +import android.preference.ListPreference; import android.preference.PreferenceFragment; -import android.util.Log; +import com.android.browser.BrowserSettings; import com.android.browser.PreferenceKeys; import com.android.browser.R; @@ -36,4 +35,18 @@ public class BandwidthPreferencesFragment extends PreferenceFragment { addPreferencesFromResource(R.xml.bandwidth_preferences); } + @Override + public void onResume() { + super.onResume(); + if (!getPreferenceScreen().getSharedPreferences() + .contains(PreferenceKeys.PREF_DATA_PRELOAD)) { + // set default value for preload setting + ListPreference preload = (ListPreference) getPreferenceScreen().findPreference( + PreferenceKeys.PREF_DATA_PRELOAD); + if (preload != null) { + preload.setValue(BrowserSettings.getInstance().getDefaultPreloadSetting()); + } + } + } + } |