diff options
author | 2025-03-21 06:53:19 -0700 | |
---|---|---|
committer | 2025-03-21 06:53:19 -0700 | |
commit | 5039839f2a6a7a867bf300926521b6bb8ccd0fb6 (patch) | |
tree | 11d3d158b3b2d3df5053493bd86cfb7ab75b6eab | |
parent | e560309896965555e59cc219cff157e290eaf179 (diff) |
[RONs] Delete two redundant static flag wrappers
- PromotedNotificationUiForceExpanded
- PromotedNotificationUiAod
These wrappers already pointed to the same flag as PromotedNotificationUi, so this just removes the redundant flag guarding and test annotations.
Test: presubmit
Flag: android.app.ui_rich_ongoing
Bug: 367705002
Change-Id: I76ab4afba4defff988d974b6dc2528c10c1f299a
14 files changed, 35 insertions, 173 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt index d903c3d16fdb..748c3b89649a 100644 --- a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt +++ b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt @@ -53,7 +53,7 @@ import com.android.systemui.statusbar.notification.icon.ui.viewbinder.Notificati import com.android.systemui.statusbar.notification.icon.ui.viewbinder.StatusBarIconViewBindingFailureTracker import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerAlwaysOnDisplayViewModel import com.android.systemui.statusbar.notification.promoted.AODPromotedNotification -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiAod +import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi import com.android.systemui.statusbar.notification.promoted.ui.viewmodel.AODPromotedNotificationViewModel import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView @@ -111,7 +111,7 @@ constructor( @Composable fun AodPromotedNotificationArea(modifier: Modifier = Modifier) { - if (!PromotedNotificationUiAod.isEnabled) { + if (!PromotedNotificationUi.isEnabled) { return } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt index f7bbf989ad3f..e03dbf54e101 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt @@ -32,7 +32,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController import com.android.systemui.statusbar.notification.collection.EntryAdapter import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.domain.interactor.SeenNotificationsInteractor -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiForceExpanded +import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableView import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController @@ -155,7 +155,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { } @Test - @EnableFlags(PromotedNotificationUiForceExpanded.FLAG_NAME) + @EnableFlags(PromotedNotificationUi.FLAG_NAME) fun maxKeyguardNotificationsForPromotedOngoing_onLockscreenSpaceForMinHeightButNotIntrinsicHeight_returnsOne() { setGapHeight(0f) // No divider height since we're testing one element where index = 0 @@ -283,7 +283,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { } @Test - @EnableFlags(PromotedNotificationUiForceExpanded.FLAG_NAME) + @EnableFlags(PromotedNotificationUi.FLAG_NAME) fun getSpaceNeeded_onLockscreenEnoughSpacePromotedOngoing_intrinsicHeight() { setGapHeight(0f) // No divider height since we're testing one element where index = 0 @@ -342,7 +342,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { } @Test - @EnableFlags(PromotedNotificationUiForceExpanded.FLAG_NAME) + @EnableFlags(PromotedNotificationUi.FLAG_NAME) fun getSpaceNeeded_onLockscreenSavingSpacePromotedOngoing_minHeight() { setGapHeight(0f) // No divider height since we're testing one element where index = 0 diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardClockInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardClockInteractor.kt index 02e04aa279d8..21b28a24213f 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardClockInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardClockInteractor.kt @@ -35,7 +35,7 @@ import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.shade.domain.interactor.ShadeModeInteractor import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationInteractor -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiAod +import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi import com.android.systemui.statusbar.notification.promoted.domain.interactor.AODPromotedNotificationInteractor import com.android.systemui.util.kotlin.combine import com.android.systemui.utils.coroutines.flow.flatMapLatestConflated @@ -90,14 +90,14 @@ constructor( var clock: ClockController? by keyguardClockRepository.clockEventController::clock private val isAodPromotedNotificationPresent: Flow<Boolean> = - if (PromotedNotificationUiAod.isEnabled) { + if (PromotedNotificationUi.isEnabled) { aodPromotedNotificationInteractor.isPresent } else { flowOf(false) } private val areAnyNotificationsPresent: Flow<Boolean> = - if (PromotedNotificationUiAod.isEnabled) { + if (PromotedNotificationUi.isEnabled) { combine( activeNotificationsInteractor.areAnyNotificationsPresent, isAodPromotedNotificationPresent, diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt index f717431f6a40..bca0bedc7350 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt @@ -39,7 +39,7 @@ import com.android.systemui.statusbar.notification.icon.ui.viewbinder.AlwaysOnDi import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerViewBinder import com.android.systemui.statusbar.notification.icon.ui.viewbinder.StatusBarIconViewBindingFailureTracker import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerAlwaysOnDisplayViewModel -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiAod +import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi import com.android.systemui.statusbar.phone.NotificationIconContainer import com.android.systemui.statusbar.ui.SystemBarUtilsState import com.android.systemui.util.ui.value @@ -102,7 +102,7 @@ constructor( val isShadeLayoutWide = shadeModeInteractor.isShadeLayoutWide.value constraintSet.apply { - if (PromotedNotificationUiAod.isEnabled) { + if (PromotedNotificationUi.isEnabled) { connect(nicId, TOP, AodPromotedNotificationSection.viewId, BOTTOM, bottomMargin) } else { connect(nicId, TOP, R.id.smart_space_barrier_bottom, BOTTOM, bottomMargin) @@ -111,7 +111,7 @@ constructor( setGoneMargin(nicId, BOTTOM, bottomMargin) setVisibility(nicId, if (isVisible.value) VISIBLE else GONE) - if (PromotedNotificationUiAod.isEnabled && isShadeLayoutWide) { + if (PromotedNotificationUi.isEnabled && isShadeLayoutWide) { // Don't create a start constraint, so the icons can hopefully right-align. } else { connect(nicId, START, PARENT_ID, START, horizontalMargin) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodPromotedNotificationSection.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodPromotedNotificationSection.kt index efdc5abf1f67..f75b53017500 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodPromotedNotificationSection.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodPromotedNotificationSection.kt @@ -31,7 +31,7 @@ import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.shade.domain.interactor.ShadeModeInteractor import com.android.systemui.statusbar.notification.promoted.AODPromotedNotification import com.android.systemui.statusbar.notification.promoted.PromotedNotificationLogger -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiAod +import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi import com.android.systemui.statusbar.notification.promoted.ui.viewmodel.AODPromotedNotificationViewModel import javax.inject.Inject @@ -50,7 +50,7 @@ constructor( } override fun addViews(constraintLayout: ConstraintLayout) { - if (!PromotedNotificationUiAod.isEnabled) { + if (!PromotedNotificationUi.isEnabled) { return } @@ -67,7 +67,7 @@ constructor( } override fun bindData(constraintLayout: ConstraintLayout) { - if (!PromotedNotificationUiAod.isEnabled) { + if (!PromotedNotificationUi.isEnabled) { return } @@ -79,7 +79,7 @@ constructor( } override fun applyConstraints(constraintSet: ConstraintSet) { - if (!PromotedNotificationUiAod.isEnabled) { + if (!PromotedNotificationUi.isEnabled) { return } @@ -119,7 +119,7 @@ constructor( } override fun removeViews(constraintLayout: ConstraintLayout) { - if (!PromotedNotificationUiAod.isEnabled) { + if (!PromotedNotificationUi.isEnabled) { return } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt index 9282e166f605..3d55feb0023b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt @@ -81,7 +81,7 @@ fun AODPromotedNotification( viewModelFactory: AODPromotedNotificationViewModel.Factory, modifier: Modifier = Modifier, ) { - if (!PromotedNotificationUiAod.isEnabled) { + if (!PromotedNotificationUi.isEnabled) { return } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/PromotedNotificationUiAod.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/PromotedNotificationUiAod.kt deleted file mode 100644 index 69e27dcc2e6c..000000000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/PromotedNotificationUiAod.kt +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2025 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.statusbar.notification.promoted - -import android.app.Flags -import com.android.systemui.flags.FlagToken -import com.android.systemui.flags.RefactorFlagUtils - -// NOTE: We're merging this flag with the `ui_rich_ongoing` flag. -// We'll replace all usages of this class with PromotedNotificationUi as a follow-up. - -/** Helper for reading or using the promoted ongoing notifications AOD flag state. */ -object PromotedNotificationUiAod { - /** The aconfig flag name */ - const val FLAG_NAME = Flags.FLAG_UI_RICH_ONGOING - - /** A token used for dependency declaration */ - val token: FlagToken - get() = FlagToken(FLAG_NAME, isEnabled) - - /** Is the refactor enabled */ - @JvmStatic - inline val isEnabled - get() = Flags.uiRichOngoing() - - /** - * Called to ensure code is only run when the flag is enabled. This protects users from the - * unintended behaviors caused by accidentally running new logic, while also crashing on an eng - * build to ensure that the refactor author catches issues in testing. - */ - @JvmStatic - inline fun isUnexpectedlyInLegacyMode() = - RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME) - - /** - * Called to ensure code is only run when the flag is disabled. This will throw an exception if - * the flag is not enabled to ensure that the refactor author catches issues in testing. - * Caution!! Using this check incorrectly will cause crashes in nextfood builds! - */ - @JvmStatic - @Deprecated("Avoid crashing.", ReplaceWith("if (this.isUnexpectedlyInLegacyMode()) return")) - inline fun unsafeAssertInNewMode() = - RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, FLAG_NAME) - - /** - * Called to ensure code is only run when the flag is disabled. This will throw an exception if - * the flag is enabled to ensure that the refactor author catches issues in testing. - */ - @JvmStatic - inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME) -} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/PromotedNotificationUiForceExpanded.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/PromotedNotificationUiForceExpanded.kt deleted file mode 100644 index 5c0991059dec..000000000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/PromotedNotificationUiForceExpanded.kt +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.statusbar.notification.promoted - -import android.app.Flags -import com.android.systemui.flags.FlagToken -import com.android.systemui.flags.RefactorFlagUtils - -// NOTE: We're merging this flag with the `ui_rich_ongoing` flag. -// We'll replace all usages of this class with PromotedNotificationUi as a follow-up. - -/** Helper for reading or using the expanded ui rich ongoing flag state. */ -@Suppress("NOTHING_TO_INLINE") -object PromotedNotificationUiForceExpanded { - /** The aconfig flag name */ - const val FLAG_NAME = Flags.FLAG_UI_RICH_ONGOING - - /** A token used for dependency declaration */ - val token: FlagToken - get() = FlagToken(FLAG_NAME, isEnabled) - - /** Is the refactor enabled */ - @JvmStatic - inline val isEnabled - get() = Flags.uiRichOngoing() - - /** - * Called to ensure code is only run when the flag is enabled. This protects users from the - * unintended behaviors caused by accidentally running new logic, while also crashing on an eng - * build to ensure that the refactor author catches issues in testing. - */ - @JvmStatic - inline fun isUnexpectedlyInLegacyMode() = - RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME) - - /** - * Called to ensure code is only run when the flag is enabled. This will throw an exception if - * the flag is not enabled to ensure that the refactor author catches issues in testing. - * Caution!! Using this check incorrectly will cause crashes in nextfood builds! - */ - @JvmStatic - @Deprecated("Avoid crashing.", ReplaceWith("if (this.isUnexpectedlyInLegacyMode()) return")) - inline fun unsafeAssertInNewMode() = - RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, FLAG_NAME) - - /** - * Called to ensure code is only run when the flag is disabled. This will throw an exception if - * the flag is enabled to ensure that the refactor author catches issues in testing. - */ - @JvmStatic - inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME) -} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 740391d7010e..3fed78674cf9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -128,7 +128,6 @@ import com.android.systemui.statusbar.notification.headsup.PinnedStatus; import com.android.systemui.statusbar.notification.logging.NotificationCounters; import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier; import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi; -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiForceExpanded; import com.android.systemui.statusbar.notification.row.shared.AsyncGroupHeaderViewInflation; import com.android.systemui.statusbar.notification.row.shared.LockscreenOtpRedaction; import com.android.systemui.statusbar.notification.row.ui.viewmodel.BundleHeaderViewModelImpl; @@ -882,7 +881,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView private void updateLimitsForView(NotificationContentView layout) { final int maxExpandedHeight; - if (PromotedNotificationUiForceExpanded.isEnabled() && isPromotedOngoing()) { + if (isPromotedOngoing()) { maxExpandedHeight = mMaxExpandedHeightForPromotedOngoing; } else { maxExpandedHeight = mMaxExpandedHeight; @@ -1381,7 +1380,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (mIsSummaryWithChildren) { return mChildrenContainer.getIntrinsicHeight(); } - if (PromotedNotificationUiForceExpanded.isEnabled() && isPromotedOngoing()) { + if (isPromotedOngoing()) { return getMaxExpandHeight(); } if (mExpandedWhenPinned) { @@ -3030,7 +3029,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (mIsSummaryWithChildren && !shouldShowPublic()) { return !mChildrenExpanded; } - if (PromotedNotificationUiForceExpanded.isEnabled() && isPromotedOngoing()) { + if (isPromotedOngoing()) { return false; } return mEnableNonGroupedNotificationExpand && mExpandable; @@ -3141,7 +3140,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } public void setUserLocked(boolean userLocked) { - if (PromotedNotificationUiForceExpanded.isEnabled() && isPromotedOngoing()) return; + if (isPromotedOngoing()) return; mUserLocked = userLocked; mPrivateLayout.setUserExpanding(userLocked); @@ -3411,7 +3410,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } public boolean isExpanded(boolean allowOnKeyguard) { - if (PromotedNotificationUiForceExpanded.isEnabled() && isPromotedOngoing()) { + if (isPromotedOngoing()) { return isPromotedNotificationExpanded(allowOnKeyguard); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowImageInflater.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowImageInflater.kt index 7bac17f4c227..215988471f00 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowImageInflater.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowImageInflater.kt @@ -21,7 +21,7 @@ import android.graphics.drawable.Drawable import android.graphics.drawable.Icon import androidx.annotation.VisibleForTesting import com.android.app.tracing.traceSection -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiAod +import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi import com.android.systemui.statusbar.notification.row.shared.IconData import com.android.systemui.statusbar.notification.row.shared.ImageModel import com.android.systemui.statusbar.notification.row.shared.ImageModelProvider @@ -80,7 +80,7 @@ interface RowImageInflater { companion object { @Suppress("NOTHING_TO_INLINE") @JvmStatic - inline fun featureFlagEnabled() = PromotedNotificationUiAod.isEnabled + inline fun featureFlagEnabled() = PromotedNotificationUi.isEnabled @JvmStatic fun newInstance(previousIndex: ImageModelIndex?, reinflating: Boolean): RowImageInflater = diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java index d5e2e7eb3a9c..c4fe25031de3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java @@ -50,7 +50,6 @@ import com.android.systemui.statusbar.TransformableView; import com.android.systemui.statusbar.ViewTransformationHelper; import com.android.systemui.statusbar.notification.ImageTransformState; import com.android.systemui.statusbar.notification.TransformState; -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiForceExpanded; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.HybridNotificationView; import com.android.systemui.statusbar.notification.shared.NotificationBundleUi; @@ -196,8 +195,7 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp } private void adjustTitleAndRightIconForPromotedOngoing() { - if (PromotedNotificationUiForceExpanded.isEnabled() && - mRow.isPromotedOngoing() && mRightIcon != null) { + if (mRow.isPromotedOngoing() && mRightIcon != null) { final int horizontalMargin; if (notificationsRedesignTemplates()) { horizontalMargin = mView.getResources().getDimensionPixelSize( diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt index e5071d9c1e53..58df1703a925 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt @@ -29,7 +29,6 @@ import com.android.systemui.statusbar.LockscreenShadeTransitionController import com.android.systemui.statusbar.StatusBarState.KEYGUARD import com.android.systemui.statusbar.SysuiStatusBarStateController import com.android.systemui.statusbar.notification.domain.interactor.SeenNotificationsInteractor -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiForceExpanded import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableView import com.android.systemui.statusbar.notification.shared.NotificationBundleUi @@ -476,9 +475,7 @@ constructor( if (onLockscreen) { if ( view is ExpandableNotificationRow && - (canPeek || - (PromotedNotificationUiForceExpanded.isEnabled && - view.isPromotedOngoing)) + (canPeek || view.isPromotedOngoing) ) { height } else { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java index eae23e70027b..e70ce53e74cb 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java @@ -83,7 +83,6 @@ import com.android.systemui.statusbar.notification.headsup.HeadsUpManager; import com.android.systemui.statusbar.notification.headsup.PinnedStatus; import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier; import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi; -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiForceExpanded; import com.android.systemui.statusbar.notification.row.ExpandableView.OnHeightChangedListener; import com.android.systemui.statusbar.notification.row.icon.NotificationIconStyleProvider; import com.android.systemui.statusbar.notification.row.wrapper.NotificationViewWrapper; @@ -948,7 +947,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { } @Test - @EnableFlags({PromotedNotificationUi.FLAG_NAME, PromotedNotificationUiForceExpanded.FLAG_NAME}) + @EnableFlags(PromotedNotificationUi.FLAG_NAME) @DisableFlags(NotificationBundleUi.FLAG_NAME) public void isExpanded_sensitivePromotedNotification_notExpanded() throws Exception { // GIVEN @@ -965,7 +964,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { } @Test - @EnableFlags({PromotedNotificationUi.FLAG_NAME, PromotedNotificationUiForceExpanded.FLAG_NAME}) + @EnableFlags(PromotedNotificationUi.FLAG_NAME) @DisableFlags(NotificationBundleUi.FLAG_NAME) public void isExpanded_promotedNotificationNotOnKeyguard_expanded() throws Exception { // GIVEN @@ -981,7 +980,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { } @Test - @EnableFlags({PromotedNotificationUi.FLAG_NAME, PromotedNotificationUiForceExpanded.FLAG_NAME}) + @EnableFlags(PromotedNotificationUi.FLAG_NAME) @DisableFlags(NotificationBundleUi.FLAG_NAME) public void isExpanded_promotedNotificationAllowOnKeyguard_expanded() throws Exception { // GIVEN @@ -997,7 +996,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { } @Test - @EnableFlags({PromotedNotificationUi.FLAG_NAME, PromotedNotificationUiForceExpanded.FLAG_NAME}) + @EnableFlags(PromotedNotificationUi.FLAG_NAME) @DisableFlags(NotificationBundleUi.FLAG_NAME) public void isExpanded_promotedNotificationIgnoreLockscreenConstraints_expanded() throws Exception { @@ -1035,7 +1034,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { } @Test - @EnableFlags({PromotedNotificationUi.FLAG_NAME, PromotedNotificationUiForceExpanded.FLAG_NAME}) + @EnableFlags(PromotedNotificationUi.FLAG_NAME) @DisableFlags(NotificationBundleUi.FLAG_NAME) public void isExpanded_promotedNotificationSaveSpaceOnLockScreen_notExpanded() throws Exception { @@ -1053,7 +1052,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { } @Test - @EnableFlags({PromotedNotificationUi.FLAG_NAME, PromotedNotificationUiForceExpanded.FLAG_NAME}) + @EnableFlags(PromotedNotificationUi.FLAG_NAME) @DisableFlags(NotificationBundleUi.FLAG_NAME) public void isExpanded_promotedNotificationNotSaveSpaceOnLockScreen_expanded() throws Exception { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowImageInflaterTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowImageInflaterTest.kt index d0357603665d..4d9f20c0038f 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowImageInflaterTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowImageInflaterTest.kt @@ -20,7 +20,7 @@ import android.platform.test.annotations.EnableFlags import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUiAod +import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi import com.android.systemui.statusbar.notification.row.shared.IconData import com.android.systemui.statusbar.notification.row.shared.ImageModel import com.android.systemui.statusbar.notification.row.shared.ImageModelProvider.ImageSizeClass.SmallSquare @@ -31,7 +31,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) -@EnableFlags(PromotedNotificationUiAod.FLAG_NAME) +@EnableFlags(PromotedNotificationUi.FLAG_NAME) class RowImageInflaterTest : SysuiTestCase() { private lateinit var rowImageInflater: RowImageInflater |