summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/search
diff options
context:
space:
mode:
authorRaff Tsai <rafftsai@google.com>2019-09-19 17:06:45 +0800
committerRaff Tsai <rafftsai@google.com>2019-09-24 00:35:52 +0800
commitac3e0d0988dc8d75c201f455f4fc2e134243044e (patch)
tree3beb455295f8f0a1578d16700bdb6f2aeef5d93c /src/com/android/settings/search
parent5ff9517f23af0299af5b4ca9959923f79cde512a (diff)
downloadpackages_apps_Settings-ac3e0d0988dc8d75c201f455f4fc2e134243044e.tar.gz
packages_apps_Settings-ac3e0d0988dc8d75c201f455f4fc2e134243044e.tar.bz2
packages_apps_Settings-ac3e0d0988dc8d75c201f455f4fc2e134243044e.zip
Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write xml resource id twice. - Remove getPreferenceControllers from Indexable.java. Because it will move to SettingsLib later for other apps which don't need this function Bug: 135053028 Test: robolectric Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
Diffstat (limited to 'src/com/android/settings/search')
-rw-r--r--src/com/android/settings/search/BaseSearchIndexProvider.java8
-rw-r--r--src/com/android/settings/search/Indexable.java7
2 files changed, 7 insertions, 8 deletions
diff --git a/src/com/android/settings/search/BaseSearchIndexProvider.java b/src/com/android/settings/search/BaseSearchIndexProvider.java
index 64e6a9c0d2..58b571eaf9 100644
--- a/src/com/android/settings/search/BaseSearchIndexProvider.java
+++ b/src/com/android/settings/search/BaseSearchIndexProvider.java
@@ -103,7 +103,6 @@ public class BaseSearchIndexProvider implements Indexable.SearchIndexProvider {
return nonIndexableKeys;
}
- @Override
public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllersFromCode =
createPreferenceControllers(context);
@@ -136,6 +135,13 @@ public class BaseSearchIndexProvider implements Indexable.SearchIndexProvider {
}
/**
+ * Returns the xml resource Id.
+ */
+ public int getXmlResourceId() {
+ return mXmlRes;
+ }
+
+ /**
* Returns true if the page should be considered in search query. If return false, entire page
* will be suppressed during search query.
*/
diff --git a/src/com/android/settings/search/Indexable.java b/src/com/android/settings/search/Indexable.java
index eef7184762..e3d917663f 100644
--- a/src/com/android/settings/search/Indexable.java
+++ b/src/com/android/settings/search/Indexable.java
@@ -70,12 +70,5 @@ public interface Indexable {
*/
@Keep
List<String> getNonIndexableKeys(Context context);
-
- /**
- * @return a list of {@link AbstractPreferenceController} for ResultPayload data during
- * Indexing.
- */
- @Keep
- List<AbstractPreferenceController> getPreferenceControllers(Context context);
}
}