diff --git a/core/java/com/android/internal/policy/DockedDividerUtils.java b/core/java/com/android/internal/policy/DockedDividerUtils.java index f7f5f15cc6065..00c65bd13e509 100644 --- a/core/java/com/android/internal/policy/DockedDividerUtils.java +++ b/core/java/com/android/internal/policy/DockedDividerUtils.java @@ -48,17 +48,21 @@ public class DockedDividerUtils { outRect.top = position + dividerSize; break; } - if (outRect.left >= outRect.right) { - outRect.left = outRect.right - 1; + sanitizeStackBounds(outRect); + } + + public static void sanitizeStackBounds(Rect bounds) { + if (bounds.left >= bounds.right) { + bounds.left = bounds.right - 1; } - if (outRect.top >= outRect.bottom) { - outRect.top = outRect.bottom - 1; + if (bounds.top >= bounds.bottom) { + bounds.top = bounds.bottom - 1; } - if (outRect.right <= outRect.left) { - outRect.right = outRect.left + 1; + if (bounds.right <= bounds.left) { + bounds.right = bounds.left + 1; } - if (outRect.bottom <= outRect.top) { - outRect.bottom = outRect.top + 1; + if (bounds.bottom <= bounds.top) { + bounds.bottom = bounds.top + 1; } } diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index 2833b35c5c9c2..f02e49e21977e 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -587,6 +587,7 @@ public class TaskStack implements DimLayer.DimLayerUser { outBounds.top = dockedBounds.bottom + dockDividerWidth; } } + DockedDividerUtils.sanitizeStackBounds(outBounds); } /** Resizes all non-docked stacks in the system to either fullscreen or the appropriate size