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

Commit 55e225fd authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "DevicePolicy: Fix lockNow() failing to turn off screen" into ics

parents 28bc5a5b 439af6d5
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -1659,11 +1659,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                    DeviceAdminInfo.USES_POLICY_FORCE_LOCK);
            long ident = Binder.clearCallingIdentity();
            try {
                if (mIPowerManager.isScreenOn()) {
                    // Power off the display
                    mIPowerManager.goToSleepWithReason(SystemClock.uptimeMillis(),
                            WindowManagerPolicy.OFF_BECAUSE_OF_ADMIN);
                } else {
                    // Ensure the device is locked
                    getWindowManager().lockNow();
                }
            } catch (RemoteException e) {
            } finally {
                Binder.restoreCallingIdentity(ident);