Migrate QSB settings to use fragments.

The old-style activity based settings are still present for use on pre-honeycomb
devices for which we want to maintain support.

Bug: 3140953
Dependant on change: Iaabe63beab4d3b910dfc3cf1146d03c2fe75bac1
Change-Id: I96c73fc4a54f6494ba07e65b977d80df74353772
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 11d27b9..defeb74 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -78,7 +78,7 @@
                 android:authorities="com.android.quicksearchbox.shortcuts">
         </provider>
 
-        <activity android:name=".SearchSettingsActivity"
+        <activity android:name=".preferences.SearchSettingsActivityChooser"
                 android:label="@string/search_settings"
                 android:excludeFromRecents="true">
             <intent-filter>
@@ -94,7 +94,17 @@
             </intent-filter>
         </activity>
 
-        <activity android:name=".SearchableItemsSettings"
+        <activity android:name=".preferences.SearchSettingsActivity"
+                android:label="@string/search_settings"
+                android:excludeFromRecents="true">
+        </activity>
+
+        <activity android:name=".preferences.LegacySearchSettingsActivity"
+                android:label="@string/search_settings"
+                android:excludeFromRecents="true">
+        </activity>
+
+        <activity android:name=".preferences.SearchableItemsActivity"
                 android:label="@string/search_sources"
                 android:excludeFromRecents="true">
             <intent-filter>
diff --git a/res/xml/preferences.xml b/res/xml/legacy_preferences.xml
similarity index 95%
rename from res/xml/preferences.xml
rename to res/xml/legacy_preferences.xml
index bee62df..a7c5ee0 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/legacy_preferences.xml
@@ -26,7 +26,7 @@
                 android:summary="@string/search_sources_summary"
                 />
 
-        <com.android.quicksearchbox.OkCancelPreference
+        <com.android.quicksearchbox.preferences.OkCancelPreference
                 android:key="clear_shortcuts"
                 android:persistent="false"
                 android:title="@string/clear_shortcuts"
diff --git a/res/xml/preferences_headers.xml b/res/xml/preferences_headers.xml
new file mode 100644
index 0000000..0b4c542
--- /dev/null
+++ b/res/xml/preferences_headers.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <header android:fragment="com.android.quicksearchbox.preferences.SystemSearchFragment"
+        android:title="@string/system_search_category_title"
+    />
+
+</preference-headers>
diff --git a/res/xml/preferences.xml b/res/xml/system_search_preferences.xml
similarity index 86%
copy from res/xml/preferences.xml
copy to res/xml/system_search_preferences.xml
index bee62df..6ddd4c6 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/system_search_preferences.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
+<!-- Copyright (C) 2010 The Android Open Source Project
 
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
@@ -17,16 +17,14 @@
 <PreferenceScreen
         xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <PreferenceCategory
-            android:title="@string/system_search_category_title">
-
         <PreferenceScreen
                 android:key="search_corpora"
                 android:title="@string/search_sources"
                 android:summary="@string/search_sources_summary"
+                android:fragment="com.android.quicksearchbox.preferences.SearchableItemsFragment"
                 />
 
-        <com.android.quicksearchbox.OkCancelPreference
+        <com.android.quicksearchbox.preferences.OkCancelPreference
                 android:key="clear_shortcuts"
                 android:persistent="false"
                 android:title="@string/clear_shortcuts"
@@ -37,6 +35,4 @@
                 android:negativeButtonText="@string/clear_shortcuts_disagree"
                 />
 
-    </PreferenceCategory>
-
-</PreferenceScreen>
+</PreferenceScreen>
\ No newline at end of file
diff --git a/src/com/android/quicksearchbox/QsbApplication.java b/src/com/android/quicksearchbox/QsbApplication.java
index 7f4cfee..7d006c1 100644
--- a/src/com/android/quicksearchbox/QsbApplication.java
+++ b/src/com/android/quicksearchbox/QsbApplication.java
@@ -73,6 +73,13 @@
         return Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO;
     }
 
