diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/ISplitScreen.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/ISplitScreen.aidl index 2427d53f48422..df1f5e67e4e2e 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/ISplitScreen.aidl +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/ISplitScreen.aidl @@ -90,4 +90,11 @@ interface ISplitScreen { oneway void startTasksWithLegacyTransition(int mainTaskId, in Bundle mainOptions, int sideTaskId, in Bundle sideOptions, int sidePosition, in RemoteAnimationAdapter adapter) = 11; + + /** + * 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). + */ + RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel) = 12; } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java index 197409d6d07f1..36b2777ec3c44 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java @@ -40,6 +40,7 @@ import android.os.RemoteException; import android.os.UserHandle; import android.util.Slog; import android.view.RemoteAnimationAdapter; +import android.view.RemoteAnimationTarget; import android.window.IRemoteTransition; import androidx.annotation.BinderThread; @@ -267,6 +268,11 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, return options; } + RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel) { + if (!isSplitScreenVisible()) return null; + return new RemoteAnimationTarget[]{mStageCoordinator.getDividerBarLegacyTarget()}; + } + public void dump(@NonNull PrintWriter pw, String prefix) { pw.println(prefix + TAG); if (mStageCoordinator != null) { @@ -466,5 +472,14 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, controller.startIntent(intent, fillInIntent, stage, position, options); }); } + + @Override + public RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel) { + final RemoteAnimationTarget[][] out = new RemoteAnimationTarget[][]{null}; + executeRemoteCallWithTaskPermission(mController, "onGoingToRecentsLegacy", + (controller) -> out[0] = controller.onGoingToRecentsLegacy(cancel), + true /* blocking */); + return out[0]; + } } } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index bc4827315f824..4e91193f65551 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -970,7 +970,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, } } - private RemoteAnimationTarget getDividerBarLegacyTarget() { + RemoteAnimationTarget getDividerBarLegacyTarget() { final Rect bounds = mSplitLayout.getDividerBounds(); return new RemoteAnimationTarget(-1 /* taskId */, -1 /* mode */, mSplitLayout.getDividerLeash(), false /* isTranslucent */, null /* clipRect */,