Make PreferenceController a mixin

Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
This commit is contained in:
Tony Mantler
2017-06-13 13:09:25 -07:00
parent 4bac421538
commit 1d583e125f
203 changed files with 1027 additions and 782 deletions

View File

@@ -24,10 +24,10 @@ import android.provider.SearchIndexableResource;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.PreferenceController;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.notification.EmergencyBroadcastPreferenceController;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.core.AbstractPreferenceController;
import java.util.ArrayList;
import java.util.Arrays;
@@ -64,7 +64,7 @@ public class AppAndNotificationDashboardFragment extends DashboardFragment {
}
@Override
protected List<PreferenceController> getPreferenceControllers(Context context) {
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final Activity activity = getActivity();
final Application app;
if (activity != null) {
@@ -75,9 +75,9 @@ public class AppAndNotificationDashboardFragment extends DashboardFragment {
return buildPreferenceControllers(context, app, this);
}
private static List<PreferenceController> buildPreferenceControllers(Context context,
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
Application app, Fragment host) {
final List<PreferenceController> controllers = new ArrayList<>();
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new EmergencyBroadcastPreferenceController(context,
"app_and_notif_cell_broadcast_settings"));
controllers.add(new SpecialAppAccessPreferenceController(context));
@@ -97,7 +97,8 @@ public class AppAndNotificationDashboardFragment extends DashboardFragment {
}
@Override
public List<PreferenceController> getPreferenceControllers(Context context) {
public List<AbstractPreferenceController> getPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null, null /* host */);
}