Skip splash screen exit animation if screen isn't on.

Skip the default splash screen exit animation if display
is turned off or start dozing.

Bug: 225295803
Test: Manual, enable AOD, start activity from background,
verify no exit animation on system trace.

Change-Id: Ic4fb1cba78c7ebe883a9eca58fb9852c4ea1052c
This commit is contained in:
wilsonshih
2022-04-13 15:22:55 +08:00
parent 6a60515cba
commit 694338cbf1

View File

@@ -38,6 +38,7 @@ import android.os.Parcel;
import android.os.RemoteException;
import android.util.Slog;
import android.util.proto.ProtoOutputStream;
import android.view.Display;
import android.view.SurfaceControl;
import android.window.ITaskOrganizer;
import android.window.ITaskOrganizerController;
@@ -526,17 +527,17 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
}
final StartingWindowRemovalInfo removalInfo = new StartingWindowRemovalInfo();
removalInfo.taskId = task.mTaskId;
removalInfo.playRevealAnimation = prepareAnimation;
removalInfo.playRevealAnimation = prepareAnimation
&& task.getDisplayInfo().state == Display.STATE_ON;
final boolean playShiftUpAnimation = !task.inMultiWindowMode();
final ActivityRecord topActivity = task.topActivityContainsStartingWindow();
if (topActivity != null) {
removalInfo.deferRemoveForIme = topActivity.mDisplayContent
.mayImeShowOnLaunchingActivity(topActivity);
if (prepareAnimation && playShiftUpAnimation) {
if (removalInfo.playRevealAnimation && playShiftUpAnimation) {
final WindowState mainWindow =
topActivity.findMainWindow(false/* includeStartingApp */);
if (mainWindow != null) {
final SurfaceControl.Transaction t = mainWindow.getPendingTransaction();
removalInfo.windowAnimationLeash = applyStartingWindowAnimation(mainWindow);
removalInfo.mainFrame = mainWindow.getRelativeFrame();
}