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

Commit eb7dc842 authored by Will Osborn's avatar Will Osborn
Browse files

Fix desktop recents transition ignoring display id

Test: local + unit
Bug: 392703464
Flag: com.android.launcher3.enable_overview_on_connected_displays

Change-Id: I631fcf80c552652d2d08bf71e7fdfe6044d54325
parent 42733b04
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
import static android.view.WindowManager.KEYGUARD_VISIBILITY_TRANSIT_FLAGS;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
@@ -44,6 +45,7 @@ import static com.android.wm.shell.transition.Transitions.TRANSIT_START_RECENTS_
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.ActivityOptions;
import android.app.ActivityTaskManager;
import android.app.IApplicationThread;
import android.app.PendingIntent;
@@ -237,8 +239,13 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
        // requires the handler, but the mixed handler also needs a reference to the transition.
        RecentsMixedHandler mixer = null;
        Consumer<IBinder> setTransitionForMixer = null;
        ActivityOptions activityOptions = ActivityOptions.fromBundle(options);
        int displayId = activityOptions.getLaunchDisplayId();
        if (displayId == INVALID_DISPLAY) {
            displayId = DEFAULT_DISPLAY;
        }
        for (int i = 0; i < mMixers.size(); ++i) {
            setTransitionForMixer = mMixers.get(i).handleRecentsRequest();
            setTransitionForMixer = mMixers.get(i).handleRecentsRequest(displayId);
            if (setTransitionForMixer != null) {
                mixer = mMixers.get(i);
                break;
@@ -1807,7 +1814,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
         * {@link #mergeAnimation}, and {@link #onTransitionConsumed} methods.
         */
        @Nullable
        Consumer<IBinder> handleRecentsRequest();
        Consumer<IBinder> handleRecentsRequest(int displayId);

        /**
         * Called when a recents transition has finished, with a WCT and SurfaceControl Transaction
+7 −4
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.wm.shell.transition;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_PIP;
import static android.window.TransitionInfo.FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY;
@@ -432,7 +431,12 @@ public class DefaultMixedHandler implements MixedTransitionHandler,
    }

    @Override
    public Consumer<IBinder> handleRecentsRequest() {
    public Consumer<IBinder> handleRecentsRequest(int displayId) {
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS,
                " handleRecentsRequest displayId=%d deskActive=%b",
                displayId,
                mDesktopTasksController != null && mDesktopTasksController.isAnyDeskActive(
                        displayId));
        if (mRecentsHandler != null) {
            if (mSplitHandler.isSplitScreenVisible()) {
                return this::setRecentsTransitionDuringSplit;
@@ -440,8 +444,7 @@ public class DefaultMixedHandler implements MixedTransitionHandler,
                    && !mKeyguardHandler.isKeyguardAnimating()) {
                return this::setRecentsTransitionDuringKeyguard;
            } else if (mDesktopTasksController != null
                    // Check on the default display. Recents/gesture nav is only available there
                    && mDesktopTasksController.isAnyDeskActive(DEFAULT_DISPLAY)) {
                    && mDesktopTasksController.isAnyDeskActive(displayId)) {
                return this::setRecentsTransitionDuringDesktop;
            }
        }