summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeremy Sim <jeremysim@google.com> 2024-09-28 02:54:10 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-09-28 02:54:10 +0000
commite7d94363b6510a0486e929b90e2e0c8cd85baaf9 (patch)
tree4b410864351aa9fb5ce42a0e7564cb118e200f04
parent00c9033b5e70c038b673d42d3c80545d380a875b (diff)
parent1c5c698d1b131ccc5427ee8c8b3ebd66cc18093d (diff)
Merge "Update splitscreen SnapPosition constants" into main
-rw-r--r--libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java85
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerSnapAlgorithm.java12
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java4
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/GroupedRecentTaskInfoTest.kt6
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java18
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/SplitBoundsTest.java14
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/shared/split/SplitScreenConstantsTest.kt37
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/mediaprojection/appselector/data/ShellRecentTaskListProviderTest.kt4
8 files changed, 130 insertions, 50 deletions
diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java
index 498dc8bdd24d..7f1e4a873f64 100644
--- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java
+++ b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java
@@ -66,14 +66,54 @@ public class SplitScreenConstants {
public @interface SplitPosition {
}
- /** A snap target in the first half of the screen, where the split is roughly 30-70. */
- public static final int SNAP_TO_30_70 = 0;
+ /**
+ * A snap target for two apps, where the split is 33-66. With FLAG_ENABLE_FLEXIBLE_SPLIT,
+ * only used on tablets.
+ */
+ public static final int SNAP_TO_2_33_66 = 0;
+
+ /** A snap target for two apps, where the split is 50-50. */
+ public static final int SNAP_TO_2_50_50 = 1;
+
+ /**
+ * A snap target for two apps, where the split is 66-33. With FLAG_ENABLE_FLEXIBLE_SPLIT,
+ * only used on tablets.
+ */
+ public static final int SNAP_TO_2_66_33 = 2;
- /** The 50-50 snap target */
- public static final int SNAP_TO_50_50 = 1;
+ /**
+ * A snap target for two apps, where the split is 90-10. The "10" app extends off the screen,
+ * and is actually the same size as the onscreen app, but the visible portion takes up 10% of
+ * the screen. With FLAG_ENABLE_FLEXIBLE_SPLIT, used on phones and foldables.
+ */
+ public static final int SNAP_TO_2_90_10 = 3;
- /** A snap target in the latter half of the screen, where the split is roughly 70-30. */
- public static final int SNAP_TO_70_30 = 2;
+ /**
+ * A snap target for two apps, where the split is 10-90. The "10" app extends off the screen,
+ * and is actually the same size as the onscreen app, but the visible portion takes up 10% of
+ * the screen. With FLAG_ENABLE_FLEXIBLE_SPLIT, used on phones and foldables.
+ */
+ public static final int SNAP_TO_2_10_90 = 4;
+
+ /**
+ * A snap target for three apps, where the split is 33-33-33. With FLAG_ENABLE_FLEXIBLE_SPLIT,
+ * only used on tablets.
+ */
+ public static final int SNAP_TO_3_33_33_33 = 5;
+
+ /**
+ * A snap target for three apps, where the split is 45-45-10. The "10" app extends off the
+ * screen, and is actually the same size as the onscreen apps, but the visible portion takes
+ * up 10% of the screen. With FLAG_ENABLE_FLEXIBLE_SPLIT, only used on unfolded foldables.
+ */
+ public static final int SNAP_TO_3_45_45_10 = 6;
+
+ /**
+ * A snap target for three apps, where the split is 10-45-45. The "10" app extends off the
+ * screen, and is actually the same size as the onscreen apps, but the visible portion takes
+ * up 10% of the screen. With FLAG_ENABLE_FLEXIBLE_SPLIT, only used on unfolded foldables.
+ */
+ public static final int SNAP_TO_3_10_45_45 = 7;
/**
* These snap targets are used for split pairs in a stable, non-transient state. They may be
@@ -81,9 +121,14 @@ public class SplitScreenConstants {
* {@link SnapPosition}.
*/
@IntDef(prefix = { "SNAP_TO_" }, value = {
- SNAP_TO_30_70,
- SNAP_TO_50_50,
- SNAP_TO_70_30
+ SNAP_TO_2_33_66,
+ SNAP_TO_2_50_50,
+ SNAP_TO_2_66_33,
+ SNAP_TO_2_90_10,
+ SNAP_TO_2_10_90,
+ SNAP_TO_3_33_33_33,
+ SNAP_TO_3_45_45_10,
+ SNAP_TO_3_10_45_45,
})
public @interface PersistentSnapPosition {}
@@ -91,9 +136,14 @@ public class SplitScreenConstants {
* Checks if the snapPosition in question is a {@link PersistentSnapPosition}.
*/
public static boolean isPersistentSnapPosition(@SnapPosition int snapPosition) {
- return snapPosition == SNAP_TO_30_70
- || snapPosition == SNAP_TO_50_50
- || snapPosition == SNAP_TO_70_30;
+ return snapPosition == SNAP_TO_2_33_66
+ || snapPosition == SNAP_TO_2_50_50
+ || snapPosition == SNAP_TO_2_66_33
+ || snapPosition == SNAP_TO_2_90_10
+ || snapPosition == SNAP_TO_2_10_90
+ || snapPosition == SNAP_TO_3_33_33_33
+ || snapPosition == SNAP_TO_3_45_45_10
+ || snapPosition == SNAP_TO_3_10_45_45;
}
/** The divider doesn't snap to any target and is freely placeable. */
@@ -109,9 +159,14 @@ public class SplitScreenConstants {
public static final int SNAP_TO_MINIMIZE = 13;
@IntDef(prefix = { "SNAP_TO_" }, value = {
- SNAP_TO_30_70,
- SNAP_TO_50_50,
- SNAP_TO_70_30,
+ SNAP_TO_2_33_66,
+ SNAP_TO_2_50_50,
+ SNAP_TO_2_66_33,
+ SNAP_TO_2_90_10,
+ SNAP_TO_2_10_90,
+ SNAP_TO_3_33_33_33,
+ SNAP_TO_3_45_45_10,
+ SNAP_TO_3_10_45_45,
SNAP_TO_NONE,
SNAP_TO_START_AND_DISMISS,
SNAP_TO_END_AND_DISMISS,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerSnapAlgorithm.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerSnapAlgorithm.java
index f7f45ae36eda..9f100facc163 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerSnapAlgorithm.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerSnapAlgorithm.java
@@ -19,9 +19,9 @@ package com.android.wm.shell.common.split;
import static android.view.WindowManager.DOCKED_LEFT;
import static android.view.WindowManager.DOCKED_RIGHT;
-import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_30_70;
-import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50;
-import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_70_30;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_33_66;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_50_50;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_66_33;
import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_END_AND_DISMISS;
import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_MINIMIZE;
import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_NONE;
@@ -283,10 +283,10 @@ public class DividerSnapAlgorithm {
private void addNonDismissingTargets(boolean isHorizontalDivision, int topPosition,
int bottomPosition, int dividerMax) {
- maybeAddTarget(topPosition, topPosition - getStartInset(), SNAP_TO_30_70);
+ maybeAddTarget(topPosition, topPosition - getStartInset(), SNAP_TO_2_33_66);
addMiddleTarget(isHorizontalDivision);
maybeAddTarget(bottomPosition,
- dividerMax - getEndInset() - (bottomPosition + mDividerSize), SNAP_TO_70_30);
+ dividerMax - getEndInset() - (bottomPosition + mDividerSize), SNAP_TO_2_66_33);
}
private void addFixedDivisionTargets(boolean isHorizontalDivision, int dividerMax) {
@@ -332,7 +332,7 @@ public class DividerSnapAlgorithm {
private void addMiddleTarget(boolean isHorizontalDivision) {
int position = DockedDividerUtils.calculateMiddlePosition(isHorizontalDivision,
mInsets, mDisplayWidth, mDisplayHeight, mDividerSize);
- mTargets.add(new SnapTarget(position, SNAP_TO_50_50));
+ mTargets.add(new SnapTarget(position, SNAP_TO_2_50_50));
}
private void addMinimizedTarget(boolean isHorizontalDivision, int dockedSide) {
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
index 177e47a342f6..c52d9dd24165 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
@@ -19,7 +19,7 @@ package com.android.wm.shell.common.split;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
-import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_50_50;
import static com.google.common.truth.Truth.assertThat;
@@ -136,7 +136,7 @@ public class SplitLayoutTests extends ShellTestCase {
@Test
public void testSetDivideRatio() {
mSplitLayout.setDividerPosition(200, false /* applyLayoutChange */);
- mSplitLayout.setDivideRatio(SNAP_TO_50_50);
+ mSplitLayout.setDivideRatio(SNAP_TO_2_50_50);
assertThat(mSplitLayout.getDividerPosition()).isEqualTo(
mSplitLayout.mDividerSnapAlgorithm.getMiddleTarget().position);
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/GroupedRecentTaskInfoTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/GroupedRecentTaskInfoTest.kt
index 0c3f98a324cd..0c100fca2036 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/GroupedRecentTaskInfoTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/GroupedRecentTaskInfoTest.kt
@@ -30,7 +30,7 @@ import com.android.wm.shell.shared.GroupedRecentTaskInfo.TYPE_FREEFORM
import com.android.wm.shell.shared.GroupedRecentTaskInfo.TYPE_SINGLE
import com.android.wm.shell.shared.GroupedRecentTaskInfo.TYPE_SPLIT
import com.android.wm.shell.shared.split.SplitBounds
-import com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50
+import com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_50_50
import com.google.common.truth.Correspondence
import com.google.common.truth.Truth.assertThat
import org.junit.Assert.assertThrows
@@ -136,7 +136,7 @@ class GroupedRecentTaskInfoTest : ShellTestCase() {
assertThat(recentTaskInfoParcel.taskInfo2).isNotNull()
assertThat(recentTaskInfoParcel.taskInfo2!!.taskId).isEqualTo(2)
assertThat(recentTaskInfoParcel.splitBounds).isNotNull()
- assertThat(recentTaskInfoParcel.splitBounds!!.snapPosition).isEqualTo(SNAP_TO_50_50)
+ assertThat(recentTaskInfoParcel.splitBounds!!.snapPosition).isEqualTo(SNAP_TO_2_50_50)
}
@Test
@@ -185,7 +185,7 @@ class GroupedRecentTaskInfoTest : ShellTestCase() {
private fun splitTasksGroupInfo(): GroupedRecentTaskInfo {
val task1 = createTaskInfo(id = 1)
val task2 = createTaskInfo(id = 2)
- val splitBounds = SplitBounds(Rect(), Rect(), 1, 2, SNAP_TO_50_50)
+ val splitBounds = SplitBounds(Rect(), Rect(), 1, 2, SNAP_TO_2_50_50)
return GroupedRecentTaskInfo.forSplitTasks(task1, task2, splitBounds)
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java
index 386253c19c82..753d4cd153ee 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java
@@ -22,7 +22,7 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession;
-import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_50_50;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -211,10 +211,10 @@ public class RecentTasksControllerTest extends ShellTestCase {
// Verify only one update if the split info is the same
SplitBounds bounds1 = new SplitBounds(new Rect(0, 0, 50, 50),
- new Rect(50, 50, 100, 100), t1.taskId, t2.taskId, SNAP_TO_50_50);
+ new Rect(50, 50, 100, 100), t1.taskId, t2.taskId, SNAP_TO_2_50_50);
mRecentTasksController.addSplitPair(t1.taskId, t2.taskId, bounds1);
SplitBounds bounds2 = new SplitBounds(new Rect(0, 0, 50, 50),
- new Rect(50, 50, 100, 100), t1.taskId, t2.taskId, SNAP_TO_50_50);
+ new Rect(50, 50, 100, 100), t1.taskId, t2.taskId, SNAP_TO_2_50_50);
mRecentTasksController.addSplitPair(t1.taskId, t2.taskId, bounds2);
verify(mRecentTasksController, times(1)).notifyRecentTasksChanged();
}
@@ -246,9 +246,9 @@ public class RecentTasksControllerTest extends ShellTestCase {
// Mark a couple pairs [t2, t4], [t3, t5]
SplitBounds pair1Bounds =
- new SplitBounds(new Rect(), new Rect(), 2, 4, SNAP_TO_50_50);
+ new SplitBounds(new Rect(), new Rect(), 2, 4, SNAP_TO_2_50_50);
SplitBounds pair2Bounds =
- new SplitBounds(new Rect(), new Rect(), 3, 5, SNAP_TO_50_50);
+ new SplitBounds(new Rect(), new Rect(), 3, 5, SNAP_TO_2_50_50);
mRecentTasksController.addSplitPair(t2.taskId, t4.taskId, pair1Bounds);
mRecentTasksController.addSplitPair(t3.taskId, t5.taskId, pair2Bounds);
@@ -277,9 +277,9 @@ public class RecentTasksControllerTest extends ShellTestCase {
// Mark a couple pairs [t2, t4], [t3, t5]
SplitBounds pair1Bounds =
- new SplitBounds(new Rect(), new Rect(), 2, 4, SNAP_TO_50_50);
+ new SplitBounds(new Rect(), new Rect(), 2, 4, SNAP_TO_2_50_50);
SplitBounds pair2Bounds =
- new SplitBounds(new Rect(), new Rect(), 3, 5, SNAP_TO_50_50);
+ new SplitBounds(new Rect(), new Rect(), 3, 5, SNAP_TO_2_50_50);
mRecentTasksController.addSplitPair(t2.taskId, t4.taskId, pair1Bounds);
mRecentTasksController.addSplitPair(t3.taskId, t5.taskId, pair2Bounds);
@@ -339,7 +339,7 @@ public class RecentTasksControllerTest extends ShellTestCase {
setRawList(t1, t2, t3, t4, t5);
SplitBounds pair1Bounds =
- new SplitBounds(new Rect(), new Rect(), 1, 2, SNAP_TO_50_50);
+ new SplitBounds(new Rect(), new Rect(), 1, 2, SNAP_TO_2_50_50);
mRecentTasksController.addSplitPair(t1.taskId, t2.taskId, pair1Bounds);
when(mDesktopModeTaskRepository.isActiveTask(3)).thenReturn(true);
@@ -449,7 +449,7 @@ public class RecentTasksControllerTest extends ShellTestCase {
// Add a pair
SplitBounds pair1Bounds =
- new SplitBounds(new Rect(), new Rect(), 2, 3, SNAP_TO_50_50);
+ new SplitBounds(new Rect(), new Rect(), 2, 3, SNAP_TO_2_50_50);
mRecentTasksController.addSplitPair(t2.taskId, t3.taskId, pair1Bounds);
reset(mRecentTasksController);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/SplitBoundsTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/SplitBoundsTest.java
index 248393cef9ae..be8e6dc3154b 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/SplitBoundsTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/SplitBoundsTest.java
@@ -1,6 +1,6 @@
package com.android.wm.shell.recents;
-import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_50_50;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -46,21 +46,21 @@ public class SplitBoundsTest extends ShellTestCase {
@Test
public void testVerticalStacked() {
SplitBounds ssb = new SplitBounds(mTopRect, mBottomRect,
- TASK_ID_1, TASK_ID_2, SNAP_TO_50_50);
+ TASK_ID_1, TASK_ID_2, SNAP_TO_2_50_50);
assertTrue(ssb.appsStackedVertically);
}
@Test
public void testHorizontalStacked() {
SplitBounds ssb = new SplitBounds(mLeftRect, mRightRect,
- TASK_ID_1, TASK_ID_2, SNAP_TO_50_50);
+ TASK_ID_1, TASK_ID_2, SNAP_TO_2_50_50);
assertFalse(ssb.appsStackedVertically);
}
@Test
public void testHorizontalDividerBounds() {
SplitBounds ssb = new SplitBounds(mTopRect, mBottomRect,
- TASK_ID_1, TASK_ID_2, SNAP_TO_50_50);
+ TASK_ID_1, TASK_ID_2, SNAP_TO_2_50_50);
Rect dividerBounds = ssb.visualDividerBounds;
assertEquals(0, dividerBounds.left);
assertEquals(DEVICE_LENGTH / 2 - DIVIDER_SIZE / 2, dividerBounds.top);
@@ -71,7 +71,7 @@ public class SplitBoundsTest extends ShellTestCase {
@Test
public void testVerticalDividerBounds() {
SplitBounds ssb = new SplitBounds(mLeftRect, mRightRect,
- TASK_ID_1, TASK_ID_2, SNAP_TO_50_50);
+ TASK_ID_1, TASK_ID_2, SNAP_TO_2_50_50);
Rect dividerBounds = ssb.visualDividerBounds;
assertEquals(DEVICE_WIDTH / 2 - DIVIDER_SIZE / 2, dividerBounds.left);
assertEquals(0, dividerBounds.top);
@@ -82,7 +82,7 @@ public class SplitBoundsTest extends ShellTestCase {
@Test
public void testEqualVerticalTaskPercent() {
SplitBounds ssb = new SplitBounds(mTopRect, mBottomRect,
- TASK_ID_1, TASK_ID_2, SNAP_TO_50_50);
+ TASK_ID_1, TASK_ID_2, SNAP_TO_2_50_50);
float topPercentSpaceTaken = (float) (DEVICE_LENGTH / 2 - DIVIDER_SIZE / 2) / DEVICE_LENGTH;
assertEquals(topPercentSpaceTaken, ssb.topTaskPercent, 0.01);
}
@@ -90,7 +90,7 @@ public class SplitBoundsTest extends ShellTestCase {
@Test
public void testEqualHorizontalTaskPercent() {
SplitBounds ssb = new SplitBounds(mLeftRect, mRightRect,
- TASK_ID_1, TASK_ID_2, SNAP_TO_50_50);
+ TASK_ID_1, TASK_ID_2, SNAP_TO_2_50_50);
float leftPercentSpaceTaken = (float) (DEVICE_WIDTH / 2 - DIVIDER_SIZE / 2) / DEVICE_WIDTH;
assertEquals(leftPercentSpaceTaken, ssb.leftTaskPercent, 0.01);
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/shared/split/SplitScreenConstantsTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/shared/split/SplitScreenConstantsTest.kt
index 19c18be44ab1..ac9606350ebd 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/shared/split/SplitScreenConstantsTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/shared/split/SplitScreenConstantsTest.kt
@@ -42,19 +42,44 @@ class SplitScreenConstantsTest {
SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT,
)
assertEquals(
- "the value of SNAP_TO_30_70 should be 0",
+ "the value of SNAP_TO_2_33_66 should be 0",
0,
- SplitScreenConstants.SNAP_TO_30_70,
+ SplitScreenConstants.SNAP_TO_2_33_66,
)
assertEquals(
- "the value of SNAP_TO_50_50 should be 1",
+ "the value of SNAP_TO_2_50_50 should be 1",
1,
- SplitScreenConstants.SNAP_TO_50_50,
+ SplitScreenConstants.SNAP_TO_2_50_50,
)
assertEquals(
- "the value of SNAP_TO_70_30 should be 2",
+ "the value of SNAP_TO_2_66_33 should be 2",
2,
- SplitScreenConstants.SNAP_TO_70_30,
+ SplitScreenConstants.SNAP_TO_2_66_33,
+ )
+ assertEquals(
+ "the value of SNAP_TO_2_90_10 should be 3",
+ 3,
+ SplitScreenConstants.SNAP_TO_2_90_10,
+ )
+ assertEquals(
+ "the value of SNAP_TO_2_10_90 should be 4",
+ 4,
+ SplitScreenConstants.SNAP_TO_2_10_90,
+ )
+ assertEquals(
+ "the value of SNAP_TO_3_33_33_33 should be 5",
+ 5,
+ SplitScreenConstants.SNAP_TO_3_33_33_33,
+ )
+ assertEquals(
+ "the value of SNAP_TO_3_45_45_10 should be 6",
+ 6,
+ SplitScreenConstants.SNAP_TO_3_45_45_10,
+ )
+ assertEquals(
+ "the value of SNAP_TO_3_10_45_45 should be 7",
+ 7,
+ SplitScreenConstants.SNAP_TO_3_10_45_45,
)
}
} \ No newline at end of file
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/mediaprojection/appselector/data/ShellRecentTaskListProviderTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/mediaprojection/appselector/data/ShellRecentTaskListProviderTest.kt
index 3e3aa4f079f7..e12c67b24893 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/mediaprojection/appselector/data/ShellRecentTaskListProviderTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/mediaprojection/appselector/data/ShellRecentTaskListProviderTest.kt
@@ -18,7 +18,7 @@ import com.android.systemui.util.mockito.whenever
import com.android.wm.shell.recents.RecentTasks
import com.android.wm.shell.shared.GroupedRecentTaskInfo
import com.android.wm.shell.shared.split.SplitBounds
-import com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50
+import com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_50_50
import com.google.common.truth.Truth.assertThat
import java.util.Optional
import java.util.function.Consumer
@@ -268,7 +268,7 @@ class ShellRecentTaskListProviderTest : SysuiTestCase() {
GroupedRecentTaskInfo.forSplitTasks(
createTaskInfo(taskId1, userId1, isVisible),
createTaskInfo(taskId2, userId2, isVisible),
- SplitBounds(Rect(), Rect(), taskId1, taskId2, SNAP_TO_50_50)
+ SplitBounds(Rect(), Rect(), taskId1, taskId2, SNAP_TO_2_50_50)
)
private fun createTaskInfo(taskId: Int, userId: Int, isVisible: Boolean = false) =