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 e4161a37e52e8..7764d33856ca8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQSContainerController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQSContainerController.kt @@ -234,7 +234,7 @@ class NotificationsQSContainerController @Inject constructor( val endConstraintId = if (splitShadeEnabled) R.id.qs_edge_guideline else PARENT_ID constraintSet.apply { connect(R.id.qs_frame, END, endConstraintId, END) - setMargin(R.id.qs_frame, START, panelMarginHorizontal) + setMargin(R.id.qs_frame, START, if (splitShadeEnabled) 0 else panelMarginHorizontal) setMargin(R.id.qs_frame, END, if (splitShadeEnabled) 0 else panelMarginHorizontal) setMargin(R.id.qs_frame, TOP, topMargin) } 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 9e64f017d88ea..83eabb6679979 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 @@ -456,6 +456,26 @@ class NotificationQSContainerControllerTest : SysuiTestCase() { .isEqualTo(0) } + @Test + fun testSplitShadeLayout_qsFrameHasHorizontalMarginsOfZero() { + enableSplitShade() + controller.updateResources() + assertThat(getConstraintSetLayout(R.id.qs_frame).endMargin).isEqualTo(0) + assertThat(getConstraintSetLayout(R.id.qs_frame).startMargin).isEqualTo(0) + } + + @Test + fun testSinglePaneShadeLayout_qsFrameHasHorizontalMarginsSetToCorrectValue() { + disableSplitShade() + controller.updateResources() + val notificationPanelMarginHorizontal = context.resources + .getDimensionPixelSize(R.dimen.notification_panel_margin_horizontal) + assertThat(getConstraintSetLayout(R.id.qs_frame).endMargin) + .isEqualTo(notificationPanelMarginHorizontal) + assertThat(getConstraintSetLayout(R.id.qs_frame).startMargin) + .isEqualTo(notificationPanelMarginHorizontal) + } + @Test fun testSinglePaneShadeLayout_isAlignedToParent() { disableSplitShade()