From e0ba1884626f69babdd03d71d08a532f4bcaa620 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 18 Mar 2011 09:44:52 -0700 Subject: Hide unsupported lab prefs on phones Change-Id: Iec2fd0a99595de707b6b70f77abb3468ca347ab5 --- .../browser/preferences/LabPreferencesFragment.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src') 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); + } } } } -- cgit v1.1