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