BatteryController: Get Bluetooth battery level from callback
Previously, when there was a Bluetooth battery update, we ignored the
updated battery level from the broadcast's EXTRA_BATTERY_LEVEL and
instead queried the BluetoothDevice for the battery level.
In this CL, we change this behavior so that we obtain the battery level
directly from the intent extra, removing the need to query the Bluetooth
service again for the battery level.
This refactor is to set up for getting battery level from the Bluetooth
metadata in the following CL.
Also, rename the BluetoothBatteryManager#add/removeListener() APIs to
add/removeBatteryListener.
Bug: 243005009
Test: atest BatteryControllerTests
Change-Id: I24cd9fe10a3e2c6c400439a3cf891b1cda5f3a3b
2 files changed