Bluetooth Battery Level Indicators are Finally Coming to Android.
A really useful feature for those of us with Bluetooth headsets and other devices is finally making its way to AOSP: Bluetooth battery level indicators.
There’s no telling exactly how this Bluetooth battery level indicator will appear in its final state, but the existence of this new API in AOSP means that developers can implement Bluetooth battery indicators however they like.
The Bluetooth Special Interest Group (Bluetooth SIG), the body that oversees the standards for each Bluetooth iteration, has already defined a Battery service (BAS) in GATT (Generic Attributes services), but it’s up for Bluetooth to support BAS.
Add APIs to get remote device’s battery level Add BluetoothDevice.getBatteryLevel() API to retreive battery level information of remote device.
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.
As such, this means the new connected Bluetooth battery level reporting API won’t make its way to the first release of Android O – Android 8.0. »