summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Naresh Kumar Podishetty (xWF) <podishettyk@google.com> 2025-02-04 23:00:42 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-02-04 23:00:42 -0800
commit413c79b34679a7cdf91710ac927338db09c1295f (patch)
tree5c1e3aff48d50d6490a031d2336c4bf952d7dcba
parent62121fc927b88525da576ce5b696433b2e6e1703 (diff)
parent6e5dc9561204874c80b9f650176e2a9f4a730b7b (diff)
Merge "Revert "[Notif redesign] Increase the NSSL's bottom margin"" into main
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt7
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt17
-rw-r--r--packages/SystemUI/res/layout/notification_stack_scroll_layout.xml1
-rw-r--r--packages/SystemUI/res/values/dimens.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractor.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt17
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt17
11 files changed, 8 insertions, 85 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
index 7659fb42fba7..01ba4df3a314 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
@@ -6,7 +6,6 @@ import android.platform.test.flag.junit.FlagsParameterization
import android.widget.FrameLayout
import androidx.test.filters.SmallTest
import com.android.keyguard.BouncerPanelExpansionCalculator.aboutToShowBouncerProgress
-import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.animation.ShadeInterpolation.getContentAlpha
import com.android.systemui.dump.DumpManager
@@ -479,11 +478,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() {
stackScrollAlgorithm.resetViewStates(ambientState, /* speedBumpIndex= */ 0)
val marginBottom =
- context.resources.getDimensionPixelSize(
- if (Flags.notificationsRedesignFooterView())
- R.dimen.notification_2025_panel_margin_bottom
- else R.dimen.notification_panel_margin_bottom
- )
+ context.resources.getDimensionPixelSize(R.dimen.notification_panel_margin_bottom)
val fullHeight = ambientState.layoutMaxHeight + marginBottom - ambientState.stackY
val centeredY = ambientState.stackY + fullHeight / 2f - emptyShadeView.height / 2f
assertThat(emptyShadeView.viewState.yTranslation).isEqualTo(centeredY)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
index af00e2a1a639..21297e3e64b7 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
@@ -17,12 +17,9 @@
package com.android.systemui.statusbar.notification.stack.ui.viewmodel
-import android.platform.test.annotations.DisableFlags
-import android.platform.test.annotations.EnableFlags
import android.platform.test.flag.junit.FlagsParameterization
import androidx.test.filters.SmallTest
import com.android.compose.animation.scene.ObservableTransitionState
-import com.android.systemui.Flags.FLAG_NOTIFICATIONS_REDESIGN_FOOTER_VIEW
import com.android.systemui.SysuiTestCase
import com.android.systemui.bouncer.data.repository.keyguardBouncerRepository
import com.android.systemui.common.shared.model.NotificationContainerBounds
@@ -298,7 +295,6 @@ class SharedNotificationContainerViewModelTest(flags: FlagsParameterization) : S
}
@Test
- @DisableFlags(FLAG_NOTIFICATIONS_REDESIGN_FOOTER_VIEW)
fun validateMarginBottom() =
testScope.runTest {
overrideResource(R.dimen.notification_panel_margin_bottom, 50)
@@ -311,19 +307,6 @@ class SharedNotificationContainerViewModelTest(flags: FlagsParameterization) : S
}
@Test
- @EnableFlags(FLAG_NOTIFICATIONS_REDESIGN_FOOTER_VIEW)
- fun validateMarginBottom_footerRedesign() =
- testScope.runTest {
- overrideResource(R.dimen.notification_2025_panel_margin_bottom, 50)
-
- val dimens by collectLastValue(underTest.configurationBasedDimensions)
-
- configurationRepository.onAnyConfigurationChange()
-
- assertThat(dimens!!.marginBottom).isEqualTo(50)
- }
-
- @Test
@DisableSceneContainer
fun validateMarginTopWithLargeScreenHeader_usesHelper() =
testScope.runTest {
diff --git a/packages/SystemUI/res/layout/notification_stack_scroll_layout.xml b/packages/SystemUI/res/layout/notification_stack_scroll_layout.xml
index 5954de4012c8..65cf81ea416b 100644
--- a/packages/SystemUI/res/layout/notification_stack_scroll_layout.xml
+++ b/packages/SystemUI/res/layout/notification_stack_scroll_layout.xml
@@ -16,7 +16,6 @@
-->
<!-- This XML is served to be overridden by other OEMs/device types. -->
-<!-- Note: The margins may be overridden in code, see NotificationStackScrollLayout#getBottomMargin -->
<com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res-auto"
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index c9c4f8cc56e0..fcd3a51d5bb3 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -574,8 +574,6 @@
<dimen name="notification_panel_margin_bottom">32dp</dimen>
- <dimen name="notification_2025_panel_margin_bottom">64dp</dimen>
-
<!-- The bottom padding of the panel that holds the list of notifications. -->
<dimen name="notification_panel_padding_bottom">0dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt b/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt
index 5b44c082bd72..cf310dd32613 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt
@@ -39,7 +39,6 @@ import com.android.systemui.recents.LauncherProxyService.LauncherProxyListener
import com.android.systemui.res.R
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shared.system.QuickStepContract
-import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.statusbar.policy.SplitShadeStateController
import com.android.systemui.util.LargeScreenUtils
@@ -156,7 +155,8 @@ constructor(
val splitShadeEnabledChanged = newSplitShadeEnabled != splitShadeEnabled
splitShadeEnabled = newSplitShadeEnabled
largeScreenShadeHeaderActive = LargeScreenUtils.shouldUseLargeScreenShadeHeader(resources)
- notificationsBottomMargin = NotificationStackScrollLayout.getBottomMargin(context)
+ notificationsBottomMargin =
+ resources.getDimensionPixelSize(R.dimen.notification_panel_margin_bottom)
largeScreenShadeHeaderHeight = calculateLargeShadeHeaderHeight()
shadeHeaderHeight = calculateShadeHeaderHeight()
panelMarginHorizontal =
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index d6b34b068cc5..42d02e10ab8d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -26,7 +26,6 @@ import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_
import static com.android.internal.jank.InteractionJankMonitor.CUJ_SHADE_CLEAR_ALL;
import static com.android.systemui.Flags.magneticNotificationSwipes;
import static com.android.systemui.Flags.notificationOverExpansionClippingFix;
-import static com.android.systemui.Flags.notificationsRedesignFooterView;
import static com.android.systemui.statusbar.notification.stack.NotificationPriorityBucketKt.BUCKET_SILENT;
import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_SWIPE;
import static com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent.SCROLL_DOWN;
@@ -695,28 +694,11 @@ public class NotificationStackScrollLayout
protected void onFinishInflate() {
super.onFinishInflate();
- if (notificationsRedesignFooterView()) {
- int bottomMargin = getBottomMargin(getContext());
- MarginLayoutParams lp = (MarginLayoutParams) getLayoutParams();
- lp.setMargins(lp.leftMargin, lp.topMargin, lp.rightMargin, bottomMargin);
- setLayoutParams(lp);
- }
-
if (!ModesEmptyShadeFix.isEnabled()) {
inflateEmptyShadeView();
}
}
- /** Get the pixel value of the bottom margin, taking flags into account. */
- public static int getBottomMargin(Context context) {
- Resources res = context.getResources();
- if (notificationsRedesignFooterView()) {
- return res.getDimensionPixelSize(R.dimen.notification_2025_panel_margin_bottom);
- } else {
- return res.getDimensionPixelSize(R.dimen.notification_panel_margin_bottom);
- }
- }
-
/**
* Sets whether keyguard bypass is enabled. If true, this layout will be rendered in bypass
* mode when it is on the keyguard.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
index 673eb9f85ec3..06b989aaab57 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
@@ -107,7 +107,7 @@ public class StackScrollAlgorithm {
mGapHeightOnLockscreen = res.getDimensionPixelSize(
R.dimen.notification_section_divider_height_lockscreen);
mNotificationScrimPadding = res.getDimensionPixelSize(R.dimen.notification_side_paddings);
- mMarginBottom = NotificationStackScrollLayout.getBottomMargin(context);
+ mMarginBottom = res.getDimensionPixelSize(R.dimen.notification_panel_margin_bottom);
mQuickQsOffsetHeight = SystemBarUtils.getQuickQsOffsetHeight(context);
mSmallCornerRadius = res.getDimension(R.dimen.notification_corner_radius_small);
mLargeCornerRadius = res.getDimension(R.dimen.notification_corner_radius);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractor.kt
index c8b3341a0240..107875df6bfa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractor.kt
@@ -26,7 +26,6 @@ import com.android.systemui.res.R
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.LargeScreenHeaderHelper
import com.android.systemui.shade.ShadeDisplayAware
-import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
import com.android.systemui.statusbar.policy.SplitShadeStateController
import dagger.Lazy
import javax.inject.Inject
@@ -80,7 +79,8 @@ constructor(
getBoolean(R.bool.config_use_large_screen_shade_header),
marginHorizontal =
getDimensionPixelSize(R.dimen.notification_panel_margin_horizontal),
- marginBottom = NotificationStackScrollLayout.getBottomMargin(context),
+ marginBottom =
+ getDimensionPixelSize(R.dimen.notification_panel_margin_bottom),
marginTop = getDimensionPixelSize(R.dimen.notification_panel_margin_top),
marginTopLargeScreen =
largeScreenHeaderHelperLazy.get().getLargeScreenHeaderHeight(),
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
index 1abf8ab2cadc..75e89a676d19 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
@@ -81,7 +81,6 @@ import com.android.systemui.shade.shared.model.ShadeMode.Dual
import com.android.systemui.shade.shared.model.ShadeMode.Single
import com.android.systemui.shade.shared.model.ShadeMode.Split
import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationInteractor
-import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
import com.android.systemui.statusbar.notification.stack.domain.interactor.NotificationStackAppearanceInteractor
import com.android.systemui.statusbar.notification.stack.domain.interactor.SharedNotificationContainerInteractor
import com.android.systemui.unfold.domain.interactor.UnfoldTransitionInteractor
@@ -268,7 +267,8 @@ constructor(
horizontalPosition = horizontalPosition,
marginStart = if (shadeMode is Split) 0 else marginHorizontal,
marginEnd = marginHorizontal,
- marginBottom = NotificationStackScrollLayout.getBottomMargin(context),
+ marginBottom =
+ getDimensionPixelSize(R.dimen.notification_panel_margin_bottom),
// y position of the NSSL in the window needs to be 0 under scene
// container
marginTop = 0,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt
index 3de7db76deae..9abe9aa5e598 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt
@@ -16,8 +16,6 @@
package com.android.systemui.shade
-import android.platform.test.annotations.DisableFlags
-import android.platform.test.annotations.EnableFlags
import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.view.View
@@ -28,7 +26,6 @@ import androidx.annotation.IdRes
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
import androidx.test.filters.SmallTest
-import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.fragments.FragmentHostManager
import com.android.systemui.fragments.FragmentService
@@ -125,7 +122,6 @@ class NotificationsQSContainerControllerLegacyTest : SysuiTestCase() {
overrideResource(R.dimen.split_shade_notifications_scrim_margin_bottom, SCRIM_MARGIN)
overrideResource(R.dimen.notification_panel_margin_bottom, NOTIFICATIONS_MARGIN)
- overrideResource(R.dimen.notification_2025_panel_margin_bottom, NOTIFICATIONS_MARGIN)
overrideResource(R.bool.config_use_split_notification_shade, false)
overrideResource(R.dimen.qs_footer_actions_bottom_padding, FOOTER_ACTIONS_PADDING)
overrideResource(R.dimen.qs_footer_action_inset, FOOTER_ACTIONS_INSET)
@@ -364,7 +360,6 @@ class NotificationsQSContainerControllerLegacyTest : SysuiTestCase() {
}
@Test
- @DisableFlags(Flags.FLAG_NOTIFICATIONS_REDESIGN_FOOTER_VIEW)
fun testNotificationsMarginBottomIsUpdated() {
Mockito.clearInvocations(view)
enableSplitShade()
@@ -376,18 +371,6 @@ class NotificationsQSContainerControllerLegacyTest : SysuiTestCase() {
}
@Test
- @EnableFlags(Flags.FLAG_NOTIFICATIONS_REDESIGN_FOOTER_VIEW)
- fun testNotificationsMarginBottomIsUpdated_footerRedesign() {
- Mockito.clearInvocations(view)
- enableSplitShade()
- verify(view).setNotificationsMarginBottom(NOTIFICATIONS_MARGIN)
-
- overrideResource(R.dimen.notification_2025_panel_margin_bottom, 100)
- disableSplitShade()
- verify(view).setNotificationsMarginBottom(100)
- }
-
- @Test
fun testSplitShadeLayout_qsFrameHasHorizontalMarginsOfZero() {
enableSplitShade()
underTest.updateResources()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt
index 552fe8d5bc55..4c12cc886e33 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt
@@ -16,8 +16,6 @@
package com.android.systemui.shade
-import android.platform.test.annotations.DisableFlags
-import android.platform.test.annotations.EnableFlags
import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.view.View
@@ -28,7 +26,6 @@ import androidx.annotation.IdRes
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
import androidx.test.filters.SmallTest
-import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.fragments.FragmentHostManager
import com.android.systemui.fragments.FragmentService
@@ -125,7 +122,6 @@ class NotificationsQSContainerControllerTest : SysuiTestCase() {
overrideResource(R.dimen.split_shade_notifications_scrim_margin_bottom, SCRIM_MARGIN)
overrideResource(R.dimen.notification_panel_margin_bottom, NOTIFICATIONS_MARGIN)
- overrideResource(R.dimen.notification_2025_panel_margin_bottom, NOTIFICATIONS_MARGIN)
overrideResource(R.bool.config_use_split_notification_shade, false)
overrideResource(R.dimen.qs_footer_actions_bottom_padding, FOOTER_ACTIONS_PADDING)
overrideResource(R.dimen.qs_footer_action_inset, FOOTER_ACTIONS_INSET)
@@ -362,7 +358,6 @@ class NotificationsQSContainerControllerTest : SysuiTestCase() {
}
@Test
- @DisableFlags(Flags.FLAG_NOTIFICATIONS_REDESIGN_FOOTER_VIEW)
fun testNotificationsMarginBottomIsUpdated() {
Mockito.clearInvocations(view)
enableSplitShade()
@@ -374,18 +369,6 @@ class NotificationsQSContainerControllerTest : SysuiTestCase() {
}
@Test
- @EnableFlags(Flags.FLAG_NOTIFICATIONS_REDESIGN_FOOTER_VIEW)
- fun testNotificationsMarginBottomIsUpdated_footerRedesign() {
- Mockito.clearInvocations(view)
- enableSplitShade()
- verify(view).setNotificationsMarginBottom(NOTIFICATIONS_MARGIN)
-
- overrideResource(R.dimen.notification_2025_panel_margin_bottom, 100)
- disableSplitShade()
- verify(view).setNotificationsMarginBottom(100)
- }
-
- @Test
fun testSplitShadeLayout_isAlignedToGuideline() {
enableSplitShade()
underTest.updateResources()