DevicePolicy: Fix lockNow() failing to turn off screen
A fix introduced in 93c518e4 causes lockNow() to sometimes (most of the time) fail to turn off the screen. The screen will turn off, but then immediately turn on showing the lock screen. This is caused by getWindowManager().lockNow() call which calls the method to lock the screen, which the PowerManager service also call in parallel, leading to a race condition. The fix is to only call getWindowManager().lockNow() if the screen is not on. Change-Id: I235c0f34d5cc15268d569e18e025a87330deced7
Loading
Please register or sign in to comment