Loading libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java +13 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,19 @@ public class SplitScreenConstants { }; } /** * Convenience method to convert between the IntDef's to avoid some errors * @return {@code -1} if splitScreenState does not have a valid/corresponding * PersistentSnapPosition */ @PersistentSnapPosition public static int splitStateToSnapPosition(@SplitScreenState int splitScreenState) { return switch (splitScreenState) { case NOT_IN_SPLIT, SNAP_TO_NONE, ANIMATING_OFFSCREEN_TAP -> -1; default -> splitScreenState; }; } /** * Checks if the snapPosition in question is a {@link PersistentSnapPosition}. */ Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +9 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSIT import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT; import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_UNDEFINED; import static com.android.wm.shell.shared.split.SplitScreenConstants.splitPositionToString; import static com.android.wm.shell.shared.split.SplitScreenConstants.splitStateToSnapPosition; import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_A; import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_B; import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_MAIN; Loading Loading @@ -1437,6 +1438,14 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mSplitLayout.populateTouchZones(); notifySplitAnimationStatus(false /*animationRunning*/); if (enableFlexibleTwoAppSplit() && mSplitState.currentStateHasOffscreenApps()) { // Stages have changed positions, but layout hasn't so update // focus on the same layout type as before. NOTE: this needs to happen // AFTER we make the window's focusable, otherwise it's a no-op grantFocusForSnapPosition(splitStateToSnapPosition(mSplitState.get())); } // updateSurfaceBounds(), above, officially puts the two apps in their new // stages. Starting on the next frame, all calculations are made using the // new layouts/insets. So any follow-up animations on the same leashes below Loading Loading
libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java +13 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,19 @@ public class SplitScreenConstants { }; } /** * Convenience method to convert between the IntDef's to avoid some errors * @return {@code -1} if splitScreenState does not have a valid/corresponding * PersistentSnapPosition */ @PersistentSnapPosition public static int splitStateToSnapPosition(@SplitScreenState int splitScreenState) { return switch (splitScreenState) { case NOT_IN_SPLIT, SNAP_TO_NONE, ANIMATING_OFFSCREEN_TAP -> -1; default -> splitScreenState; }; } /** * Checks if the snapPosition in question is a {@link PersistentSnapPosition}. */ Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +9 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSIT import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT; import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_UNDEFINED; import static com.android.wm.shell.shared.split.SplitScreenConstants.splitPositionToString; import static com.android.wm.shell.shared.split.SplitScreenConstants.splitStateToSnapPosition; import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_A; import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_B; import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_MAIN; Loading Loading @@ -1437,6 +1438,14 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mSplitLayout.populateTouchZones(); notifySplitAnimationStatus(false /*animationRunning*/); if (enableFlexibleTwoAppSplit() && mSplitState.currentStateHasOffscreenApps()) { // Stages have changed positions, but layout hasn't so update // focus on the same layout type as before. NOTE: this needs to happen // AFTER we make the window's focusable, otherwise it's a no-op grantFocusForSnapPosition(splitStateToSnapPosition(mSplitState.get())); } // updateSurfaceBounds(), above, officially puts the two apps in their new // stages. Starting on the next frame, all calculations are made using the // new layouts/insets. So any follow-up animations on the same leashes below Loading