Fix thread safety issues;
There are two threads can modify "mLastChanged" and "mScreenState" variables:
1. onFinishedWakingUp()/onFinishedGoingToSleep() are called from main thread in system_server;
2. setDeviceFolded() is called from android.display thread in
system_server.
Otherwise, NullPointerException might be throw when invoke method 'long java.lang.Long.longValue()'.
Test: press power key to wake up the device and fold the device at the
same time.
Change-Id: I3a0f1862548f2e567baa8a4a615906dbf87a8243
Signed-off-by: jiayongqiang <jiayongqiang@xiaomi.com>
Loading
Please register or sign in to comment