SystemUI: Show bluetooth battery level
Author: LuK1337 <priv.luk@gmail.com>
Date: 2018-10-31 16:31:19 +0100
SystemUI: Show bluetooth battery level when available
* Somewhat inspired by change committed by Gavin Ni <gisngy@gmail.com>
back in cm-13.0 days (see commit 88e7a6c). Since then completely
rewritten using BluetoothDevice API introduced in Oreo, with new
drawables meant to be used with 0-9 battery level range.
Change-Id: I6179bfd41e033591534e8cf3c6adc98ce715a13d
Author: Luca Stefani <luca.stefani.ge1@gmail.com>
Date: 2021-08-23 10:11:54 +0200
fixup! SystemUI: Show bluetooth battery level when available
The current update method is triggered in 2 cases:
the SystemUI bluetooth controller changes device state
the battery level changed intent is sent
Sadly the current SysUI controller doesn't handle battery level
changes, and is instead triggered in a few other cases ( ex audio
state changed ).
And since we use the data from SysUI controller for battery level
from changes in the global bt controller we may have 2 different
set of devices to work on. This could ( and does ) trigger
race conditions.
Instead add support battery level state changes within the SystemUI
controller to work on the same data set.
Change-Id: Ib57096fc2ebe151ac3860277a4db2319f230b514
Change-Id: I34344907711b7b9fc4c1d15d4516bd53bf30ebb2
14 files changed