+    public static boolean isHoneycombOrLater() {
+        // TODO while Honeycomb is still under development, this doesn't work. When honeycomb is
+        // done, this needs to be changed,
+        //return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
+        return true;
+    }
+
     public static QsbApplication get(Context context) {
         return ((QsbApplicationWrapper) context.getApplicationContext()).getApp();
     }
diff --git a/src/com/android/quicksearchbox/SearchSettingsActivity.java b/src/com/android/quicksearchbox/preferences/LegacySearchSettingsActivity.java
similarity index 67%
rename from src/com/android/quicksearchbox/SearchSettingsActivity.java
rename to src/com/android/quicksearchbox/preferences/LegacySearchSettingsActivity.java
index 5864138..5e01847 100644
--- a/src/com/android/quicksearchbox/SearchSettingsActivity.java
+++ b/src/com/android/quicksearchbox/preferences/LegacySearchSettingsActivity.java
@@ -14,17 +14,21 @@
  * limitations under the License.
  */
 
-package com.android.quicksearchbox;
+package com.android.quicksearchbox.preferences;
+
+import com.android.quicksearchbox.QsbApplication;
+import com.android.quicksearchbox.R;
 
 import android.os.Bundle;
 import android.preference.PreferenceActivity;
 
 /**
- * Activity for setting global search preferences.
+ * Activity for setting global search preferences. This is the version for Gingerbread and earlier
+ * which to not have support for fragments.
  */
-public class SearchSettingsActivity extends PreferenceActivity {
+public class LegacySearchSettingsActivity extends PreferenceActivity {
 
-    private SearchSettingsController mController;
+    private SystemSearchSettingsController mController;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -34,27 +38,26 @@
 
         getPreferenceManager().setSharedPreferencesName(mController.getPreferencesName());
 
-        addPreferencesFromResource(R.xml.preferences);
+        addPreferencesFromResource(R.xml.legacy_preferences);
 
         mController.setClearShortcutsPreference((OkCancelPreference)
                 findPreference(mController.getClearShortcutsPreferenceName()));
 
         mController.setCorporaPreference(findPreference(mController.getCorporaPreferenceName()));
-    }
 
-    protected SearchSettingsController createController() {
-        QsbApplication app = QsbApplication.get(this);
-        return new SearchSettingsController(app.getSettings(), app.getShortcutRepository());
-    }
-
-    protected SearchSettingsController getController() {
-        return mController;
     }
 
     @Override
-    protected void onResume() {
+    public void onResume() {
         super.onResume();
         mController.onResume();
     }
 
+    protected SystemSearchSettingsController createController() {
+        QsbApplication app = QsbApplication.get(this);
+        return new SystemSearchSettingsController(app.getSettings(), app.getShortcutRepository());
+    }
+
+
+
 }
diff --git a/src/com/android/quicksearchbox/OkCancelPreference.java b/src/com/android/quicksearchbox/preferences/OkCancelPreference.java
similarity index 96%
rename from src/com/android/quicksearchbox/OkCancelPreference.java
rename to src/com/android/quicksearchbox/preferences/OkCancelPreference.java
index 14c4feb..33ccdf1 100644
--- a/src/com/android/quicksearchbox/OkCancelPreference.java
+++ b/src/com/android/quicksearchbox/preferences/OkCancelPreference.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.quicksearchbox;
+package com.android.quicksearchbox.preferences;
 
 import android.content.Context;
 import android.preference.DialogPreference;
diff --git a/src/com/android/quicksearchbox/preferences/SearchSettingsActivity.java b/src/com/android/quicksearchbox/preferences/SearchSettingsActivity.java
new file mode 100644
index 0000000..9f9c740
--- /dev/null
+++ b/src/com/android/quicksearchbox/preferences/SearchSettingsActivity.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quicksearchbox.preferences;
+
+import com.android.quicksearchbox.R;
+
+import android.preference.PreferenceActivity;
+
+import java.util.List;
+
+/**
+ * Activity for setting global search preferences.
+ */
+public class SearchSettingsActivity extends PreferenceActivity {
+
+    /**
+     * Populate the activity with the top-level headers.
+     */
+    @Override
+    public void onBuildHeaders(List<Header> target) {
+        loadHeadersFromResource(R.xml.preferences_headers, target);
+    }
+
+}
diff --git a/src/com/android/quicksearchbox/preferences/SearchSettingsActivityChooser.java b/src/com/android/quicksearchbox/preferences/SearchSettingsActivityChooser.java
new file mode 100644
index 0000000..add5ea4
--- /dev/null
+++ b/src/com/android/quicksearchbox/preferences/SearchSettingsActivityChooser.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quicksearchbox.preferences;
+
+import com.android.quicksearchbox.QsbApplication;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+
+/**
+ * Activity to choose correct version of Search Activity dependent on Android version.
+ */
+public class SearchSettingsActivityChooser extends Activity {
+
+    private static final String TAG = "QSB.SearchSettingsActivityChooser";
+    private static final boolean DBG = true;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        Intent settingsIntent = new Intent(Intent.ACTION_DEFAULT);
+        Class<?> activityClass;
+        if (QsbApplication.isHoneycombOrLater()) {
+            activityClass = getHoneycombActivityClass();
+        } else {
+            activityClass = getLegacyActivityClass();
+        }
+        if (DBG) {
+            Log.d(TAG, "isHoneyComb: " + QsbApplication.isHoneycombOrLater() +
+                    " class = " + activityClass);
+        }
+        settingsIntent.setClass(this, activityClass);
+        startActivity(settingsIntent);
+        finish();
+    }
+
+    protected Class<?> getLegacyActivityClass() {
+        return LegacySearchSettingsActivity.class;
+    }
+
+    protected Class<?> getHoneycombActivityClass() {
+        return SearchSettingsActivity.class;
+    }
+}
diff --git a/src/com/android/quicksearchbox/SearchableItemPreference.java b/src/com/android/quicksearchbox/preferences/SearchableItemPreference.java
similarity index 93%
rename from src/com/android/quicksearchbox/SearchableItemPreference.java
rename to src/com/android/quicksearchbox/preferences/SearchableItemPreference.java
index 36bb874..9926f18 100644
--- a/src/com/android/quicksearchbox/SearchableItemPreference.java
+++ b/src/com/android/quicksearchbox/preferences/SearchableItemPreference.java
@@ -14,7 +14,9 @@
  * limitations under the License.
  */
 
