From cab41ed6704acc52fc4ae3c475ca880f66eb5604 Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Thu, 16 Sep 2021 17:42:51 -0700 Subject: [PATCH] Register remote transitions on activity start Was only registering once, but launcher can stop/start its activity (eg when changing gesture modes), so we need to try and re-register every time Bug: 200213691 Test: atest CloseAppHomeButtonTest change gesture mode and observe functional animations Change-Id: I29f1eb647c2168d753e37f57657906979c5518be --- .../com/android/launcher3/BaseQuickstepLauncher.java | 1 + .../com/android/quickstep/BaseActivityInterface.java | 5 ----- .../android/quickstep/LauncherActivityInterface.java | 7 ------- .../src/com/android/quickstep/SystemUiProxy.java | 11 ++++++++++- .../android/quickstep/TouchInteractionService.java | 6 ------ 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java index d24d752491..fcbea77e0f 100644 --- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java @@ -353,6 +353,7 @@ public abstract class BaseQuickstepLauncher extends Launcher mAppTransitionManager = new QuickstepTransitionManager(this); mAppTransitionManager.registerRemoteAnimations(); + mAppTransitionManager.registerRemoteTransitions(); internalBindToTIS(); } diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 6298bb806e..9fa0f1a45c 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -536,9 +536,4 @@ public abstract class BaseActivityInterface mPendingRemoteTransitions = new ArrayList<>(); // Used to dedupe calls to SystemUI private int mLastShelfHeight; @@ -161,6 +163,10 @@ public class SystemUiProxy implements ISystemUiProxy, setSmartspaceCallback(mPendingSmartspaceCallback); mPendingSmartspaceCallback = null; } + for (int i = mPendingRemoteTransitions.size() - 1; i >= 0; --i) { + registerRemoteTransition(mPendingRemoteTransitions.get(i)); + } + mPendingRemoteTransitions.clear(); if (mPendingSetNavButtonAlpha != null) { mPendingSetNavButtonAlpha.run(); @@ -688,6 +694,8 @@ public class SystemUiProxy implements ISystemUiProxy, } catch (RemoteException e) { Log.w(TAG, "Failed call registerRemoteTransition"); } + } else { + mPendingRemoteTransitions.add(remoteTransition); } } @@ -699,6 +707,7 @@ public class SystemUiProxy implements ISystemUiProxy, Log.w(TAG, "Failed call registerRemoteTransition"); } } + mPendingRemoteTransitions.remove(remoteTransition); } // diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 3ce12c53b3..bb8473bc1d 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -179,12 +179,6 @@ public class TouchInteractionService extends Service implements PluginListener { - final BaseActivityInterface ai = - mOverviewComponentObserver.getActivityInterface(); - if (ai == null) return; - ai.onOverviewServiceBound(); - }); }); sIsInitialized = true; }