Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 439af6d5 authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan
Browse files

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
parent ef7855c5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment