Synchronize calls to updateDoze
And hold a lock when updating doze
screen state and doze brightness changes.
So updates from different threads are always
ordered to ensure the latest information
is sent to DreamManagerService.
This is more robust than volatile because the actual IPC
call to mDreamManager could still be called out of order if
the calls to DreamManager aren't synchronized.
Fixes: 358578071
Flag: EXEMPT bugfix
Test: manually request display and brightness changes
from separate threads; latest requested values get
sent to DreamManagerService
Change-Id: I0377cce2aa4d30db3850ed98b9f5f6aa050fec49
1 file changed