diff options
author | John Reck <jreck@google.com> | 2011-03-18 09:44:52 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-03-18 09:44:52 -0700 |
commit | e0ba1884626f69babdd03d71d08a532f4bcaa620 (patch) | |
tree | 8899f192ba122ff1a397f741d1f2ff1dcf6a6a3b /src | |
parent | a96db6e02142b0a9f2b652ff015760fd9b6bda28 (diff) | |
download | packages_apps_Browser-e0ba1884626f69babdd03d71d08a532f4bcaa620.zip packages_apps_Browser-e0ba1884626f69babdd03d71d08a532f4bcaa620.tar.gz packages_apps_Browser-e0ba1884626f69babdd03d71d08a532f4bcaa620.tar.bz2 |
Hide unsupported lab prefs on phones
Change-Id: Iec2fd0a99595de707b6b70f77abb3468ca347ab5
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/preferences/LabPreferencesFragment.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/browser/preferences/LabPreferencesFragment.java b/src/com/android/browser/preferences/LabPreferencesFragment.java index a06dc3e..88a9690 100644 --- a/src/com/android/browser/preferences/LabPreferencesFragment.java +++ b/src/com/android/browser/preferences/LabPreferencesFragment.java @@ -42,21 +42,25 @@ public class LabPreferencesFragment extends PreferenceFragment addPreferencesFromResource(R.xml.lab_preferences); Preference e = findPreference(BrowserSettings.PREF_QUICK_CONTROLS); - e.setOnPreferenceChangeListener(this); + if (e != null) { + e.setOnPreferenceChangeListener(this); + } useInstantPref = findPreference(BrowserSettings.PREF_USE_INSTANT); } @Override public void onResume() { super.onResume(); - useInstantPref.setEnabled(false); + if (useInstantPref != null) { + useInstantPref.setEnabled(false); - // Enable the "use instant" preference only if the selected - // search engine is google. - if (mBrowserSettings.getSearchEngine() != null) { - final String currentName = mBrowserSettings.getSearchEngine().getName(); - if (SearchEngine.GOOGLE.equals(currentName)) { - useInstantPref.setEnabled(true); + // Enable the "use instant" preference only if the selected + // search engine is google. + if (mBrowserSettings.getSearchEngine() != null) { + final String currentName = mBrowserSettings.getSearchEngine().getName(); + if (SearchEngine.GOOGLE.equals(currentName)) { + useInstantPref.setEnabled(true); + } } } } |