From 1b0aa65a303f83723b605b71c47eb31907e57197 Mon Sep 17 00:00:00 2001 From: Julia Tuttle Date: Thu, 9 Jun 2022 19:48:17 -0400 Subject: [PATCH] Fix NSSL bottom margin with 3-button nav and no split shade It looks like some of the margin calculation logic in NotificationsQSContainerController.calculateBottomSpacing got mangled when we added split shade, so make sure there's enough space to swipe the whole shade up even with 3-button nav and no split shade. Bug: 222594381 Test: manual, on Pixel 5a Change-Id: Id83298f7412d087b4b8a6211587b4ec32710315b --- .../statusbar/phone/NotificationsQSContainerController.kt | 1 + .../statusbar/phone/NotificationQSContainerControllerTest.kt | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQSContainerController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQSContainerController.kt index 1206d0540fd2e..ebedbf987aa20 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQSContainerController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQSContainerController.kt @@ -200,6 +200,7 @@ class NotificationsQSContainerController @Inject constructor( containerPadding = bottomStableInsets } else { containerPadding = 0 + stackScrollMargin = bottomStableInsets + notificationsBottomMargin } } val qsContainerPadding = if (!(isQSCustomizing || isQSDetailShowing)) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationQSContainerControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationQSContainerControllerTest.kt index 003245298fa93..de40b7fd0a136 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationQSContainerControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationQSContainerControllerTest.kt @@ -206,7 +206,9 @@ class NotificationQSContainerControllerTest : SysuiTestCase() { given(taskbarVisible = false, navigationMode = BUTTONS_NAVIGATION, insets = windowInsets().withStableBottom()) - then(expectedContainerPadding = 0, expectedQsPadding = STABLE_INSET_BOTTOM) + then(expectedContainerPadding = 0, + expectedNotificationsMargin = STABLE_INSET_BOTTOM + NOTIFICATIONS_MARGIN, + expectedQsPadding = STABLE_INSET_BOTTOM) } @Test