Fixes the secondary splitscreen dimensions
Fixes the splitscreen bounds of other app introduced in ag/3909876 and
bound issues related to rotation before splitscreen occurs from
landscape to seascape.
Fixes: 73250406
Test: splitscreen in seascape
Change-Id: I14f9512069b674da7d382ede8514545aabe8c5d7
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
index 24e39bf..3eb3160 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
@@ -778,9 +778,17 @@
mHandle.setAlpha(minimized ? 0f : 1f);
mDockedStackMinimized = minimized;
} else if (mDockedStackMinimized != minimized) {
- mMinimizedSnapAlgorithm = null;
mDockedStackMinimized = minimized;
- initializeSnapAlgorithm();
+ if (mDisplayRotation != mDefaultDisplay.getRotation()) {
+ // Splitscreen to minimize is about to starts after rotating landscape to seascape,
+ // update insets, display info and snap algorithm targets
+ SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets);
+ repositionSnapTargetBeforeMinimized();
+ updateDisplayInfo();
+ } else {
+ mMinimizedSnapAlgorithm = null;
+ initializeSnapAlgorithm();
+ }
if (mIsInMinimizeInteraction != minimized || mCurrentAnimator != null) {
cancelFlingAnimation();
if (minimized) {
@@ -1018,7 +1026,6 @@
if (mDockSide == DOCKED_RIGHT) {
mDockedTaskRect.offset(Math.max(position, mStableInsets.left - mDividerSize)
- mDockedTaskRect.left + mDividerSize, 0);
- mOtherTaskRect.offset(mStableInsets.left, 0);
}
mWindowManagerProxy.resizeDockedStack(mDockedRect, mDockedTaskRect, mDockedTaskRect,
mOtherTaskRect, null);
@@ -1032,7 +1039,6 @@
if (mDockSide == DOCKED_RIGHT) {
mDockedTaskRect.offset(Math.max(position, mStableInsets.left - mDividerSize)
- mDockedTaskRect.left + mDividerSize, 0);
- mOtherTaskRect.offset(mStableInsets.left, 0);
}
calculateBoundsForPosition(taskPosition, DockedDividerUtils.invertDockSide(mDockSide),
mOtherTaskRect);
@@ -1049,7 +1055,6 @@
// Move a right-docked-app to line up with the divider while dragging it
if (mDockSide == DOCKED_RIGHT) {
mDockedTaskRect.offset(position - mStableInsets.left + mDividerSize, 0);
- mOtherTaskRect.offset(mStableInsets.left, 0);
}
mWindowManagerProxy.resizeDockedStack(mDockedRect, mDockedTaskRect, mDockedInsetRect,
mOtherTaskRect, mOtherInsetRect);