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

Commit bf609ca3 authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

Merge "Handle launch adjacent resize" into main

parents 543b0879 5ccfe4e3
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ import android.app.ActivityManager;
import android.app.ActivityOptions;
import android.app.IActivityTaskManager;
import android.app.PendingIntent;
import android.app.PictureInPictureParams;
import android.app.TaskInfo;
import android.content.ActivityNotFoundException;
import android.content.Context;
@@ -2890,6 +2891,16 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    prepareEnterSplitScreen(out);
                    mSplitTransitions.setEnterTransition(transition, request.getRemoteTransition(),
                            TRANSIT_SPLIT_SCREEN_PAIR_OPEN, !mIsDropEntering);
                } else if (isSplitScreenVisible() && isOpening) {
                    // launching into an existing split stage; possibly launchAdjacent
                    // If we're replacing a pip-able app, we need to let mixed handler take care of
                    // it. Otherwise we'll just treat it as an enter+resize
                    if (mSplitLayout.calculateCurrentSnapPosition() != SNAP_TO_2_50_50) {
                        // updated layout will get applied in startAnimation pendingResize
                        mSplitTransitions.setEnterTransition(transition,
                                request.getRemoteTransition(),
                                TRANSIT_SPLIT_SCREEN_OPEN_TO_SIDE, true /*resizeAnim*/);
                    }
                } else if (inFullscreen && isSplitScreenVisible()) {
                    // If the trigger task is in fullscreen and in split, exit split and place
                    // task on top
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.wm.shell.splitscreen;

import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_50_50;

import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;

@@ -58,6 +60,7 @@ public class SplitTestUtils {
        doReturn(leash).when(out).getDividerLeash();
        doReturn(bounds1).when(out).getTopLeftBounds();
        doReturn(bounds2).when(out).getBottomRightBounds();
        doReturn(SNAP_TO_2_50_50).when(out).calculateCurrentSnapPosition();
        return out;
    }