Merge "Avoid lock screen flash when going to dream." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cf4c1a62a6
@@ -566,6 +566,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
// What we do when the user double-taps on home
|
// What we do when the user double-taps on home
|
||||||
private int mDoubleTapOnHomeBehavior;
|
private int mDoubleTapOnHomeBehavior;
|
||||||
|
|
||||||
|
// Whether to lock the device after the next app transition has finished.
|
||||||
|
private boolean mLockAfterAppTransitionFinished;
|
||||||
|
|
||||||
// Allowed theater mode wake actions
|
// Allowed theater mode wake actions
|
||||||
private boolean mAllowTheaterModeWakeFromKey;
|
private boolean mAllowTheaterModeWakeFromKey;
|
||||||
private boolean mAllowTheaterModeWakeFromPowerKey;
|
private boolean mAllowTheaterModeWakeFromPowerKey;
|
||||||
@@ -1055,11 +1058,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the device locks. Unfortunately, this has the side-effect of briefly revealing
|
synchronized (mLock) {
|
||||||
// the lock screen before the dream appears. Note that locking is a side-effect of the no
|
// Lock the device after the dream transition has finished.
|
||||||
// dream action that is executed if we early return above.
|
mLockAfterAppTransitionFinished = true;
|
||||||
// TODO(b/261662912): Find a better way to lock the device that doesn't result in jank.
|
}
|
||||||
lockNow(null);
|
|
||||||
|
|
||||||
dreamManagerInternal.requestDream();
|
dreamManagerInternal.requestDream();
|
||||||
}
|
}
|
||||||
@@ -2138,6 +2140,22 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
handleStartTransitionForKeyguardLw(
|
handleStartTransitionForKeyguardLw(
|
||||||
keyguardGoingAway, false /* keyguardOccludingStarted */,
|
keyguardGoingAway, false /* keyguardOccludingStarted */,
|
||||||
0 /* duration */);
|
0 /* duration */);
|
||||||
|
|
||||||
|
synchronized (mLock) {
|
||||||
|
mLockAfterAppTransitionFinished = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAppTransitionFinishedLocked(IBinder token) {
|
||||||
|
synchronized (mLock) {
|
||||||
|
if (!mLockAfterAppTransitionFinished) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mLockAfterAppTransitionFinished = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
lockNow(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user