Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32820e89 authored by Jerry Chang's avatar Jerry Chang
Browse files

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
parent caacd73c
Loading
Loading
Loading
Loading
+7 −13
Original line number Diff line number Diff line
@@ -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 @@ public class RecentsAnimationCallbacks implements
            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 @@ public class RecentsAnimationCallbacks implements
            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);
+12 −21
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ import com.android.systemui.shared.system.RemoteTransitionCompat;
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 class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
            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);
                    }
                }
                RemoteAnimationTarget[] nonHomeApps = tmpNonHomeApps.stream()
                        .map(RemoteAnimationTargetCompat::unwrap)
                        .toArray(RemoteAnimationTarget[]::new);
                RemoteAnimationTarget[] homeApps = tmpHomeApps.stream()
                        .map(RemoteAnimationTargetCompat::unwrap)
                        .toArray(RemoteAnimationTarget[]::new);
                if (homeApps.length > 0
                    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[] 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) {