Floss: Avoid non-empty battery result
Some peripherals don't have BAS profile but have other means to
convey the battery level. We have preferences to display the battery
level from BAS profile if that exists though.
However, sometimes (e.g. after device disconnection) the BAS profile
might reports empty battery result and it stays that way even after
reconnection. This causes battery conveyed via other means to be
meaningless because we use the empty result from BAS instead.
Update the behavior to prefer non-empty battery reports. Also, avoid
entering empty battery report by providing a remove battery API to
remove the entry instead of setting it empty.
Bug: 295577710
Tag: #Floss
Test: Disconnect/reconnect WH-1000XM3 multiple times. Observe the
battery level is always displayed.
Change-Id: I10dd8ae8624f001cf539f5e0ac9b29655a76440b
Loading
Please register or sign in to comment