-package com.android.quicksearchbox;
+package com.android.quicksearchbox.preferences;
+
+import com.android.quicksearchbox.R;
 
 import android.content.Context;
 import android.graphics.drawable.Drawable;
diff --git a/src/com/android/quicksearchbox/preferences/SearchableItemsActivity.java b/src/com/android/quicksearchbox/preferences/SearchableItemsActivity.java
new file mode 100644
index 0000000..a7613bb
--- /dev/null
+++ b/src/com/android/quicksearchbox/preferences/SearchableItemsActivity.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quicksearchbox.preferences;
+
+import com.android.quicksearchbox.QsbApplication;
+import com.android.quicksearchbox.R;
+import com.android.quicksearchbox.SearchSettingsImpl;
+
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceGroup;
+
+/**
+ * Activity for selecting searchable items.
+ */
+public class SearchableItemsActivity extends PreferenceActivity {
+
+    private SearchableItemsController mController;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        QsbApplication app = QsbApplication.get(this);
+        mController = new SearchableItemsController(app.getSettings(), app.getCorpora(), this);
+
+        getPreferenceManager().setSharedPreferencesName(SearchSettingsImpl.PREFERENCES_NAME);
+
+        addPreferencesFromResource(R.xml.preferences_searchable_items);
+
+        mController.setCorporaPreferences((PreferenceGroup) getPreferenceScreen().findPreference(
+                mController.getCorporaPreferenceKey()));
+
+    }
+
+}
diff --git a/src/com/android/quicksearchbox/SearchableItemsSettings.java b/src/com/android/quicksearchbox/preferences/SearchableItemsController.java
similarity index 70%
rename from src/com/android/quicksearchbox/SearchableItemsSettings.java
rename to src/com/android/quicksearchbox/preferences/SearchableItemsController.java
index fe44dc1..20e97eb 100644
--- a/src/com/android/quicksearchbox/SearchableItemsSettings.java
+++ b/src/com/android/quicksearchbox/preferences/SearchableItemsController.java
@@ -13,21 +13,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+package com.android.quicksearchbox.preferences;
 
