Merge "Fix ActivityRecord leak if mainWindow is animating." into sc-dev am: 659a42df84

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14540401

Change-Id: Ic402939f39f52c9ad4874bef2841a75d279675d0
This commit is contained in:
TreeHugger Robot
2021-05-17 20:32:20 +00:00
committed by Automerger Merge Worker

View File

@@ -2409,18 +2409,22 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
final boolean startingWindow = mAttrs.type == TYPE_APPLICATION_STARTING;
if (startingWindow) {
ProtoLog.d(WM_DEBUG_STARTING_WINDOW, "Starting window removed %s", this);
}
if (startingWindow && StartingSurfaceController.DEBUG_ENABLE_SHELL_DRAWER) {
// Cancel the remove starting window animation on shell. The main window might changed
// during animating, checking for all windows would be safer.
if (mActivityRecord != null) {
mActivityRecord.forAllWindows(w -> {
mActivityRecord.forAllWindowsUnchecked(w -> {
if (w.isSelfAnimating(0, ANIMATION_TYPE_STARTING_REVEAL)) {
w.cancelAnimation();
return true;
}
return false;
}, true);
}
} else if (mAttrs.type == TYPE_BASE_APPLICATION
&& isSelfAnimating(0, ANIMATION_TYPE_STARTING_REVEAL)) {
// Cancel the remove starting window animation in case the binder dead before remove
// splash window.
cancelAnimation();
}
ProtoLog.v(WM_DEBUG_FOCUS, "Remove client=%x, surfaceController=%s Callers=%s",
@@ -2428,7 +2432,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
mWinAnimator.mSurfaceController,
Debug.getCallers(5));
final long origId = Binder.clearCallingIdentity();
try {