LEDs Brightness: Rewrite the slider control without TunerService
* In commit Iecafafabdaec82b3b3c72293bea865de48f0e90a,
the TunerService was introduced to listen the notification
brightness level and update the local value, however
this introduces an infinite loop of write / updates
creating heavy lags and preventing user changes
* Rewrite the NotificationBrightnessController without
a TunerService or the original ContentObserver
in a more simple and logic way
* On slider creation, registerCallbacks reads the user
value set to the brightness, stores the maximum for
preview, allowing user interaction to change the
local value and notification preview. Then update
the stored value on exit in unregisterCallbacks
* Additionaly reduce the notification update delay
to smoothen the brightness preview on slide
* Also prevent the LightsService from sending down
a brightness of 0 if alpha & brightness are low,
as this defaults to full brightness in liblights
and could happen with the previous way or if
an application gives a low alpha channel
Change-Id: Ia795c38d6b0e57476ae633acf1ae1c1e1e220cd2
Signed-off-by:
Adrian DC <radian.dc@gmail.com>
Loading
Please register or sign in to comment