-package com.android.quicksearchbox;
+import com.android.quicksearchbox.Corpora;
+import com.android.quicksearchbox.Corpus;
+import com.android.quicksearchbox.R;
+import com.android.quicksearchbox.SearchSettings;
+import com.android.quicksearchbox.SearchSettingsImpl;
 
-import android.os.Bundle;
+import android.content.Context;
+import android.content.res.Resources;
 import android.preference.Preference;
 import android.preference.Preference.OnPreferenceChangeListener;
-import android.preference.PreferenceActivity;
 import android.preference.PreferenceGroup;
 import android.util.Log;
 
 /**
- * Activity for selecting searchable items.
+ * Logic backing the searchable items activity or fragment.
  */
-public class SearchableItemsSettings extends PreferenceActivity
-        implements OnPreferenceChangeListener {
+public class SearchableItemsController implements OnPreferenceChangeListener {
 
     private static final boolean DBG = false;
     private static final String TAG = "QSB.SearchableItemsSettings";
@@ -35,31 +39,46 @@
     // Only used to find the preferences after inflating
     private static final String SEARCH_CORPORA_PREF = "search_corpora";
 
+    private final SearchSettings mSearchSettings;
+    private final Corpora mCorpora;
+    private final Context mContext;
+
     // References to the top-level preference objects
     private PreferenceGroup mCorporaPreferences;
 
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
+    public SearchableItemsController(SearchSettings searchSettings, Corpora corpora,
+            Context context) {
+        mSearchSettings = searchSettings;
+        mCorpora = corpora;
+        mContext = context;
+    }
 
-        getPreferenceManager().setSharedPreferencesName(SearchSettingsImpl.PREFERENCES_NAME);
-
-        addPreferencesFromResource(R.xml.preferences_searchable_items);
-
-        mCorporaPreferences = (PreferenceGroup) getPreferenceScreen().findPreference(
-                SEARCH_CORPORA_PREF);
-
+    public void setCorporaPreferences(PreferenceGroup corporaPreferences) {
+        mCorporaPreferences = corporaPreferences;
         populateSourcePreference();
     }
 
+    public String getCorporaPreferenceKey() {
+        return SEARCH_CORPORA_PREF;
+    }
+
     private SearchSettings getSettings() {
-        return QsbApplication.get(this).getSettings();
+        return mSearchSettings;
     }
 
     private Corpora getCorpora() {
-        return QsbApplication.get(this).getCorpora();
+        return mCorpora;
     }
 
+    private Context getContext() {
+        return mContext;
+    }
+
+    private Resources getResources() {
+        return getContext().getResources();
+    }
+
+
     /**
      * Fills the suggestion source list.
      */
@@ -82,7 +101,7 @@
      * Adds a suggestion source to the list of suggestion source checkbox preferences.
      */
     private Preference createCorpusPreference(Corpus corpus) {
-        SearchableItemPreference sourcePref = new SearchableItemPreference(this);
+        SearchableItemPreference sourcePref = new SearchableItemPreference(getContext());
         sourcePref.setKey(SearchSettingsImpl.getCorpusEnabledPreference(corpus));
         // Put web corpus first. The rest are alphabetical.
         if (corpus.isWebCorpus()) {
diff --git a/src/com/android/quicksearchbox/preferences/SearchableItemsFragment.java b/src/com/android/quicksearchbox/preferences/SearchableItemsFragment.java
new file mode 100644
index 0000000..3ed2068
--- /dev/null
+++ b/src/com/android/quicksearchbox/preferences/SearchableItemsFragment.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quicksearchbox.preferences;
+
+import com.android.quicksearchbox.QsbApplication;
+import com.android.quicksearchbox.R;
+import com.android.quicksearchbox.SearchSettingsImpl;
+import com.google.common.annotations.VisibleForTesting;
+
+import android.os.Bundle;
+import android.preference.PreferenceFragment;
+import android.preference.PreferenceGroup;
+
+/**
+ * Fragment for selecting searchable items
+ */
+@VisibleForTesting
+public class SearchableItemsFragment extends PreferenceFragment {
+
+    private SearchableItemsController mController;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        QsbApplication app = QsbApplication.get(getActivity());
+        mController = new SearchableItemsController(app.getSettings(), app.getCorpora(),
+                getActivity());
+
+        getPreferenceManager().setSharedPreferencesName(SearchSettingsImpl.PREFERENCES_NAME);
+
+        addPreferencesFromResource(R.xml.preferences_searchable_items);
+
+        mController.setCorporaPreferences((PreferenceGroup) getPreferenceScreen().findPreference(
+                mController.getCorporaPreferenceKey()));
+
+    }
+
+}
diff --git a/src/com/android/quicksearchbox/preferences/SystemSearchFragment.java b/src/com/android/quicksearchbox/preferences/SystemSearchFragment.java
new file mode 100644
index 0000000..50438a5
--- /dev/null
+++ b/src/com/android/quicksearchbox/preferences/SystemSearchFragment.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quicksearchbox.preferences;
+
+import com.android.quicksearchbox.QsbApplication;
+import com.android.quicksearchbox.R;
+import com.google.common.annotations.VisibleForTesting;
+
+import android.os.Bundle;
+import android.preference.PreferenceFragment;
+
+/**
+ * System search settings fragment.
+ */
+@VisibleForTesting
+public class SystemSearchFragment extends PreferenceFragment {
+
+    private SystemSearchSettingsController mController;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        mController = createController();
+
+        getPreferenceManager().setSharedPreferencesName(mController.getPreferencesName());
+
+        addPreferencesFromResource(R.xml.system_search_preferences);
+
+        mController.setClearShortcutsPreference((OkCancelPreference)
+                findPreference(mController.getClearShortcutsPreferenceName()));
+
+        mController.setCorporaPreference(findPreference(mController.getCorporaPreferenceName()));
+
+    }
+
+    protected SystemSearchSettingsController createController() {
+        QsbApplication app = QsbApplication.get(getActivity());
+        return new SystemSearchSettingsController(app.getSettings(), app.getShortcutRepository());
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        mController.onResume();
+    }
+}
diff --git a/src/com/android/quicksearchbox/SearchSettingsController.java b/src/com/android/quicksearchbox/preferences/SystemSearchSettingsController.java
similarity index 92%
rename from src/com/android/quicksearchbox/SearchSettingsController.java
rename to src/com/android/quicksearchbox/preferences/SystemSearchSettingsController.java
index c520247..7da19ed 100644
--- a/src/com/android/quicksearchbox/SearchSettingsController.java
+++ b/src/com/android/quicksearchbox/preferences/SystemSearchSettingsController.java
@@ -13,8 +13,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.quicksearchbox;
+package com.android.quicksearchbox.preferences;
 
+import com.android.quicksearchbox.SearchSettings;
+import com.android.quicksearchbox.ShortcutRepository;
 import com.android.quicksearchbox.util.Consumer;
 import com.android.quicksearchbox.util.Consumers;
 
@@ -27,7 +29,7 @@
 /**
  * Logic sitting behind SearchSettingsActivity
  */
-public class SearchSettingsController
+public class SystemSearchSettingsController
         implements OnPreferenceChangeListener, OnPreferenceClickListener {
 
     private static final boolean DBG = false;
@@ -52,7 +54,7 @@
     // References to the top-level preference objects
     private OkCancelPreference mClearShortcutsPreference;
 
-    public SearchSettingsController(SearchSettings settings, ShortcutRepository shortcuts) {
+    public SystemSearchSettingsController(SearchSettings settings, ShortcutRepository shortcuts) {
         mSettings = settings;
         mShortcuts = shortcuts;
     }
@@ -82,7 +84,7 @@
     }
 
     public void setCorporaPreference(Preference corpora) {
-        corpora.setIntent(getSettings().getSearchableItemsIntent());
+        // nothing needs doing.
     }
 
     public void onResume() {