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

Commit 822d98e0 authored by Santiago Etchebehere's avatar Santiago Etchebehere Committed by Automerger Merge Worker
Browse files

Merge "Revert "Remove check for preventing re-parenting non-split apps"" into tm-dev am: 791c6127

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17918610



Change-Id: If89e8267f13ec08fe99a80d150965befed31a74c
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 22caf0e6 791c6127
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -98,14 +98,11 @@ interface ISplitScreen {
    /**
     * Blocking call that notifies and gets additional split-screen targets when entering
     * recents (for example: the dividerBar).
     * @param cancel is true if leaving recents back to split (eg. the gesture was cancelled).
     * @param appTargets apps that will be re-parented to display area
     */
    RemoteAnimationTarget[] onGoingToRecentsLegacy(in RemoteAnimationTarget[] appTargets) = 13;
    RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel,
                                                   in RemoteAnimationTarget[] appTargets) = 13;


    /**
     * Blocking call that notifies and gets additional split-screen targets when entering
     * recents (for example: the dividerBar). Different than the method above in that this one
     * does not expect split to currently be running.
     */
    RemoteAnimationTarget[] onStartingSplitLegacy(in RemoteAnimationTarget[] appTargets) = 14;
}
+6 −26
Original line number Diff line number Diff line
@@ -413,22 +413,9 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
        mSyncQueue.queue(transition, WindowManager.TRANSIT_OPEN, wct);
    }

    RemoteAnimationTarget[] onGoingToRecentsLegacy(RemoteAnimationTarget[] apps) {
        return reparentSplitTasksForAnimation(apps, true /*splitExpectedToBeVisible*/);
    }

    RemoteAnimationTarget[] onStartingSplitLegacy(RemoteAnimationTarget[] apps) {
        return reparentSplitTasksForAnimation(apps, false /*splitExpectedToBeVisible*/);
    }

    private RemoteAnimationTarget[] reparentSplitTasksForAnimation(RemoteAnimationTarget[] apps,
            boolean splitExpectedToBeVisible) {
        if (ENABLE_SHELL_TRANSITIONS) return null;
    RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel, RemoteAnimationTarget[] apps) {
        if (ENABLE_SHELL_TRANSITIONS || !isSplitScreenVisible()) return null;
        // TODO(b/206487881): Integrate this with shell transition.
        if (splitExpectedToBeVisible && !isSplitScreenVisible()) return null;
        // Split not visible, but not enough apps to have split, also return null
        if (!splitExpectedToBeVisible && apps.length < 2) return null;

        SurfaceControl.Transaction transaction = new SurfaceControl.Transaction();
        if (mSplitTasksContainerLayer != null) {
            // Remove the previous layer before recreating
@@ -455,6 +442,7 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
        transaction.close();
        return new RemoteAnimationTarget[]{mStageCoordinator.getDividerBarLegacyTarget()};
    }

    /**
     * Sets drag info to be logged when splitscreen is entered.
     */
@@ -719,19 +707,11 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
        }

        @Override
        public RemoteAnimationTarget[] onGoingToRecentsLegacy(RemoteAnimationTarget[] apps) {
        public RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel,
                RemoteAnimationTarget[] apps) {
            final RemoteAnimationTarget[][] out = new RemoteAnimationTarget[][]{null};
            executeRemoteCallWithTaskPermission(mController, "onGoingToRecentsLegacy",
                    (controller) -> out[0] = controller.onGoingToRecentsLegacy(apps),
                    true /* blocking */);
            return out[0];
        }

        @Override
        public RemoteAnimationTarget[] onStartingSplitLegacy(RemoteAnimationTarget[] apps) {
            final RemoteAnimationTarget[][] out = new RemoteAnimationTarget[][]{null};
            executeRemoteCallWithTaskPermission(mController, "onStartingSplitLegacy",
                    (controller) -> out[0] = controller.onStartingSplitLegacy(apps),
                    (controller) -> out[0] = controller.onGoingToRecentsLegacy(cancel, apps),
                    true /* blocking */);
            return out[0];
        }