Fix no action menu for split pairs in overview panel
The splitting tasks will be reparented to RecentAnimationSplitTasks
overlay layer in order to animate them together. However, the other
animating apps should also be placed to the same overlay layer so all of
them can be layered properly during the transition.
Bug: 239630217
Test: action menu shows above split pairs in overview panel
Change-Id: I4dda71317bb61775664dcbfe1cee9a099aca872f
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
index 51ae56b..c602324 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
@@ -16,7 +16,6 @@
package com.android.quickstep;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
-import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME;
import android.graphics.Rect;
import android.util.ArraySet;
@@ -97,18 +96,6 @@
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets,
Rect homeContentInsets, Rect minimizedHomeBounds) {
- // Convert appTargets to type RemoteAnimationTarget for all apps except Home app
- RemoteAnimationTarget[] nonHomeApps = Arrays.stream(appTargets)
- .filter(remoteAnimationTarget ->
- remoteAnimationTarget.activityType != ACTIVITY_TYPE_HOME)
- .map(RemoteAnimationTargetCompat::unwrap)
- .toArray(RemoteAnimationTarget[]::new);
-
- RemoteAnimationTarget[] nonAppTargets = mSystemUiProxy.onGoingToRecentsLegacy(nonHomeApps);
-
- RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets,
- wallpaperTargets, RemoteAnimationTargetCompat.wrap(nonAppTargets),
- homeContentInsets, minimizedHomeBounds);
mController = new RecentsAnimationController(animationController,
mAllowMinimizeSplitScreen, this::onAnimationFinished);
@@ -116,6 +103,13 @@
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(),
mController::finishAnimationToApp);
} else {
+ final RemoteAnimationTarget[] nonAppTargets = mSystemUiProxy.onGoingToRecentsLegacy(
+ Arrays.stream(appTargets).map(RemoteAnimationTargetCompat::unwrap)
+ .toArray(RemoteAnimationTarget[]::new));
+ final RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets,
+ wallpaperTargets, RemoteAnimationTargetCompat.wrap(nonAppTargets),
+ homeContentInsets, minimizedHomeBounds);
+
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
for (RecentsAnimationListener listener : getListeners()) {
listener.onRecentsAnimationStart(mController, targets);
diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
index fd7e367..0314761 100644
--- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java
+++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
@@ -45,7 +45,7 @@
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
-import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAnimationListener {
@@ -156,30 +156,21 @@
public void onTasksAppeared(RemoteAnimationTargetCompat[] appearedTaskTargets) {
RemoteAnimationTargetCompat appearedTaskTarget = appearedTaskTargets[0];
BaseActivityInterface activityInterface = mLastGestureState.getActivityInterface();
- // Convert appTargets to type RemoteAnimationTarget for all apps except Home app
- final ArrayList<RemoteAnimationTargetCompat> tmpNonHomeApps = new ArrayList<>();
- final ArrayList<RemoteAnimationTargetCompat> tmpHomeApps = new ArrayList<>();
+
for (RemoteAnimationTargetCompat compat : appearedTaskTargets) {
- if (compat.activityType != ACTIVITY_TYPE_HOME) {
- tmpNonHomeApps.add(compat);
- } else {
- tmpHomeApps.add(compat);
+ if (compat.activityType == ACTIVITY_TYPE_HOME
+ && activityInterface.getCreatedActivity() instanceof RecentsActivity) {
+ // When receive opening home activity while recents is running, enter home
+ // and dismiss recents.
+ ((RecentsActivity) activityInterface.getCreatedActivity()).startHome();
+ return;
}
}
- RemoteAnimationTarget[] nonHomeApps = tmpNonHomeApps.stream()
- .map(RemoteAnimationTargetCompat::unwrap)
- .toArray(RemoteAnimationTarget[]::new);
- RemoteAnimationTarget[] homeApps = tmpHomeApps.stream()
- .map(RemoteAnimationTargetCompat::unwrap)
- .toArray(RemoteAnimationTarget[]::new);
- if (homeApps.length > 0
- && activityInterface.getCreatedActivity() instanceof RecentsActivity) {
- ((RecentsActivity) activityInterface.getCreatedActivity()).startHome();
- return;
- }
- RemoteAnimationTarget[] nonAppTargets =
- SystemUiProxy.INSTANCE.getNoCreate().onStartingSplitLegacy(nonHomeApps);
+ RemoteAnimationTarget[] nonAppTargets = SystemUiProxy.INSTANCE.getNoCreate()
+ .onStartingSplitLegacy(Arrays.stream(appearedTaskTargets)
+ .map(RemoteAnimationTargetCompat::unwrap)
+ .toArray(RemoteAnimationTarget[]::new));
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && activityInterface.isInLiveTileMode()
&& activityInterface.getCreatedActivity() != null) {