Duplicate ambient display setting in battery settings.

Also fixed a bug where ambient display was duplicated
in search results.

Change-Id: Iacdb53c70e90f8240da1ed9acec7e382ed1df5de
Fixes: 62298578
Test: robotests
This commit is contained in:
Andrew Sapperstein
2017-07-07 11:02:00 -07:00
parent e1d46b005b
commit fedae393ef
4 changed files with 25 additions and 6 deletions

View File

@@ -89,7 +89,6 @@ public class DisplaySettings extends DashboardFragment {
private static List<AbstractPreferenceController> buildPreferenceControllers(
Context context, Lifecycle lifecycle) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final AmbientDisplayConfiguration ambientDisplayConfig = new AmbientDisplayConfiguration(context);
controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
controllers.add(new AutoRotatePreferenceController(context, lifecycle));
controllers.add(new CameraGesturePreferenceController(context));
@@ -98,7 +97,9 @@ public class DisplaySettings extends DashboardFragment {
controllers.add(new NightDisplayPreferenceController(context));
controllers.add(new NightModePreferenceController(context));
controllers.add(new ScreenSaverPreferenceController(context));
controllers.add(new AmbientDisplayPreferenceController(context, ambientDisplayConfig,
controllers.add(new AmbientDisplayPreferenceController(
context,
new AmbientDisplayConfiguration(context),
KEY_AMBIENT_DISPLAY));
controllers.add(new TapToWakePreferenceController(context));
controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
@@ -128,6 +129,7 @@ public class DisplaySettings extends DashboardFragment {
List<String> keys = super.getNonIndexableKeys(context);
keys.add(KEY_DISPLAY_SIZE);
keys.add(WallpaperPreferenceController.KEY_WALLPAPER);
keys.add(KEY_AMBIENT_DISPLAY);
return keys;
}