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
Loading
Please register or sign in to comment