Commit Graph

23 Commits

Author SHA1 Message Date
Abel Tesfaye
384bed509c Fix battery saver not disabling adaptive sleep switch
Test: locally with flame

Bug: 189900026
Change-Id: I1f0bc5eb1cd021f1eb8526c020f772ce0dd96da0
2021-06-09 23:11:57 +00:00
Yi Jiang
8aaa9f5549 Defers initialization of preferences.
In Screen Timeout Settings, preferences should not be initialized in
onAttach() because the setting style hasn't been loaded yet. This change
defers the initialiaztion of those preferences so that they appear
correctly.

Test: manually tested.
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.display
Bug: 183909540

Change-Id: I86cfe196549d709ed763faa004fff7b631365b1e
2021-05-19 12:18:23 -07:00
Abel Tesfaye
51ce242573 Add warning message when power save mode is enabled for attention settings fragment
Test: locally with flame, make RunSettingsRoboTests -j96 ROBOTEST_FILTER=AdaptiveSleepPreferenceControllerTest,AdaptiveSleepBatterySaverPreferenceControllerTest

Bug: 186690152
Change-Id: I42e018a8cf48166a8250fac9510a8882efb58568
2021-05-10 19:27:17 +00:00
Yi Jiang
f54a2be819 Fixes NPE in Screen attention setting
Bug: 186904496
Test: make RunSettingsRoboTests
    ROBOTEST_FILTER=com.android.settings.display
Change-Id: I9bd1e6824e19cf8ea281f7af482d13ef47f36256
2021-05-05 12:06:51 -07:00
Yi Jiang
18c97b595f Fixes 'no ripple effect' issue for screen attention setting
Preferences shouldn't be initialized at onAttach() because the settings
style hasn't been loaded yet. This change defers the preferences
initialization so that they comply with the settings style.

The change ag/14114425 is reverted due to b/186904496. This change
includes a fix for that issue.

Test: manually
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.display
Bug: 183909540
Bug: 186904496

Change-Id: I317ce251f4d11e62c6592ee587c2919da4d45db3
2021-05-03 18:02:59 -07:00
bsears
30e9ba1e52 Revert "Fixes 'no ripple effect' issue for screen attention setting"
This reverts commit 20d1da2b62.

Reason for revert: Based on bisection, this is the likely root cause of b/186904496

Bug: 186904496
Change-Id: I0eaa026b52610d7ef4543c32791531971e68f8e6
2021-05-03 17:59:11 +00:00
Yi Jiang
20d1da2b62 Fixes 'no ripple effect' issue for screen attention setting
Preferences shouldn't be initialized at onAttach() because the settings
style hasn't been loaded yet. This change defers the preferences
initialization so that they comply with the settings style.

Test: manually
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.display
Bug: 183909540

Change-Id: I4dc4503924a1dcd5b8d41f7d27e576befb11f976
2021-04-29 01:28:35 -07:00
Abel Tesfaye
5d6438391f Add warning message when camera privacy lock is enabled for screen attention settings
Test: locally with flame, make RunSettingsRoboTests -j$(nproc)
ROBOTEST_FILTER=AdaptiveSleepCameraStatePreferenceControllerTest,
AdaptiveSleepPreferenceControllerTest

Bug: 177462182
Change-Id: I9880d6b82e9a5040534aceda4ff15275e0bcf72a
2021-04-08 19:40:58 +00:00
Tsung-Mao Fang
ff727efe7b Follow footer preference guildance on some pages
- Footer preference should have a info icon in tethering page.
- Rmove an empty icon for screen attention setting.
- Revise the "More details" to "Learn more"
- Add more empty line between footer info and "Learn more"

Test: Built apk, and check the screen
Fix: 183472971
Fix: 183472858
Change-Id: I7edb71639b59efb8205c0ef6a50ab483f88aa63d
2021-03-29 15:26:59 +08:00
Abel Tesfaye
9481334a6a Instrument metrics for smart-auto-rotate and screen timeout
Test: locally with flame

