summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Caitlin Shkuratov <caitlinshk@google.com> 2024-12-02 19:31:05 +0000
committer Caitlin Shkuratov <caitlinshk@google.com> 2024-12-02 22:35:32 +0000
commit4f362f4eccc42bff1d70e78a1cd7afdb58b958df (patch)
treebc858b35af7457654780e28c33d795e3dae2d63a
parent9789ec8298f358c3858257148a33ca12f39484ea (diff)
[SB][Notif] Remove ActiveNotificationModel.isPromoted; use content field
Now that `ActiveNotificationModel.promotedContent` is being filled in, we can use that field's null/not-null status to determine `isPromoted`. Fixes: 377566661 Bug: 364653005 Flag: com.android.systemui.status_bar_notification_chips Test: Trigger RON -> verify chip still shows up Test: atest NotifChipsViewModelTest ActiveNotificationsInteractorTest Change-Id: I235bbac7c80bbccf83bca0707505d3f1ab910a63
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/domain/interactor/StatusBarNotificationChipsInteractorTest.kt31
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModelTest.kt14
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsWithNotifsViewModelTest.kt26
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/ActiveNotificationsInteractorTest.kt31
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationsListInteractorTest.kt29
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/ActiveNotificationsInteractor.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationListInteractor.kt24
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/ActiveNotificationModel.kt3
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/data/model/ActiveNotificationModelBuilder.kt2
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationListInteractorKosmos.kt7
10 files changed, 81 insertions, 89 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/domain/interactor/StatusBarNotificationChipsInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/domain/interactor/StatusBarNotificationChipsInteractorTest.kt
index 702e101d2d39..5a894ca895c3 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/domain/interactor/StatusBarNotificationChipsInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/domain/interactor/StatusBarNotificationChipsInteractorTest.kt
@@ -30,6 +30,7 @@ import com.android.systemui.statusbar.chips.notification.shared.StatusBarNotifCh
import com.android.systemui.statusbar.notification.data.model.activeNotificationModel
import com.android.systemui.statusbar.notification.data.repository.ActiveNotificationsStore
import com.android.systemui.statusbar.notification.data.repository.activeNotificationListRepository
+import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel
import com.android.systemui.statusbar.notification.shared.ActiveNotificationModel
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
@@ -60,7 +61,7 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = mock<StatusBarIconView>(),
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -90,7 +91,7 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = null,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -110,7 +111,7 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = icon,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -133,17 +134,17 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif1",
statusBarChipIcon = firstIcon,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif1").build(),
),
activeNotificationModel(
key = "notif2",
statusBarChipIcon = secondIcon,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif2").build(),
),
activeNotificationModel(
key = "notif3",
statusBarChipIcon = mock<StatusBarIconView>(),
- isPromoted = false,
+ promotedContent = null,
),
)
)
@@ -170,7 +171,7 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = firstIcon,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -183,7 +184,7 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = secondIcon,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -196,7 +197,7 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = thirdIcon,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -216,7 +217,7 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = mock(),
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -228,7 +229,7 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = mock(),
- isPromoted = false,
+ promotedContent = null,
)
)
)
@@ -239,7 +240,7 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = mock(),
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -260,7 +261,8 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif|uid1",
statusBarChipIcon = firstIcon,
- isPromoted = true,
+ promotedContent =
+ PromotedNotificationContentModel.Builder("notif|uid1").build(),
)
)
)
@@ -274,7 +276,8 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
activeNotificationModel(
key = "notif|uid2",
statusBarChipIcon = secondIcon,
- isPromoted = true,
+ promotedContent =
+ PromotedNotificationContentModel.Builder("notif|uid2").build(),
)
)
)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModelTest.kt
index 16376c5b3850..bbe5e4625cf2 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModelTest.kt
@@ -32,6 +32,7 @@ import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
import com.android.systemui.statusbar.notification.data.model.activeNotificationModel
import com.android.systemui.statusbar.notification.data.repository.ActiveNotificationsStore
import com.android.systemui.statusbar.notification.data.repository.activeNotificationListRepository
+import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel
import com.android.systemui.statusbar.notification.shared.ActiveNotificationModel
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
@@ -75,7 +76,7 @@ class NotifChipsViewModelTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = null,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -94,7 +95,7 @@ class NotifChipsViewModelTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = icon,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -117,17 +118,17 @@ class NotifChipsViewModelTest : SysuiTestCase() {
activeNotificationModel(
key = "notif1",
statusBarChipIcon = firstIcon,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif1").build(),
),
activeNotificationModel(
key = "notif2",
statusBarChipIcon = secondIcon,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif2").build(),
),
activeNotificationModel(
key = "notif3",
statusBarChipIcon = mock<StatusBarIconView>(),
- isPromoted = false,
+ promotedContent = null,
),
)
)
@@ -151,7 +152,8 @@ class NotifChipsViewModelTest : SysuiTestCase() {
activeNotificationModel(
key = "clickTest",
statusBarChipIcon = mock<StatusBarIconView>(),
- isPromoted = true,
+ promotedContent =
+ PromotedNotificationContentModel.Builder("clickTest").build(),
)
)
)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsWithNotifsViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsWithNotifsViewModelTest.kt
index eb0978eff24b..b2e7febd1743 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsWithNotifsViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsWithNotifsViewModelTest.kt
@@ -53,6 +53,7 @@ import com.android.systemui.statusbar.commandline.commandRegistry
import com.android.systemui.statusbar.notification.data.model.activeNotificationModel
import com.android.systemui.statusbar.notification.data.repository.ActiveNotificationsStore
import com.android.systemui.statusbar.notification.data.repository.activeNotificationListRepository
+import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel
import com.android.systemui.statusbar.notification.shared.ActiveNotificationModel
import com.android.systemui.statusbar.phone.SystemUIDialog
import com.android.systemui.statusbar.phone.ongoingcall.data.repository.ongoingCallRepository
@@ -307,7 +308,7 @@ class OngoingActivityChipsWithNotifsViewModelTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = icon,
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
@@ -328,12 +329,14 @@ class OngoingActivityChipsWithNotifsViewModelTest : SysuiTestCase() {
activeNotificationModel(
key = "firstNotif",
statusBarChipIcon = firstIcon,
- isPromoted = true,
+ promotedContent =
+ PromotedNotificationContentModel.Builder("firstNotif").build(),
),
activeNotificationModel(
key = "secondNotif",
statusBarChipIcon = secondIcon,
- isPromoted = true,
+ promotedContent =
+ PromotedNotificationContentModel.Builder("secondNotif").build(),
),
)
)
@@ -355,17 +358,20 @@ class OngoingActivityChipsWithNotifsViewModelTest : SysuiTestCase() {
activeNotificationModel(
key = "firstNotif",
statusBarChipIcon = firstIcon,
- isPromoted = true,
+ promotedContent =
+ PromotedNotificationContentModel.Builder("firstNotif").build(),
),
activeNotificationModel(
key = "secondNotif",
statusBarChipIcon = secondIcon,
- isPromoted = true,
+ promotedContent =
+ PromotedNotificationContentModel.Builder("secondNotif").build(),
),
activeNotificationModel(
key = "thirdNotif",
statusBarChipIcon = thirdIcon,
- isPromoted = true,
+ promotedContent =
+ PromotedNotificationContentModel.Builder("thirdNotif").build(),
),
)
)
@@ -386,12 +392,14 @@ class OngoingActivityChipsWithNotifsViewModelTest : SysuiTestCase() {
activeNotificationModel(
key = "firstNotif",
statusBarChipIcon = firstIcon,
- isPromoted = true,
+ promotedContent =
+ PromotedNotificationContentModel.Builder("firstNotif").build(),
),
activeNotificationModel(
key = "secondNotif",
statusBarChipIcon = mock<StatusBarIconView>(),
- isPromoted = true,
+ promotedContent =
+ PromotedNotificationContentModel.Builder("secondNotif").build(),
),
)
)
@@ -412,7 +420,7 @@ class OngoingActivityChipsWithNotifsViewModelTest : SysuiTestCase() {
activeNotificationModel(
key = "notif",
statusBarChipIcon = mock<StatusBarIconView>(),
- isPromoted = true,
+ promotedContent = PromotedNotificationContentModel.Builder("notif").build(),
)
)
)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/ActiveNotificationsInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/ActiveNotificationsInteractorTest.kt
index 99bda856818e..54ce88b40c11 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/ActiveNotificationsInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/ActiveNotificationsInteractorTest.kt
@@ -31,6 +31,7 @@ import com.android.systemui.statusbar.notification.data.model.activeNotification
import com.android.systemui.statusbar.notification.data.repository.ActiveNotificationsStore
import com.android.systemui.statusbar.notification.data.repository.activeNotificationListRepository
import com.android.systemui.statusbar.notification.data.repository.setActiveNotifs
+import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel
import com.android.systemui.statusbar.notification.shared.CallType
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
@@ -169,8 +170,12 @@ class ActiveNotificationsInteractorTest : SysuiTestCase() {
testScope.runTest {
val latest by collectLastValue(underTest.promotedOngoingNotifications)
- val promoted1 = activeNotificationModel(key = "notif1", isPromoted = true)
- val notPromoted2 = activeNotificationModel(key = "notif2", isPromoted = false)
+ val promoted1 =
+ activeNotificationModel(
+ key = "notif1",
+ promotedContent = PromotedNotificationContentModel.Builder("notif1").build(),
+ )
+ val notPromoted2 = activeNotificationModel(key = "notif2", promotedContent = null)
activeNotificationListRepository.activeNotifications.value =
ActiveNotificationsStore.Builder()
@@ -189,9 +194,9 @@ class ActiveNotificationsInteractorTest : SysuiTestCase() {
activeNotificationListRepository.activeNotifications.value =
ActiveNotificationsStore.Builder()
- .apply { activeNotificationModel(key = "notif1", isPromoted = false) }
- .apply { activeNotificationModel(key = "notif2", isPromoted = false) }
- .apply { activeNotificationModel(key = "notif3", isPromoted = false) }
+ .apply { activeNotificationModel(key = "notif1", promotedContent = null) }
+ .apply { activeNotificationModel(key = "notif2", promotedContent = null) }
+ .apply { activeNotificationModel(key = "notif3", promotedContent = null) }
.build()
assertThat(latest!!).isEmpty()
@@ -203,10 +208,18 @@ class ActiveNotificationsInteractorTest : SysuiTestCase() {
testScope.runTest {
val latest by collectLastValue(underTest.promotedOngoingNotifications)
- val promoted1 = activeNotificationModel(key = "notif1", isPromoted = true)
- val notPromoted2 = activeNotificationModel(key = "notif2", isPromoted = false)
- val notPromoted3 = activeNotificationModel(key = "notif3", isPromoted = false)
- val promoted4 = activeNotificationModel(key = "notif4", isPromoted = true)
+ val promoted1 =
+ activeNotificationModel(
+ key = "notif1",
+ promotedContent = PromotedNotificationContentModel.Builder("notif1").build(),
+ )
+ val notPromoted2 = activeNotificationModel(key = "notif2", promotedContent = null)
+ val notPromoted3 = activeNotificationModel(key = "notif3", promotedContent = null)
+ val promoted4 =
+ activeNotificationModel(
+ key = "notif4",
+ promotedContent = PromotedNotificationContentModel.Builder("notif4").build(),
+ )
activeNotificationListRepository.activeNotifications.value =
ActiveNotificationsStore.Builder()
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationsListInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationsListInteractorTest.kt
index 183f9016a23b..5d9aa71c5d89 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationsListInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationsListInteractorTest.kt
@@ -16,7 +16,6 @@
package com.android.systemui.statusbar.notification.domain.interactor
import android.app.Notification
-import android.app.Notification.FLAG_PROMOTED_ONGOING
import android.platform.test.annotations.EnableFlags
import android.service.notification.StatusBarNotification
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -29,7 +28,7 @@ import com.android.systemui.statusbar.notification.collection.GroupEntry
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.data.repository.activeNotificationListRepository
import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi
-import com.android.systemui.statusbar.notification.promoted.promotedNotificationsProvider
+import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel
import com.android.systemui.statusbar.notification.shared.byKey
import com.android.systemui.testKosmos
import com.android.systemui.util.mockito.mock
@@ -48,11 +47,7 @@ class RenderNotificationsListInteractorTest : SysuiTestCase() {
private val notifsRepository = kosmos.activeNotificationListRepository
private val notifsInteractor = kosmos.activeNotificationsInteractor
private val underTest =
- RenderNotificationListInteractor(
- notifsRepository,
- sectionStyleProvider = mock(),
- promotedNotificationsProvider = kosmos.promotedNotificationsProvider,
- )
+ RenderNotificationListInteractor(notifsRepository, sectionStyleProvider = mock())
@Test
fun setRenderedList_preservesOrdering() =
@@ -127,12 +122,16 @@ class RenderNotificationsListInteractorTest : SysuiTestCase() {
@Test
@EnableFlags(PromotedNotificationUi.FLAG_NAME)
- fun setRenderList_setsPromotionStatus() =
+ fun setRenderList_setsPromotionContent() =
testScope.runTest {
val actual by collectLastValue(notifsInteractor.topLevelRepresentativeNotifications)
- val notPromoted1 = mockNotificationEntry("key1", flag = null)
- val promoted2 = mockNotificationEntry("key2", flag = FLAG_PROMOTED_ONGOING)
+ val notPromoted1 = mockNotificationEntry("key1", promotedContent = null)
+ val promoted2 =
+ mockNotificationEntry(
+ "key2",
+ promotedContent = PromotedNotificationContentModel.Builder("key2").build(),
+ )
underTest.setRenderedList(listOf(notPromoted1, promoted2))
@@ -140,22 +139,19 @@ class RenderNotificationsListInteractorTest : SysuiTestCase() {
val first = actual!![0]
assertThat(first.key).isEqualTo("key1")
- assertThat(first.isPromoted).isFalse()
+ assertThat(first.promotedContent).isNull()
val second = actual!![1]
assertThat(second.key).isEqualTo("key2")
- assertThat(second.isPromoted).isTrue()
+ assertThat(second.promotedContent).isNotNull()
}
private fun mockNotificationEntry(
key: String,
rank: Int = 0,
- flag: Int? = null,
+ promotedContent: PromotedNotificationContentModel? = null,
): NotificationEntry {
val nBuilder = Notification.Builder(context, "a")
- if (flag != null) {
- nBuilder.setFlag(flag, true)
- }
val notification = nBuilder.build()
val mockSbn =
@@ -169,6 +165,7 @@ class RenderNotificationsListInteractorTest : SysuiTestCase() {
whenever(this.representativeEntry).thenReturn(this)
whenever(this.ranking).thenReturn(RankingBuilder().setRank(rank).build())
whenever(this.sbn).thenReturn(mockSbn)
+ whenever(this.promotedNotificationContentModel).thenReturn(promotedContent)
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/ActiveNotificationsInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/ActiveNotificationsInteractor.kt
index cff5bef9fe69..6b93ee1c435e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/ActiveNotificationsInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/ActiveNotificationsInteractor.kt
@@ -79,11 +79,10 @@ constructor(
/** The notifications that are promoted and ongoing. Sorted by priority order. */
val promotedOngoingNotifications: Flow<List<ActiveNotificationModel>> =
if (StatusBarNotifChips.isEnabled) {
- // TODO(b/364653005): Filter all the notifications down to just the promoted ones.
// TODO(b/364653005): [ongoingCallNotification] should be incorporated into this flow
// instead of being separate.
topLevelRepresentativeNotifications
- .map { notifs -> notifs.filter { it.isPromoted } }
+ .map { notifs -> notifs.filter { it.promotedContent != null } }
.distinctUntilChanged()
.flowOn(backgroundDispatcher)
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationListInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationListInteractor.kt
index 8bd7a1ab7a77..042389f7fde7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationListInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationListInteractor.kt
@@ -33,7 +33,6 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.collection.provider.SectionStyleProvider
import com.android.systemui.statusbar.notification.data.repository.ActiveNotificationListRepository
import com.android.systemui.statusbar.notification.data.repository.ActiveNotificationsStore
-import com.android.systemui.statusbar.notification.promoted.PromotedNotificationsProvider
import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel
import com.android.systemui.statusbar.notification.shared.ActiveNotificationEntryModel
import com.android.systemui.statusbar.notification.shared.ActiveNotificationGroupModel
@@ -52,7 +51,6 @@ class RenderNotificationListInteractor
constructor(
private val repository: ActiveNotificationListRepository,
private val sectionStyleProvider: SectionStyleProvider,
- private val promotedNotificationsProvider: PromotedNotificationsProvider,
) {
/**
* Sets the current list of rendered notification entries as displayed in the notification list.
@@ -60,11 +58,7 @@ constructor(
fun setRenderedList(entries: List<ListEntry>) {
traceSection("RenderNotificationListInteractor.setRenderedList") {
repository.activeNotifications.update { existingModels ->
- buildActiveNotificationsStore(
- existingModels,
- sectionStyleProvider,
- promotedNotificationsProvider,
- ) {
+ buildActiveNotificationsStore(existingModels, sectionStyleProvider) {
entries.forEach(::addListEntry)
setRankingsMap(entries)
}
@@ -76,21 +70,13 @@ constructor(
private fun buildActiveNotificationsStore(
existingModels: ActiveNotificationsStore,
sectionStyleProvider: SectionStyleProvider,
- promotedNotificationsProvider: PromotedNotificationsProvider,
block: ActiveNotificationsStoreBuilder.() -> Unit,
): ActiveNotificationsStore =
- ActiveNotificationsStoreBuilder(
- existingModels,
- sectionStyleProvider,
- promotedNotificationsProvider,
- )
- .apply(block)
- .build()
+ ActiveNotificationsStoreBuilder(existingModels, sectionStyleProvider).apply(block).build()
private class ActiveNotificationsStoreBuilder(
private val existingModels: ActiveNotificationsStore,
private val sectionStyleProvider: SectionStyleProvider,
- private val promotedNotificationsProvider: PromotedNotificationsProvider,
) {
private val builder = ActiveNotificationsStore.Builder()
@@ -163,7 +149,6 @@ private class ActiveNotificationsStoreBuilder(
key = key,
groupKey = sbn.groupKey,
whenTime = sbn.notification.`when`,
- isPromoted = promotedNotificationsProvider.shouldPromote(this),
isAmbient = sectionStyleProvider.isMinimized(this),
isRowDismissed = isRowDismissed,
isSilent = sectionStyleProvider.isSilent(this),
@@ -190,7 +175,6 @@ private fun ActiveNotificationsStore.createOrReuse(
key: String,
groupKey: String?,
whenTime: Long,
- isPromoted: Boolean,
isAmbient: Boolean,
isRowDismissed: Boolean,
isSilent: Boolean,
@@ -215,7 +199,6 @@ private fun ActiveNotificationsStore.createOrReuse(
key = key,
groupKey = groupKey,
whenTime = whenTime,
- isPromoted = isPromoted,
isAmbient = isAmbient,
isRowDismissed = isRowDismissed,
isSilent = isSilent,
@@ -240,7 +223,6 @@ private fun ActiveNotificationsStore.createOrReuse(
key = key,
groupKey = groupKey,
whenTime = whenTime,
- isPromoted = isPromoted,
isAmbient = isAmbient,
isRowDismissed = isRowDismissed,
isSilent = isSilent,
@@ -266,7 +248,6 @@ private fun ActiveNotificationModel.isCurrent(
key: String,
groupKey: String?,
whenTime: Long,
- isPromoted: Boolean,
isAmbient: Boolean,
isRowDismissed: Boolean,
isSilent: Boolean,
@@ -290,7 +271,6 @@ private fun ActiveNotificationModel.isCurrent(
key != this.key -> false
groupKey != this.groupKey -> false
whenTime != this.whenTime -> false
- isPromoted != this.isPromoted -> false
isAmbient != this.isAmbient -> false
isRowDismissed != this.isRowDismissed -> false
isSilent != this.isSilent -> false
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/ActiveNotificationModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/ActiveNotificationModel.kt
index a2b71551eca8..ab8be306ab5e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/ActiveNotificationModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/ActiveNotificationModel.kt
@@ -38,9 +38,6 @@ data class ActiveNotificationModel(
val groupKey: String?,
/** When this notification was posted. */
val whenTime: Long,
- // TODO(b/377566661): Make isPromoted just check if promotedContent != null.
- /** True if this notification should be promoted and false otherwise. */
- val isPromoted: Boolean,
/** Is this entry in the ambient / minimized section (lowest priority)? */
val isAmbient: Boolean,
/**
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/data/model/ActiveNotificationModelBuilder.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/data/model/ActiveNotificationModelBuilder.kt
index 2ec801620212..c6ae15df6859 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/data/model/ActiveNotificationModelBuilder.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/data/model/ActiveNotificationModelBuilder.kt
@@ -29,7 +29,6 @@ fun activeNotificationModel(
key: String,
groupKey: String? = null,
whenTime: Long = 0L,
- isPromoted: Boolean = false,
isAmbient: Boolean = false,
isRowDismissed: Boolean = false,
isSilent: Boolean = false,
@@ -53,7 +52,6 @@ fun activeNotificationModel(
key = key,
groupKey = groupKey,
whenTime = whenTime,
- isPromoted = isPromoted,
isAmbient = isAmbient,
isRowDismissed = isRowDismissed,
isSilent = isSilent,
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationListInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationListInteractorKosmos.kt
index 067193fb7aa9..f7acae9846df 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationListInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/domain/interactor/RenderNotificationListInteractorKosmos.kt
@@ -19,13 +19,8 @@ package com.android.systemui.statusbar.notification.domain.interactor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.statusbar.notification.collection.provider.sectionStyleProvider
import com.android.systemui.statusbar.notification.data.repository.activeNotificationListRepository
-import com.android.systemui.statusbar.notification.promoted.promotedNotificationsProvider
val Kosmos.renderNotificationListInteractor by
Kosmos.Fixture {
- RenderNotificationListInteractor(
- activeNotificationListRepository,
- sectionStyleProvider,
- promotedNotificationsProvider,
- )
+ RenderNotificationListInteractor(activeNotificationListRepository, sectionStyleProvider)
}