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

Skip to content
Commit 3686813d authored by Jack He's avatar Jack He Committed by Andre Eisenbach
Browse files

Add APIs to get remote device's battery level (2/2)

* Add backend service methods for BluetoothDevice.getBatteryLevel()
* Add battery level field in DeviceProperties with getters and setters
* Add updateBatteryLevel() method in RemoteDevices
* Add resetBatteryLevel() method in RemoteDevices
* Reset battery level for device when device is disconnected in
  aclStateChangeCallback() to ensure a BATTERY_LEVEL_CHANGED intent
  when device first report battery level information after connection
* Add tests for updateBatteryLevel() and resetBatteryLevel()

Bug: 35874078
Test: make, pair with devices and use them, unit tests
runtest -c com.android.bluetooth.btservice.RemoteDevicesTest bluetooth
Change-Id: Id770ee08b3cd295563660557b9a1bf0e643b32b8
parent 8938b02f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment