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

Skip to content
Commit e4f97779 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Update monitored InputDevice battery state on an UEvent notification

When the battery state of any input device is being monitored, we will
register a UEventObserver to listen to all UEvents sent by the
power_supply subsystem.

When we receive a UEvent that notifies us of changes to any batteries,
we will query the battery status of that device, and notify listeners
if there was a change in the state.

The last known battery state of a monitored device is tracked in the
MonitoredDeviceState class in BatteryController.

BatteryController will only start listening to UEvents for a device if
it has a battery, and will update its UEvent listeners based on the
battery presence.

DD: go/inputdevice-battery-notifications

Bug: 243005009
Test: atest InputDeviceBatteryControllerTests
Change-Id: Ic16e1e4aba3bb6371c57f042004844fd78989582
parent 4fb7c87f
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