diff options
| author | Robert Horvath <robhor@google.com> | 2020-02-07 16:51:49 +0100 | 
|---|---|---|
| committer | Robert Horvath <robhor@google.com> | 2020-02-07 17:00:25 +0100 | 
| commit | 73298fa25dbd1912c5184dfce43f3947b32a53ff (patch) | |
| tree | 877067a813544f008eb747f50377b9854b7989e1 /startop/scripts/lib/cmd_utils.py | |
| parent | 8032bcb3d24f7c870856aa9c63a49ec9bd02815e (diff) | |
Add additional dirty checks in updateWakefulnessLocked
updateWakefulnessLocked is responsible for updating the wakefulness
state, ie. going to sleep if sleep conditions are met.
By changing the sleep timeout settings to a value that is lower than the
time since last user activity, you can get into a state where the device
does not go to sleep even though the sleep timeout is expired.
updateWakefulnessLocked should check all dirty flags that could trigger
a change in wakefulness.
This CL adds checks for two dirty flags:
- DIRTY_SETTINGS: As described above, changing the sleep timeout could
  lead to a situation in which the sleep timeout is already expired and
  the device should go to sleep
- DIRTY_SCREEN_BRIGHTNESS_BOOST: Inattentive sleep is disabled during
  screen brightness boosts. As soon as the brightness boost ends, the
  device should go to sleep if the timeout is expired.
Bug: 149008991
Test: 1. adb shell settings put secure sleep_timeout 900000
      2. adb shell input keyevent HOME
      3. sleep 15
      4. adb shell settings put secure sleep_timeout 10000
      Observe: Device goes to sleep
Test: 1. adb shell settings put secure attentive_timeout -1
      2. adb shell input keyevent HOME
      3. sleep 40
      4. adb shell settings put secure attentive_timeout 32000
      Observe: Device goes to sleep
Change-Id: I86be64f18f5c4d9dba43376fa608223b8c5ae6b2
Diffstat (limited to 'startop/scripts/lib/cmd_utils.py')
0 files changed, 0 insertions, 0 deletions
