From 0c6c558f89d489a0aaa6c0dcfaa49487bf5cf213 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Wed, 25 Aug 2021 11:30:38 +0800 Subject: [PATCH] Fix black screen when drag divider to bottom This issue is caused when divider position is near bottom, The bounds hight is less than 0 due to our algorithm, if we do setWindowCrop by this bounds, the surface bounds status abnormal which show in winscope is full screen. This situation make dim layer show full screen. Whether this is Surface bug or not, it can protect it split side. Fix it by make sure both split bounds width or height are always larger than 0. Fix: 197588020 Test: Active stage split, drag divider to bottom then check Change-Id: I4bcd9ba353432bf852ad4a60b6ca9234c2cd84f1 --- .../src/com/android/wm/shell/common/split/SplitLayout.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java index 3b9bcd36bea85..057fc95e62e89 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java @@ -50,6 +50,7 @@ import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.policy.DividerSnapAlgorithm; +import com.android.internal.policy.DockedDividerUtils; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.animation.Interpolators; import com.android.wm.shell.common.DisplayImeController; @@ -236,6 +237,8 @@ public final class SplitLayout { mBounds1.bottom = position; mBounds2.top = mBounds1.bottom + mDividerSize; } + DockedDividerUtils.sanitizeStackBounds(mBounds1, true /** topLeft */); + DockedDividerUtils.sanitizeStackBounds(mBounds2, false /** topLeft */); mDismissingParallaxPolicy.applyDividerPosition(position, isLandscape); }