mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
When an external charger is connected, only the LED on the side the charger is connected should be on, the other side should be off. The existing LED behavior was incorrect in that only the side that was charging was being updated and the other side would remain in its previous state. This CL adds a fix so that if only one LED is being controlled, the other side is always turned off. In addition, the logic for double tap events was changed slightly so that if a double tap event is in progress and a charger is connected, the new state will be updated as soon as the charge state is changed instead of waiting for the double tap event to complete. BUG=b:62481906 BRANCH=eve TEST=Manual With battery level < 15% so that both LEDs are red when the charger isn't connected, connect charger and verified that the LED on the side the charger is connected turns white and the LED on the other side turns off. Change-Id: I7462629409496383adb43445e732dd6ca2f9f589 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/537960 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>