From 7fcb30d2c7e035a066676e9a4b13871a15eecdf3 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Wed, 29 Mar 2023 16:13:02 -0700 Subject: [PATCH] Correctly disposing of LauncherUnlockAnimationController In SystemUiProxy we don't need to check for null before calling setLauncherUnlockAnimationController becase that function is already checkingh fo nulls, so it was preventing the variable from getting cleaned. Fix: 275418590 Test: flake should dissapear or be reduced Change-Id: I8cf5dad57678493167354e137a18e37b37f3e58b --- .../com/android/quickstep/SystemUiProxy.java | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 7cc3e11fc8..27345dd543 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -218,29 +218,15 @@ public class SystemUiProxy implements ISystemUiProxy { mUnfoldAnimation = unfoldAnimation; linkToDeath(); // re-attach the listeners once missing due to setProxy has not been initialized yet. - if (mPipAnimationListener != null && mPip != null) { - setPipAnimationListener(mPipAnimationListener); - } - if (mSplitScreenListener != null && mSplitScreen != null) { - registerSplitScreenListener(mSplitScreenListener); - } - if (mStartingWindowListener != null && mStartingWindow != null) { - setStartingWindowListener(mStartingWindowListener); - } - if (mSysuiUnlockAnimationController != null && mLauncherUnlockAnimationController != null) { - setLauncherUnlockAnimationController(mLauncherUnlockAnimationController); - } + setPipAnimationListener(mPipAnimationListener); + registerSplitScreenListener(mSplitScreenListener); + setStartingWindowListener(mStartingWindowListener); + setLauncherUnlockAnimationController(mLauncherUnlockAnimationController); new LinkedHashMap<>(mRemoteTransitions).forEach(this::registerRemoteTransition); setupTransactionQueue(); - if (mRecentTasksListener != null && mRecentTasks != null) { - registerRecentTasksListener(mRecentTasksListener); - } - if (mBackAnimation != null && mBackToLauncherCallback != null) { - setBackToLauncherCallback(mBackToLauncherCallback, mBackToLauncherRunner); - } - if (unfoldAnimation != null && mUnfoldAnimationListener != null) { - setUnfoldAnimationListener(mUnfoldAnimationListener); - } + registerRecentTasksListener(mRecentTasksListener); + setBackToLauncherCallback(mBackToLauncherCallback, mBackToLauncherRunner); + setUnfoldAnimationListener(mUnfoldAnimationListener); } public void clearProxy() {