From 2df75d388f569883bf3eb06e6f08176b75c0b32a Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Thu, 22 Apr 2021 16:17:36 -0700 Subject: [PATCH] Fix surface release race when using Shell Transitions Shell Transitions operates on the leashes both before and after the animation in order to adapt shell transit to the legacy transit impls in launcher. This means we can't release the surfaces before the finish callback. Since the finish callback provides a convenient place to release the surfaces anyways, we can effectively disable the release here. Bug: 186158221 Test: enable shell transit, physically rotate to landscape, launch messages and then close it (back-gesture) repeatedly and observe that launcher doesn't crash. Change-Id: I5197cf448917eb7b326e808887f4adace232209c --- .../src/com/android/quickstep/RemoteAnimationTargets.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java b/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java index a1af77d382..edc3ab22f3 100644 --- a/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java +++ b/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java @@ -17,6 +17,8 @@ package com.android.quickstep; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR; +import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS; + import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.ArrayList; @@ -97,6 +99,10 @@ public class RemoteAnimationTargets { } public void release() { + if (ENABLE_SHELL_TRANSITIONS) { + mReleaseChecks.clear(); + return; + } if (mReleased) { return; }