Bug: 172974834
Change-Id: Id6927e749049c88e4efea2d69f93b9d397acc1c1
2021-03-04 20:01:36 +00:00
Yi Jiang
0bbc758197 Updates screen attention preference at onStart().
Screen attention preference needs to be refreshed at onStart() so that
it get updated immediately once the camera permission is revoked/granted
for the screen attention feature.

Bug: 171019472
Test: manual + atest AdaptiveSleepPreferenceControllerTest

Change-Id: If9ac68c022f10ffefde61b035bbf38ee14c02180
2020-10-16 15:25:12 -07:00
Yi Jiang
f5d1841c9d Merge Screen Attention and Screen timeout Settings.
Bug: 155051311
Test: atest
Change-Id: I6f6ee52618eab629a41b28982be32ead5f9ba08d
2020-10-13 00:47:13 -07:00
Yi Jiang
c0f9424779 Fixes incorrect settings usages in AdaptiveSleepPreferenceController
Test: manually tested on device
Bug: 139319542
Change-Id: I7b50d75862a678aecea9356253e443f7bded97b2
2020-02-25 13:48:06 -08:00
Yi Jiang
7f4a4ce85d Hides screen attention when attention service is not avaliable.
If a wrong attention package is pushed to users devices, the screen
attention won't work. In this case, we should also hide the settings
as well.

Test: atest AdaptiveSleepPreferenceControllerTest
Bug: 148099790
Change-Id: Ieb4fd1008856024c23624f0eab3dfbfc3fc4ee3b
2020-02-19 11:57:28 -08:00
Yi Jiang
63f2c5963a Moves Adaptive Sleep's settings from Settings.System to Settings.Secure
Test: atest AdaptiveSleepPreferenceControllerTest
Test: atest ContextualAdaptiveSleepSliceTest
Bug: 139319542

Change-Id: I9923dc3b6995c89efc1c775ccd2f134af87fc202
2020-02-07 00:44:01 +00:00
Yi Jiang
d66878f8fe Refresh camera permission status when it changed.
Bug: 135497543
Test: Manually tested
Change-Id: I833e1658bc7888557635b764599c7a0baa226612
2019-06-21 15:07:50 -07:00
Yi Jiang
c26745207d Show a 'permission missing' message in Screen Attention settings.
Bug: 129284701
Test: Manually verified.
Test: atest AdaptiveSleepSettingsTest

Change-Id: I6375929d59479a0aeb7e4aec184bd36e7f3ab33b
2019-06-10 17:18:10 -07:00
Yi Jiang
7605494cc5 Adds contextual cards for screen attention in Settings Homepage
Bug: 128527964
Test: atest ContextualAdaptiveSleepSliceTest, maually verified.
Change-Id: Ifaea7d8d4391e91cf6cbde38a2506728f55913d8
2019-05-29 10:37:11 -07:00
Yi Jiang
6da0447068 Fix unexpected grey-out in Screen attention
Fix preference controller searchable issue.

Bug: 132821023
Bug: 133255690
Test: atest AdaptiveSleepPreferenceControllerTest
Change-Id: I686ed827fbe572c9d8bcde2d8a8e00f2dcb5a6a8
2019-05-24 16:50:18 -07:00
Alex Salo
83a63abd2d Re-enable the test
Update the test to handle new API and simplify the logic in the
controller.

Bug: 130897305
Test: make RunSettingsRoboTests -j64

Change-Id: I0c46ff22d4a3bf913add753f85a24af9aeee0a33
2019-05-08 17:48:12 +00:00
Alex Salo
c821ae1ee6 Check for attention permissions
If attention package does not have sufficient permissions - disable the
setting.

Bug: 130246574, 130350903
Test: make RunSettingsRoboTests and manually confirmed
Change-Id: Ia7a86c940522e72f7e895d6aec7500f1ef6f9889
2019-04-16 17:43:15 +00:00
Alex Salo
962a7ec22d Remove unused dependency
Test: not needed
Bug: 111939367
Change-Id: Id6040240e6221fe6311b7985f3763c04989be7d2
2019-01-31 18:20:16 +00:00
Alex Salo
bb4e9ce201 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
2019-01-28 11:39:00 -08:00