diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 45eb7cdcbf6cb..abc2b7aabb6b0 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -8183,7 +8183,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A if (shouldRelaunchLocked(changes, mTmpConfig) || forceNewConfig) { // Aha, the activity isn't handling the change, so DIE DIE DIE. configChangeFlags |= changes; - startFreezingScreenLocked(globalChanges); + if (!mAtmService.getTransitionController().isShellTransitionsEnabled()) { + startFreezingScreenLocked(globalChanges); + } forceNewConfig = false; preserveWindow &= isResizeOnlyChange(changes); final boolean hasResizeChange = hasResizeChange(changes & ~info.getRealConfigChanged()); diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index f829b0f0d10c3..3abe455270041 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -2403,6 +2403,12 @@ class WindowState extends WindowContainer implements WindowManagerP @Override void removeImmediately() { + if (!mRemoved) { + // Destroy surface before super call. The general pattern is that the children need + // to be removed before the parent (so that the sync-engine tracking works). Since + // WindowStateAnimator is a "virtual" child, we have to do it manually here. + mWinAnimator.destroySurfaceLocked(getSyncTransaction()); + } super.removeImmediately(); if (mRemoved) { @@ -2444,8 +2450,6 @@ class WindowState extends WindowContainer implements WindowManagerP disposeInputChannel(); - mWinAnimator.destroySurfaceLocked(mTmpTransaction); - mTmpTransaction.apply(); mSession.windowRemovedLocked(); try { mClient.asBinder().unlinkToDeath(mDeathRecipient, 0);