summaryrefslogtreecommitdiff
path: root/api/api_test.go
diff options
context:
space:
mode:
author Fabian Kozynski <kozynski@google.com> 2024-07-03 13:26:20 +0000
committer Fabian Kozynski <kozynski@google.com> 2024-07-03 13:32:09 +0000
commit18408aa033dc9da57bd6fc404fc5edb54b278863 (patch)
tree4afe32cd2db50dadfc85905373a2f4b3d68765af /api/api_test.go
parent06350626e1457a9476c44d0d8d3afc7d1732cf72 (diff)
Check power saver when plugged in state changes
Changes in plugged in state could also change power save, but they are notified by two separate broadcasts. In order to obtain the information early, check the power save state if the plugged in state changes and update it before notifying callbacks. Before this, the tile (and statusbar icon) will briefly go through no-power save state when going between power save and plugged in (and back), while we waited for the second broadcast. With this solution, there's still a small instant of INACTIVE observed (in logs), but we go from >50ms to <1ms. We only check power save if the plugged in state changes, to prevent frequent calls to system_server. Test: atest BatteryControllerTest Test: manual, observe tile logs Fixes: 331755756 Flag: EXEMPT BUGFIX Change-Id: I37c4d9890f02a072b345bcb165e09fcdce8ad313
Diffstat (limited to 'api/api_test.go')
0 files changed, 0 insertions, 0 deletions