From d3c7eed166fbe9a03e3fafcfac685e7d70ea6c33 Mon Sep 17 00:00:00 2001 From: mpodolian Date: Wed, 9 Apr 2025 17:35:50 -0700 Subject: [PATCH] Maximised the taskbar window to the default size TaskbarViewController set window height to the too low value, so bubble bar was not visible in 3 - buttons navigation mode on foldable device. Fixes: 407708503 Test: Manual. Use foldable device, set navigation mode to the 3 buttons. Fold the device and trigger bubble. Lock screen. Unfold. Unlock screen. The bubble remains visible. Flag: EXEMPT bugfix Change-Id: I516eab4121c39fc2bec5e49cc3c9b0ad8e640f8b --- .../taskbar/TaskbarActivityContext.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index ba1ce18893..40c54cc15a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -1295,20 +1295,22 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } /** - * Updates the TaskbarContainer size (pass {@link #getDefaultTaskbarWindowSize()} to reset). + * Updates the TaskbarContainer size, using the maximum of the provided {@code size} + * and the default size from {@link #getDefaultTaskbarWindowSize()}. */ public void setTaskbarWindowSize(int size) { // In landscape phone button nav mode, we should set the task bar width instead of height // because this is the only case in which the nav bar is not on the display bottom. + int windowSize = Math.max(size, getDefaultTaskbarWindowSize()); boolean landscapePhoneButtonNav = isPhoneButtonNavMode() && mDeviceProfile.isLandscape; if ((landscapePhoneButtonNav ? mWindowLayoutParams.width : mWindowLayoutParams.height) - == size || mIsDestroyed) { + == windowSize || mIsDestroyed) { return; } - if (size == MATCH_PARENT) { - size = mDeviceProfile.heightPx; + if (windowSize == MATCH_PARENT) { + windowSize = mDeviceProfile.heightPx; } else { - mLastRequestedNonFullscreenSize = size; + mLastRequestedNonFullscreenSize = windowSize; if (mIsFullscreen || mIsTaskbarSizeFrozenForAnimatingBubble) { // We either still need to be fullscreen or a bubble is still animating, so defer // any change to our height until setTaskbarWindowFullscreen(false) is called or @@ -1320,14 +1322,14 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } } if (landscapePhoneButtonNav) { - mWindowLayoutParams.width = size; + mWindowLayoutParams.width = windowSize; for (int rot = Surface.ROTATION_0; rot <= Surface.ROTATION_270; rot++) { - mWindowLayoutParams.paramsForRotation[rot].width = size; + mWindowLayoutParams.paramsForRotation[rot].width = windowSize; } } else { - mWindowLayoutParams.height = size; + mWindowLayoutParams.height = windowSize; for (int rot = Surface.ROTATION_0; rot <= Surface.ROTATION_270; rot++) { - mWindowLayoutParams.paramsForRotation[rot].height = size; + mWindowLayoutParams.paramsForRotation[rot].height = windowSize; } } mControllers.runAfterInit(