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

Commit 534998ed authored by Andrew Cheng's avatar Andrew Cheng
Browse files

Remote device battery level reported incorrectly

Per HFP specs, the AG reports battery level via CIND/CIEV with value
ranging from 0 to 5. RemoteDevices#updateBatteryLevel expects battery
level to be a percentage (i.e., an integer from 0 to 100).

In onAgIndicatorValueChanged, the integer from
BluetoothHeadsetClient.EXTRA_BATTERY_LEVEL is passed directly into
updateBatteryLevel. It needs to be converted into a percentage first.
For example, if the remote device has a full charge,
BluetoothHeadsetClient.EXTRA_BATTERY_LEVEL returns a 5, but this then
gets reported as 5% instead of 100%.

onHfIndicatorValueChanged will be left unchanged. Per HFP specs, the HF
reports battery level via BIND/BIEV with value ranging from 0 to 100.

Tag: #refactor
Bug: 219517423
Test: atest RemoteDevicesTest
Test: atest BluetoothInstrumentationTests
Test: manually verify a full battery is reported as 100% instead of 5%
Ignore-AOSP-First: see 16809739
Change-Id: I0c0453537905b33c78e405d3889f2de5d3e6cc57
parent 0a3715b1
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