From d5f15e2e354df2a900cdf46ee559983138f0d0f7 Mon Sep 17 00:00:00 2001 From: Oleg Blinnikov Date: Wed, 15 Feb 2023 11:51:01 +0000 Subject: [PATCH] Allow to move SCM Letterbox with Taskbar visible Currently SCM reduces height of the letterbox by the height of Taskbar, due to this letterboxuicontroller believes that the application does not take the full height of the screen. This CL fixes this issue by using getAppBounds() instead getBounds() to query the height of the available space on the screen. Change-Id: I152b588bc5f3673e0e2aa6e0a43d5e40ad234560 Test: atest SizeCompatTests , also manual: SCM letterbox can be moved horizontally Bug: 269030028 --- .../java/com/android/server/wm/LetterboxUiController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/LetterboxUiController.java b/services/core/java/com/android/server/wm/LetterboxUiController.java index cbc36c3a8675f..8df095c8953dd 100644 --- a/services/core/java/com/android/server/wm/LetterboxUiController.java +++ b/services/core/java/com/android/server/wm/LetterboxUiController.java @@ -962,8 +962,8 @@ final class LetterboxUiController { && (parentConfiguration.orientation == ORIENTATION_LANDSCAPE && mActivityRecord.getOrientationForReachability() == ORIENTATION_PORTRAIT) // Check whether the activity fills the parent vertically. - && parentConfiguration.windowConfiguration.getBounds().height() - == mActivityRecord.getBounds().height(); + && parentConfiguration.windowConfiguration.getAppBounds().height() + <= mActivityRecord.getBounds().height(); } @VisibleForTesting