Merge "Generalize the condition to take task snapshot when entering AOD" into sc-dev am: 5b24daa483
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14963622 Change-Id: Ieb270cd84f52aed101c19a8aed40cc0a74106371
This commit is contained in:
@@ -48,6 +48,7 @@ import android.os.Trace;
|
|||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
import android.util.proto.ProtoOutputStream;
|
import android.util.proto.ProtoOutputStream;
|
||||||
|
import android.view.Display;
|
||||||
|
|
||||||
import com.android.internal.policy.IKeyguardDismissCallback;
|
import com.android.internal.policy.IKeyguardDismissCallback;
|
||||||
import com.android.server.inputmethod.InputMethodManagerInternal;
|
import com.android.server.inputmethod.InputMethodManagerInternal;
|
||||||
@@ -163,16 +164,27 @@ class KeyguardController {
|
|||||||
aodShowing ? 1 : 0,
|
aodShowing ? 1 : 0,
|
||||||
mKeyguardGoingAway ? 1 : 0,
|
mKeyguardGoingAway ? 1 : 0,
|
||||||
"setKeyguardShown");
|
"setKeyguardShown");
|
||||||
|
|
||||||
|
// Update the task snapshot if the screen will not be turned off. To make sure that the
|
||||||
|
// unlocking animation can animate consistent content. The conditions are:
|
||||||
|
// - Either AOD or keyguard changes to be showing. So if the states change individually,
|
||||||
|
// the later one can be skipped to avoid taking snapshot again. While it still accepts
|
||||||
|
// if both of them change to show at the same time.
|
||||||
|
// - Keyguard was not going away. Because if it was, the closing transition is able to
|
||||||
|
// handle the snapshot.
|
||||||
|
// - The display state is ON. Because if AOD is not on or pulsing, the display state will
|
||||||
|
// be OFF or DOZE (the path of screen off may have handled it).
|
||||||
|
if (((aodShowing ^ keyguardShowing) || (aodShowing && aodChanged && keyguardChanged))
|
||||||
|
&& !mKeyguardGoingAway && Display.isOnState(
|
||||||
|
mRootWindowContainer.getDefaultDisplay().getDisplayInfo().state)) {
|
||||||
|
mWindowManager.mTaskSnapshotController.snapshotForSleeping(DEFAULT_DISPLAY);
|
||||||
|
}
|
||||||
|
|
||||||
mKeyguardShowing = keyguardShowing;
|
mKeyguardShowing = keyguardShowing;
|
||||||
mAodShowing = aodShowing;
|
mAodShowing = aodShowing;
|
||||||
if (aodChanged) {
|
if (aodChanged) {
|
||||||
// Ensure the new state takes effect.
|
// Ensure the new state takes effect.
|
||||||
mWindowManager.mWindowPlacerLocked.performSurfacePlacement();
|
mWindowManager.mWindowPlacerLocked.performSurfacePlacement();
|
||||||
// If the device can enter AOD and keyguard at the same time, the screen will not be
|
|
||||||
// turned off, so the snapshot needs to be refreshed when these states are changed.
|
|
||||||
if (aodShowing && keyguardShowing && keyguardChanged) {
|
|
||||||
mWindowManager.mTaskSnapshotController.snapshotForSleeping(DEFAULT_DISPLAY);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyguardChanged) {
|
if (keyguardChanged) {
|
||||||
|
|||||||
Reference in New Issue
Block a user