Merge "Fix a flicker when short pressing power button." into tm-qpr-dev

This commit is contained in:
William Leshner
2022-12-15 23:17:09 +00:00
committed by Android (Google) Code Review

View File

@@ -1049,12 +1049,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return; return;
} }
// Make sure the device locks. Unfortunately, this has the side-effect of briefly revealing
// the lock screen before the dream appears. Note that this locking behavior needs to
// happen regardless of whether we end up dreaming (below) or not.
// TODO(b/261662912): Find a better way to lock the device that doesn't result in jank.
lockNow(null);
// Don't dream if the user isn't user zero. // Don't dream if the user isn't user zero.
// TODO(b/261907079): Move this check to DreamManagerService#canStartDreamingInternal(). // TODO(b/261907079): Move this check to DreamManagerService#canStartDreamingInternal().
if (ActivityManager.getCurrentUser() != UserHandle.USER_SYSTEM) { if (ActivityManager.getCurrentUser() != UserHandle.USER_SYSTEM) {
@@ -1068,6 +1062,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return; return;
} }
// Make sure the device locks. Unfortunately, this has the side-effect of briefly revealing
// the lock screen before the dream appears. Note that locking is a side-effect of the no
// dream action that is executed if we early return above.
// TODO(b/261662912): Find a better way to lock the device that doesn't result in jank.
lockNow(null);
dreamManagerInternal.requestDream(); dreamManagerInternal.requestDream();
} }