Revert "Share preference controller in AdavancedAppSettings search"
Bug: 62141436
It has failing robolectric test but treehugger didn't catch it for some reason.
This reverts commit 3541f597a429cd88846c131a327faa21833d7740.
Change-Id: Id4bc0ba2d5995092c625a54fa415ff0c2c6785cb
diff --git a/src/com/android/settings/applications/AdvancedAppSettings.java b/src/com/android/settings/applications/AdvancedAppSettings.java
index b623801..cce8b7d 100644
--- a/src/com/android/settings/applications/AdvancedAppSettings.java
+++ b/src/com/android/settings/applications/AdvancedAppSettings.java
@@ -18,8 +18,8 @@
import android.app.Activity;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import android.text.TextUtils;
+import android.text.TextUtils;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.defaultapps.DefaultBrowserPreferenceController;
@@ -57,15 +57,6 @@
@Override
protected List<PreferenceController> getPreferenceControllers(Context context) {
- return buildPreferenceControllers(context);
- }
-
- @Override
- public int getMetricsCategory() {
- return MetricsEvent.APPLICATIONS_ADVANCED;
- }
-
- private static List<PreferenceController> buildPreferenceControllers(Context context) {
final List<PreferenceController> controllers = new ArrayList<>();
controllers.add(new DefaultBrowserPreferenceController(context));
controllers.add(new DefaultWorkBrowserPreferenceController(context));
@@ -77,6 +68,11 @@
return controllers;
}
+ @Override
+ public int getMetricsCategory() {
+ return MetricsEvent.APPLICATIONS_ADVANCED;
+ }
+
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider() {
@Override
@@ -98,11 +94,6 @@
.getPreferenceKey());
return keys;
}
-
- @Override
- public List<PreferenceController> getPreferenceControllers(Context context) {
- return buildPreferenceControllers(context);
- }
};
static class SummaryProvider implements SummaryLoader.SummaryProvider {
@@ -127,10 +118,10 @@
return;
}
CharSequence summary = concatSummaryText(
- mDefaultSmsPreferenceController.getDefaultAppLabel(),
- mDefaultBrowserPreferenceController.getDefaultAppLabel());
+ mDefaultSmsPreferenceController.getDefaultAppLabel(),
+ mDefaultBrowserPreferenceController.getDefaultAppLabel());
summary = concatSummaryText(summary,
- mDefaultPhonePreferenceController.getDefaultAppLabel());
+ mDefaultPhonePreferenceController.getDefaultAppLabel());
if (!TextUtils.isEmpty(summary)) {
mSummaryLoader.setSummary(this, summary);
}
@@ -148,11 +139,11 @@
}
public static final SummaryLoader.SummaryProviderFactory SUMMARY_PROVIDER_FACTORY =
- new SummaryLoader.SummaryProviderFactory() {
- @Override
- public SummaryLoader.SummaryProvider createSummaryProvider(Activity activity,
- SummaryLoader summaryLoader) {
- return new AdvancedAppSettings.SummaryProvider(activity, summaryLoader);
- }
- };
+ new SummaryLoader.SummaryProviderFactory() {
+ @Override
+ public SummaryLoader.SummaryProvider createSummaryProvider(Activity activity,
+ SummaryLoader summaryLoader) {
+ return new AdvancedAppSettings.SummaryProvider(activity, summaryLoader);
+ }
+ };
}
diff --git a/tests/robotests/assets/grandfather_not_sharing_pref_controllers_with_search_provider b/tests/robotests/assets/grandfather_not_sharing_pref_controllers_with_search_provider
index b329072..1712f19 100644
--- a/tests/robotests/assets/grandfather_not_sharing_pref_controllers_with_search_provider
+++ b/tests/robotests/assets/grandfather_not_sharing_pref_controllers_with_search_provider
@@ -1 +1,2 @@
+com.android.settings.applications.AdvancedAppSettings
com.android.settings.fuelgauge.PowerUsageSummary