Add "Adaptive sleep" setting
Adaptive sleep setting, if enabled, will perform an attention check right before the power manager is scheduled to dim and then turn off the display. If the attention check says that user is currently paying attention to the device, the screen sleep timeout timer will be reset, as if user had interacted with the display. The animation and explanation strings are still TBC per UX team. The setting is only displayed on supported devices. Test: make RunSettingsRoboTests Bug: 111939367 Change-Id: I191dd8ef06ecec4edbe4357671a7a9360971c06f
This commit is contained in:
@@ -2688,6 +2688,15 @@
|
||||
|
||||
<!-- Display settings screen, display white balance settings title [CHAR LIMIT=30] -->
|
||||
<string name="display_white_balance_title">Display white balance</string>
|
||||
<!-- Display settings screen, setting option name to enable adaptive sleep [CHAR LIMIT=30] -->
|
||||
<string name="adaptive_sleep_title">Adaptive sleep</string>
|
||||
<!-- Setting option summary when adaptive sleep is on [CHAR LIMIT=NONE] -->
|
||||
<string name="adaptive_sleep_summary_on">On</string>
|
||||
<!-- Setting option summary when adaptive sleep is off [CHAR LIMIT=NONE] -->
|
||||
<string name="adaptive_sleep_summary_off">Off</string>
|
||||
<!-- Description about the feature adaptive sleep [CHAR LIMIT=NONE]-->
|
||||
<string name="adaptive_sleep_description">Your screen would not dim and go to sleep if the device detects your present attention.</string>
|
||||
|
||||
|
||||
<!-- Night display screen, setting option name to enable night display (renamed "Night Light" with title caps). [CHAR LIMIT=30] -->
|
||||
<string name="night_display_title">Night Light</string>
|
||||
@@ -6707,6 +6716,8 @@
|
||||
<string name="help_url_display_size" translatable="false"></string>
|
||||
<!-- Help URL, Auto brightness [DO NOT TRANSLATE] -->
|
||||
<string name="help_url_auto_brightness" translatable="false" />
|
||||
<!-- Help URL, Adaptive sleep [DO NOT TRANSLATE] -->
|
||||
<string name="help_url_adaptive_sleep" translatable="false" />
|
||||
<!-- Help URL, Previously connected bluetooth devices [DO NOT TRANSLATE] -->
|
||||
<string name="help_url_previously_connected_devices" translatable="false"></string>
|
||||
<!-- Help URL, Top level privacy settings [DO NOT TRANSLATE] -->
|
||||
@@ -7047,6 +7058,9 @@
|
||||
<!-- Search keywords for adaptive brightness setting [CHAR LIMIT=NONE]-->
|
||||
<string name="keywords_display_auto_brightness">dim screen, touchscreen, battery, smart brightness, dynamic brightness</string>
|
||||
|
||||
<!-- Search keywords for adaptive sleep setting [CHAR LIMIT=NONE]-->
|
||||
<string name="keywords_display_adaptive_sleep">dim screen, sleep, battery, timeout, attention</string>
|
||||
|
||||
<!-- List of synonyms for the auto rotate (rotate the virtual display when the device rotates) setting, used to match in settings search [CHAR LIMIT=NONE] -->
|
||||
<string name="keywords_auto_rotate">rotate, flip, rotation, portrait, landscape, orientation, vertical, horizontal</string>
|
||||
|
||||
|
||||
40
res/xml/adaptive_sleep_detail.xml
Normal file
40
res/xml/adaptive_sleep_detail.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2019 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:key="adaptive_sleep_detail"
|
||||
android:title="@string/adaptive_sleep_title">
|
||||
|
||||
<!-- TODO(111939367): add correct animation -->
|
||||
<com.android.settings.widget.VideoPreference
|
||||
android:key="adaptive_sleep_video"
|
||||
android:title="@string/summary_placeholder"
|
||||
settings:animation="@raw/aab_brightness"
|
||||
settings:preview="@drawable/aab_brightness"
|
||||
settings:controller="com.android.settings.widget.VideoPreferenceController"/>
|
||||
|
||||
<com.android.settingslib.RestrictedSwitchPreference
|
||||
android:key="adaptive_sleep"
|
||||
android:title="@string/adaptive_sleep_title"
|
||||
settings:keywords="@string/keywords_display_adaptive_sleep"
|
||||
settings:controller="com.android.settings.display.AdaptiveSleepPreferenceController"
|
||||
settings:useAdminDisabledSummary="true"
|
||||
settings:allowDividerAbove="true" />
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -66,6 +66,13 @@
|
||||
android:entryValues="@array/screen_timeout_values"
|
||||
settings:keywords="@string/keywords_screen_timeout" />
|
||||
|
||||
<Preference
|
||||
android:key="adaptive_sleep_entry"
|
||||
android:title="@string/adaptive_sleep_title"
|
||||
android:summary="@string/summary_placeholder"
|
||||
android:fragment="com.android.settings.display.AdaptiveSleepSettings"
|
||||
settings:controller="com.android.settings.display.AdaptiveSleepPreferenceController" />
|
||||
|
||||
<SwitchPreference
|
||||
android:key="auto_rotate"
|
||||
android:title="@string/accelerometer_title"
|
||||
|
||||
Reference in New Issue
Block a user