From e46e12c0f6c3028889fe9fb05a373a2124021234 Mon Sep 17 00:00:00 2001 From: Saumya Prakash Date: Tue, 20 Feb 2024 22:50:31 +0000 Subject: [PATCH] Ensure taskbar insets for camera cutout only apply on the needed sides For devices with a camera cutout, we only need the increased inset to accomodate a camera cutout on the sides/orientations where the cutout interrupts the taskbar. This change ensures that the insets are only added when necessary. Fix: 325508089 Test: Open an app and ensure the insets remain unchanged for 0 and 90 degree rotations. Ensure the insets for 180 and 270 degrees are still covering the camera cutout. Flag: N/A (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ad5e4c795624955ae2d4a984b93cf7ae900e28aa) Merged-In: Iba766b8a19ddce37d9ca20afb0219d679ce36ace Change-Id: Iba766b8a19ddce37d9ca20afb0219d679ce36ace --- .../android/launcher3/taskbar/TaskbarActivityContext.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 87662e6c1a..c54330765e 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -944,10 +944,14 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } if (landscapePhoneButtonNav) { mWindowLayoutParams.width = size; - mWindowLayoutParams.paramsForRotation[getDisplay().getRotation()].width = size; + for (int rot = Surface.ROTATION_0; rot <= Surface.ROTATION_270; rot++) { + mWindowLayoutParams.paramsForRotation[rot].width = size; + } } else { mWindowLayoutParams.height = size; - mWindowLayoutParams.paramsForRotation[getDisplay().getRotation()].height = size; + for (int rot = Surface.ROTATION_0; rot <= Surface.ROTATION_270; rot++) { + mWindowLayoutParams.paramsForRotation[rot].height = size; + } } mControllers.taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged(); notifyUpdateLayoutParams();