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

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
parent 251c7563
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