Merge "Duplicate ambient display setting in battery settings." into oc-dr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
604df3cc55
@@ -35,6 +35,7 @@
|
|||||||
settings:widgetLayout="@null"
|
settings:widgetLayout="@null"
|
||||||
settings:keywords="@string/keywords_display_night_display" />
|
settings:keywords="@string/keywords_display_night_display" />
|
||||||
|
|
||||||
|
<!-- Cross-listed item, if you change this, also change it in power_usage_summary.xml -->
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="auto_brightness"
|
android:key="auto_brightness"
|
||||||
android:title="@string/auto_brightness_title"
|
android:title="@string/auto_brightness_title"
|
||||||
@@ -51,6 +52,7 @@
|
|||||||
android:targetClass="@string/config_wallpaper_picker_class" />
|
android:targetClass="@string/config_wallpaper_picker_class" />
|
||||||
</com.android.settingslib.RestrictedPreference>
|
</com.android.settingslib.RestrictedPreference>
|
||||||
|
|
||||||
|
<!-- Cross-listed item, if you change this, also change it in power_usage_summary.xml -->
|
||||||
<com.android.settings.TimeoutListPreference
|
<com.android.settings.TimeoutListPreference
|
||||||
android:key="screen_timeout"
|
android:key="screen_timeout"
|
||||||
android:title="@string/screen_timeout"
|
android:title="@string/screen_timeout"
|
||||||
@@ -82,6 +84,7 @@
|
|||||||
android:title="@string/screensaver_settings_title"
|
android:title="@string/screensaver_settings_title"
|
||||||
android:fragment="com.android.settings.dream.DreamSettings" />
|
android:fragment="com.android.settings.dream.DreamSettings" />
|
||||||
|
|
||||||
|
<!-- Cross-listed item, if you change this, also change it in power_usage_summary.xml -->
|
||||||
<Preference
|
<Preference
|
||||||
android:key="ambient_display"
|
android:key="ambient_display"
|
||||||
android:title="@string/ambient_display_screen_title"
|
android:title="@string/ambient_display_screen_title"
|
||||||
|
@@ -59,14 +59,14 @@
|
|||||||
android:title="@string/battery_percentage"
|
android:title="@string/battery_percentage"
|
||||||
android:summary="@string/battery_percentage_description"/>
|
android:summary="@string/battery_percentage_description"/>
|
||||||
|
|
||||||
<!-- Cross-listed item, if you change this, also change it in ia_display_settings.xml -->
|
<!-- Cross-listed item, if you change this, also change it in display_settings.xml -->
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="auto_brightness_battery"
|
android:key="auto_brightness_battery"
|
||||||
android:title="@string/auto_brightness_title"
|
android:title="@string/auto_brightness_title"
|
||||||
android:summary="@string/auto_brightness_summary"
|
android:summary="@string/auto_brightness_summary"
|
||||||
settings:keywords="@string/keywords_display_auto_brightness"/>
|
settings:keywords="@string/keywords_display_auto_brightness"/>
|
||||||
|
|
||||||
<!-- Cross-listed item, if you change this, also change it in ia_display_settings.xml -->
|
<!-- Cross-listed item, if you change this, also change it in display_settings.xml -->
|
||||||
<com.android.settings.TimeoutListPreference
|
<com.android.settings.TimeoutListPreference
|
||||||
android:key="screen_timeout_battery"
|
android:key="screen_timeout_battery"
|
||||||
android:title="@string/screen_timeout"
|
android:title="@string/screen_timeout"
|
||||||
@@ -74,6 +74,12 @@
|
|||||||
android:entries="@array/screen_timeout_entries"
|
android:entries="@array/screen_timeout_entries"
|
||||||
android:entryValues="@array/screen_timeout_values"/>
|
android:entryValues="@array/screen_timeout_values"/>
|
||||||
|
|
||||||
|
<!-- Cross-listed item, if you change this, also change it in display_settings.xml -->
|
||||||
|
<Preference
|
||||||
|
android:key="ambient_display_battery"
|
||||||
|
android:title="@string/ambient_display_screen_title"
|
||||||
|
android:fragment="com.android.settings.display.AmbientDisplaySettings" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
|
@@ -89,7 +89,6 @@ public class DisplaySettings extends DashboardFragment {
|
|||||||
private static List<PreferenceController> buildPreferenceControllers(
|
private static List<PreferenceController> buildPreferenceControllers(
|
||||||
Context context, Lifecycle lifecycle) {
|
Context context, Lifecycle lifecycle) {
|
||||||
final List<PreferenceController> controllers = new ArrayList<>();
|
final List<PreferenceController> controllers = new ArrayList<>();
|
||||||
final AmbientDisplayConfiguration ambientDisplayConfig = new AmbientDisplayConfiguration(context);
|
|
||||||
controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
|
controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
|
||||||
controllers.add(new AutoRotatePreferenceController(context, lifecycle));
|
controllers.add(new AutoRotatePreferenceController(context, lifecycle));
|
||||||
controllers.add(new CameraGesturePreferenceController(context));
|
controllers.add(new CameraGesturePreferenceController(context));
|
||||||
@@ -98,7 +97,9 @@ public class DisplaySettings extends DashboardFragment {
|
|||||||
controllers.add(new NightDisplayPreferenceController(context));
|
controllers.add(new NightDisplayPreferenceController(context));
|
||||||
controllers.add(new NightModePreferenceController(context));
|
controllers.add(new NightModePreferenceController(context));
|
||||||
controllers.add(new ScreenSaverPreferenceController(context));
|
controllers.add(new ScreenSaverPreferenceController(context));
|
||||||
controllers.add(new AmbientDisplayPreferenceController(context, ambientDisplayConfig,
|
controllers.add(new AmbientDisplayPreferenceController(
|
||||||
|
context,
|
||||||
|
new AmbientDisplayConfiguration(context),
|
||||||
KEY_AMBIENT_DISPLAY));
|
KEY_AMBIENT_DISPLAY));
|
||||||
controllers.add(new TapToWakePreferenceController(context));
|
controllers.add(new TapToWakePreferenceController(context));
|
||||||
controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
|
controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
|
||||||
@@ -128,6 +129,7 @@ public class DisplaySettings extends DashboardFragment {
|
|||||||
List<String> keys = super.getNonIndexableKeys(context);
|
List<String> keys = super.getNonIndexableKeys(context);
|
||||||
keys.add(KEY_DISPLAY_SIZE);
|
keys.add(KEY_DISPLAY_SIZE);
|
||||||
keys.add(WallpaperPreferenceController.KEY_WALLPAPER);
|
keys.add(WallpaperPreferenceController.KEY_WALLPAPER);
|
||||||
|
keys.add(KEY_AMBIENT_DISPLAY);
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,6 +46,7 @@ import android.view.View.OnClickListener;
|
|||||||
import android.view.View.OnLongClickListener;
|
import android.view.View.OnLongClickListener;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.android.internal.hardware.AmbientDisplayConfiguration;
|
||||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||||
import com.android.internal.os.BatterySipper;
|
import com.android.internal.os.BatterySipper;
|
||||||
import com.android.internal.os.BatterySipper.DrainType;
|
import com.android.internal.os.BatterySipper.DrainType;
|
||||||
@@ -59,6 +60,7 @@ import com.android.settings.applications.ManageApplications;
|
|||||||
import com.android.settings.core.PreferenceController;
|
import com.android.settings.core.PreferenceController;
|
||||||
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
|
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
|
||||||
import com.android.settings.dashboard.SummaryLoader;
|
import com.android.settings.dashboard.SummaryLoader;
|
||||||
|
import com.android.settings.display.AmbientDisplayPreferenceController;
|
||||||
import com.android.settings.display.AutoBrightnessPreferenceController;
|
import com.android.settings.display.AutoBrightnessPreferenceController;
|
||||||
import com.android.settings.display.BatteryPercentagePreferenceController;
|
import com.android.settings.display.BatteryPercentagePreferenceController;
|
||||||
import com.android.settings.display.TimeoutPreferenceController;
|
import com.android.settings.display.TimeoutPreferenceController;
|
||||||
@@ -96,6 +98,7 @@ public class PowerUsageSummary extends PowerUsageBase implements
|
|||||||
|
|
||||||
private static final String KEY_AUTO_BRIGHTNESS = "auto_brightness_battery";
|
private static final String KEY_AUTO_BRIGHTNESS = "auto_brightness_battery";
|
||||||
private static final String KEY_SCREEN_TIMEOUT = "screen_timeout_battery";
|
private static final String KEY_SCREEN_TIMEOUT = "screen_timeout_battery";
|
||||||
|
private static final String KEY_AMBIENT_DISPLAY = "ambient_display_battery";
|
||||||
private static final String KEY_BATTERY_SAVER_SUMMARY = "battery_saver_summary";
|
private static final String KEY_BATTERY_SAVER_SUMMARY = "battery_saver_summary";
|
||||||
private static final String KEY_HIGH_USAGE = "high_usage";
|
private static final String KEY_HIGH_USAGE = "high_usage";
|
||||||
|
|
||||||
@@ -314,6 +317,10 @@ public class PowerUsageSummary extends PowerUsageBase implements
|
|||||||
controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
|
controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
|
||||||
controllers.add(new BatterySaverController(context, getLifecycle()));
|
controllers.add(new BatterySaverController(context, getLifecycle()));
|
||||||
controllers.add(new BatteryPercentagePreferenceController(context));
|
controllers.add(new BatteryPercentagePreferenceController(context));
|
||||||
|
controllers.add(new AmbientDisplayPreferenceController(
|
||||||
|
context,
|
||||||
|
new AmbientDisplayConfiguration(context),
|
||||||
|
KEY_AMBIENT_DISPLAY));
|
||||||
return controllers;
|
return controllers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,11 +902,12 @@ public class PowerUsageSummary extends PowerUsageBase implements
|
|||||||
@Override
|
@Override
|
||||||
public List<String> getNonIndexableKeys(Context context) {
|
public List<String> getNonIndexableKeys(Context context) {
|
||||||
List<String> niks = super.getNonIndexableKeys(context);
|
List<String> niks = super.getNonIndexableKeys(context);
|
||||||
|
niks.add(KEY_HIGH_USAGE);
|
||||||
|
niks.add(KEY_BATTERY_SAVER_SUMMARY);
|
||||||
// Duplicates in display
|
// Duplicates in display
|
||||||
niks.add(KEY_AUTO_BRIGHTNESS);
|
niks.add(KEY_AUTO_BRIGHTNESS);
|
||||||
niks.add(KEY_SCREEN_TIMEOUT);
|
niks.add(KEY_SCREEN_TIMEOUT);
|
||||||
niks.add(KEY_BATTERY_SAVER_SUMMARY);
|
niks.add(KEY_AMBIENT_DISPLAY);
|
||||||
niks.add(KEY_HIGH_USAGE);
|
|
||||||
return niks;
|
return niks;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user