Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 18408aa0 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

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
parent 06350626
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment