Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95560907 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Chips] For call notifs that are also promoted, prefer promoted chip

Previously, we'd decided that call notifications that are also promoted
notifications should get the call chip treatment (accent color, must
show timer, ranked above any other promoted notification, tapping chip
opens activity).

Now, we're going to reverse the preference: Call notifications that are
also promoted notifications will get the *promoted* chip treatment
(system color, control over text, ranked similarly to other promoted
notifications, tapping chip shows notification).

This CL makes that reversal by not showing the call chip whenever a
notification has requested to be promoted. This means that a call
notification from an app that's *requesting to* show Live Updates but
isn't allowed to (because the user has blocked them) will get *no* chip
at all (not even a call chip).

Bug: 414830065
Bug: 364653005
Bug: 388521980
Flag: android.app.ui_rich_ongoing
Flag: android.app.opt_in_rich_ongoing

Test the following with android.app.opt_in_rich_ongoing flag on:

Test: Post a CallStyle.Ongoing notification that doesn't meet promotion
criteria (ONGOING isn't set, REQUEST_PROMOTED isn't set, COLORIZED not
set or set) -> verify it gets a call chip with accent color and forced
timer. Verify it doesn't get AOD treatment or demotion menu.

Test: Post a CallStyle.Ongoing notification that does meet promotion
criteria (ONGOING & REQUEST_PROMOTED set, COLORIZED not set) -> verify
it gets a promoted chip with system color and customized text, verify
a call chip is *not* shown

Test: Post a CallStyle.Ongoing notification that meets promotion
criteria -> verify it has the demotion menu. Then, demote the app ->
verify promoted chip hides and  call chip does *not* show up

Test: Post promoted CallStyle.Ongoing notif while app is demoted ->
verify no chip ever shows up. Then un-demote app -> verify promoted chip
appears

Test: Post a CallStyle.Ongoing notification that requests both promotion
and colorization (ONGOING, REQUEST_PROMOTED, and COLORIZED all set) ->
verify it doesn't get *any* chip at all

Test: Verify the notification shade ranking matches the chip ranking,
for both call chips and other kinds of chips

Test: With opt_in_rich_ongoing flag off, verify nothing is majorly
broken with any of those test cases. Specifically, verify that an
ongoing call notification that has ONGIONG and COLORIZED set does *not*
show 2 chips

Test: atest SystemUITests

Change-Id: I6750f6da52111deb0f189d040071eceb3a27b6bd
parent fb8a50e8
Loading
Loading
Loading
Loading
+58 −3
Original line number Diff line number Diff line
@@ -16,10 +16,12 @@

package com.android.systemui.statusbar.chips.call.domain.interactor

import android.app.Flags.FLAG_OPT_IN_RICH_ONGOING
import android.platform.test.annotations.DisableFlags
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.coroutines.collectLastValue
import com.android.systemui.kosmos.collectLastValue
import com.android.systemui.kosmos.runTest
import com.android.systemui.kosmos.useUnconfinedTestDispatcher
@@ -30,7 +32,6 @@ import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCall
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
import kotlin.test.Test
import kotlinx.coroutines.test.runTest
import org.junit.runner.RunWith

@SmallTest
@@ -42,7 +43,17 @@ class CallChipInteractorTest : SysuiTestCase() {
    val underTest = kosmos.callChipInteractor

    @Test
    fun ongoingCallState_matchesState() =
    fun ongoingCallState_noCall_isNoCall() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.ongoingCallState)

            removeOngoingCallState(key = "testKey")

            assertThat(latest).isEqualTo(OngoingCallModel.NoCall)
        }

    @Test
    fun ongoingCallState_updatesCorrectly() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.ongoingCallState)

@@ -52,4 +63,48 @@ class CallChipInteractorTest : SysuiTestCase() {
            removeOngoingCallState(key = "testKey")
            assertThat(latest).isEqualTo(OngoingCallModel.NoCall)
        }

    @Test
    @DisableFlags(FLAG_OPT_IN_RICH_ONGOING)
    fun ongoingCallState_inCall_noRequestedPromotion_optInFlagOff_isInCall() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.ongoingCallState)

            addOngoingCallState(key = "testKey", requestedPromotion = false)

            assertThat(latest).isInstanceOf(OngoingCallModel.InCall::class.java)
        }

    @Test
    @EnableFlags(FLAG_OPT_IN_RICH_ONGOING)
    fun ongoingCallState_inCall_noRequestedPromotion_optInFlagOn_isInCall() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.ongoingCallState)

            addOngoingCallState(key = "testKey", requestedPromotion = false)

            assertThat(latest).isInstanceOf(OngoingCallModel.InCall::class.java)
        }

    @Test
    @DisableFlags(FLAG_OPT_IN_RICH_ONGOING)
    fun ongoingCallState_inCall_requestedPromotion_optInFlagOff_isInCall() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.ongoingCallState)

            addOngoingCallState(key = "testKey", requestedPromotion = true)

            assertThat(latest).isInstanceOf(OngoingCallModel.InCall::class.java)
        }

    @Test
    @EnableFlags(FLAG_OPT_IN_RICH_ONGOING)
    fun ongoingCallState_inCall_requestedPromotion_optInFlagOn_isNoCall() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.ongoingCallState)

            addOngoingCallState(key = "testKey", requestedPromotion = true)

            assertThat(latest).isInstanceOf(OngoingCallModel.NoCall::class.java)
        }
}
+70 −127
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.statusbar.chips.call.ui.viewmodel

import android.app.Flags.FLAG_OPT_IN_RICH_ONGOING
import android.app.PendingIntent
import android.content.ComponentName
import android.content.Intent
@@ -49,6 +50,7 @@ import com.android.systemui.statusbar.notification.promoted.PromotedNotification
import com.android.systemui.statusbar.phone.ongoingcall.DisableChipsModernization
import com.android.systemui.statusbar.phone.ongoingcall.EnableChipsModernization
import com.android.systemui.statusbar.phone.ongoingcall.StatusBarChipsModernization
import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallTestHelper
import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallTestHelper.addOngoingCallState
import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallTestHelper.callPromotedContentBuilder
import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallTestHelper.removeOngoingCallState
@@ -113,8 +115,9 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
        }

    @Test
    @DisableFlags(PromotedNotificationUi.FLAG_NAME)
    fun chip_inCall_zeroStartTime_promotedFlagOff_hasPromotedContent_isShownAsIconOnly_withData() =
    @EnableFlags(PromotedNotificationUi.FLAG_NAME)
    @DisableFlags(FLAG_OPT_IN_RICH_ONGOING)
    fun chip_inCall_optInPromotedDisabled_callDidNotRequestPromotion_butHasContent_callChipIsShown() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

@@ -123,19 +126,22 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
                startTimeMs = 0,
                isAppVisible = false,
                instanceId = instanceId,
                promotedContent = callPromotedContentBuilder().build(),
                requestedPromotion = false,
                promotedContent =
                    OngoingCallTestHelper.PromotedContentInput.OverrideToValue(
                        callPromotedContentBuilder().build()
                    ),
            )

            assertThat((latest as OngoingActivityChipModel.Active).content)
                .isInstanceOf(OngoingActivityChipModel.Content.IconOnly::class.java)
            assertThat((latest as OngoingActivityChipModel.Active).isHidden).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).isImportantForPrivacy).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).instanceId).isEqualTo(instanceId)
        }

    @Test
    @DisableFlags(PromotedNotificationUi.FLAG_NAME)
    fun chip_inCall_zeroStartTime_promotedFlagOff_noPromotedContent_isShownAsIconOnly_withData() =
    @EnableFlags(PromotedNotificationUi.FLAG_NAME)
    @DisableFlags(FLAG_OPT_IN_RICH_ONGOING)
    fun chip_inCall_optInPromotedDisabled_callRequestedPromotion_andIsPromoted_callChipIsShown() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

@@ -144,19 +150,23 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
                startTimeMs = 0,
                isAppVisible = false,
                instanceId = instanceId,
                promotedContent = null,
                requestedPromotion = true,
                promotedContent =
                    OngoingCallTestHelper.PromotedContentInput.OverrideToValue(
                        callPromotedContentBuilder().build()
                    ),
            )

            assertThat((latest as OngoingActivityChipModel.Active).content)
                .isInstanceOf(OngoingActivityChipModel.Content.IconOnly::class.java)
            assertThat((latest as OngoingActivityChipModel.Active).isHidden).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).isImportantForPrivacy).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).instanceId).isEqualTo(instanceId)
        }

    @Test
    @EnableFlags(PromotedNotificationUi.FLAG_NAME)
    fun chip_inCall_zeroStartTime_promotedFlagOn_hasPromotedContent_isShownAsIconOnly_withData() =
    @EnableChipsModernization
    @DisableFlags(FLAG_OPT_IN_RICH_ONGOING)
    fun chip_inCall_optInPromotedDisabled_callRequestedPromotion_butNotPromoted_noCallChip() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

@@ -165,19 +175,17 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
                startTimeMs = 0,
                isAppVisible = false,
                instanceId = instanceId,
                promotedContent = callPromotedContentBuilder().build(),
                requestedPromotion = true,
                // This is null if notif isn't actually promoted
                promotedContent = OngoingCallTestHelper.PromotedContentInput.OverrideToNull,
            )

            assertThat((latest as OngoingActivityChipModel.Active).content)
                .isInstanceOf(OngoingActivityChipModel.Content.IconOnly::class.java)
            assertThat((latest as OngoingActivityChipModel.Active).isHidden).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).isImportantForPrivacy).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).instanceId).isEqualTo(instanceId)
            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Inactive::class.java)
        }

    @Test
    @EnableFlags(PromotedNotificationUi.FLAG_NAME)
    fun chip_inCall_zeroStartTime_promotedFlagOn_noPromotedContent_isInactive() =
    @EnableFlags(PromotedNotificationUi.FLAG_NAME, FLAG_OPT_IN_RICH_ONGOING)
    fun chip_inCall_optInPromotedEnabled_callDidNotRequestPromotion_callChipIsShown() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

@@ -186,107 +194,71 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
                startTimeMs = 0,
                isAppVisible = false,
                instanceId = instanceId,
                promotedContent = null,
                requestedPromotion = false,
                promotedContent = OngoingCallTestHelper.PromotedContentInput.OverrideToNull,
            )

            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Inactive::class.java)
        }

    @Test
    fun chip_inCall_negativeStartTime_isShownAsIconOnly_withData() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

            val instanceId = InstanceId.fakeInstanceId(10)
            addOngoingCallState(startTimeMs = -2, isAppVisible = false, instanceId = instanceId)

            assertThat((latest as OngoingActivityChipModel.Active).content)
                .isInstanceOf(OngoingActivityChipModel.Content.IconOnly::class.java)
            assertThat((latest as OngoingActivityChipModel.Active).isHidden).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).isImportantForPrivacy).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).instanceId).isEqualTo(instanceId)
        }

    @Test
    @DisableFlags(PromotedNotificationUi.FLAG_NAME)
    fun chip_inCall_positiveStartTime_promotedFlagOff_hasPromotedContent_isShownAsTimer_withData() =
    @EnableFlags(PromotedNotificationUi.FLAG_NAME, FLAG_OPT_IN_RICH_ONGOING)
    fun chip_inCall_optInPromotedEnabled_callRequestedPromotion_andIsPromoted_noCallChip() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

            val instanceId = InstanceId.fakeInstanceId(10)
            addOngoingCallState(
                startTimeMs = 345,
                startTimeMs = 0,
                isAppVisible = false,
                instanceId = instanceId,
                promotedContent = callPromotedContentBuilder().build(),
                requestedPromotion = true,
                promotedContent =
                    OngoingCallTestHelper.PromotedContentInput.OverrideToValue(
                        callPromotedContentBuilder().build()
                    ),
            )

            assertThat((latest as OngoingActivityChipModel.Active).content)
                .isInstanceOf(OngoingActivityChipModel.Content.Timer::class.java)
            assertThat((latest as OngoingActivityChipModel.Active).isHidden).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).isImportantForPrivacy).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).instanceId).isEqualTo(instanceId)
            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Inactive::class.java)
        }

    /** See b/414830065. */
    @Test
    @DisableFlags(PromotedNotificationUi.FLAG_NAME)
    fun chip_inCall_positiveStartTime_promotedFlagOff_noPromotedContent_isShownAsTimer_withData() =
    @EnableFlags(PromotedNotificationUi.FLAG_NAME, FLAG_OPT_IN_RICH_ONGOING)
    fun chip_inCall_optInPromotedEnabled_callRequestedPromotion_butNotPromoted_noCallChip() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

            val instanceId = InstanceId.fakeInstanceId(10)
            addOngoingCallState(
                startTimeMs = 345,
                startTimeMs = 0,
                isAppVisible = false,
                instanceId = instanceId,
                promotedContent = null,
                requestedPromotion = true,
                // This is null if notif isn't actually promoted,
                promotedContent = OngoingCallTestHelper.PromotedContentInput.OverrideToNull,
            )

            assertThat((latest as OngoingActivityChipModel.Active).content)
                .isInstanceOf(OngoingActivityChipModel.Content.Timer::class.java)
            assertThat((latest as OngoingActivityChipModel.Active).isHidden).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).isImportantForPrivacy).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).instanceId).isEqualTo(instanceId)
            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Inactive::class.java)
        }

    @Test
    @EnableFlags(PromotedNotificationUi.FLAG_NAME)
    fun chip_inCall_positiveStartTime_promotedFlagOn_hasPromotedContent_isShownAsTimer_withData() =
    fun chip_inCall_negativeStartTime_isShownAsIconOnly_withData() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

            val instanceId = InstanceId.fakeInstanceId(10)
            addOngoingCallState(
                startTimeMs = 345,
                isAppVisible = false,
                instanceId = instanceId,
                promotedContent = callPromotedContentBuilder().build(),
            )
            addOngoingCallState(startTimeMs = -2, isAppVisible = false, instanceId = instanceId)

            assertThat((latest as OngoingActivityChipModel.Active).content)
                .isInstanceOf(OngoingActivityChipModel.Content.Timer::class.java)
                .isInstanceOf(OngoingActivityChipModel.Content.IconOnly::class.java)
            assertThat((latest as OngoingActivityChipModel.Active).isHidden).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).isImportantForPrivacy).isFalse()
            assertThat((latest as OngoingActivityChipModel.Active).instanceId).isEqualTo(instanceId)
        }

    @Test
    @EnableFlags(PromotedNotificationUi.FLAG_NAME)
    fun chip_inCall_positiveStartTime_promotedFlagOn_noPromotedContent_isInactive() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

            val instanceId = InstanceId.fakeInstanceId(10)
            addOngoingCallState(
                startTimeMs = 345,
                isAppVisible = false,
                instanceId = instanceId,
                promotedContent = null,
            )

            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Inactive::class.java)
        }

    @Test
    @EnableChipsModernization
    fun chip_twoCallNotifs_earlierIsUsed() =
@@ -298,15 +270,9 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
                key = "earlierNotif",
                startTimeMs = 3_000,
                instanceId = instanceIdOld,
                promotedContent = callPromotedContentBuilder("earlierNotif").build(),
            )
            val instanceIdNew = InstanceId.fakeInstanceId(6)
            addOngoingCallState(
                key = "laterNotif",
                startTimeMs = 6_000,
                instanceId = instanceIdNew,
                promotedContent = callPromotedContentBuilder("laterNotif").build(),
            )
            addOngoingCallState(key = "laterNotif", startTimeMs = 6_000, instanceId = instanceIdNew)

            assertThat((latest as OngoingActivityChipModel.Active).content)
                .isInstanceOf(OngoingActivityChipModel.Content.Timer::class.java)
@@ -315,35 +281,6 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
                .isEqualTo(instanceIdOld)
        }

    @Test
    @EnableChipsModernization
    @EnableFlags(PromotedNotificationUi.FLAG_NAME)
    fun chip_twoCallNotifs_earlierHasNoPromotedContent_laterIsUsed() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

            val instanceIdOld = InstanceId.fakeInstanceId(3)
            addOngoingCallState(
                key = "earlierNotif",
                startTimeMs = 3_000,
                instanceId = instanceIdOld,
                promotedContent = null,
            )
            val instanceIdNew = InstanceId.fakeInstanceId(6)
            addOngoingCallState(
                key = "laterNotif",
                startTimeMs = 6_000,
                instanceId = instanceIdNew,
                promotedContent = callPromotedContentBuilder("laterNotif").build(),
            )

            assertThat((latest as OngoingActivityChipModel.Active).content)
                .isInstanceOf(OngoingActivityChipModel.Content.Timer::class.java)
            assertThat((latest as OngoingActivityChipModel.Active).key).contains("laterNotif")
            assertThat((latest as OngoingActivityChipModel.Active).instanceId)
                .isEqualTo(instanceIdNew)
        }

    @Test
    @DisableFlags(StatusBarChipsReturnAnimations.FLAG_NAME)
    fun chipLegacy_inCallWithVisibleApp_zeroStartTime_isHiddenAsInactive() =
@@ -588,40 +525,46 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
            val latest by collectLastValue(underTest.chip)

            // WHEN there's promoted content
            addOngoingCallState(promotedContent = callPromotedContentBuilder().build())
            addOngoingCallState(
                promotedContent =
                    OngoingCallTestHelper.PromotedContentInput.OverrideToValue(
                        callPromotedContentBuilder().build()
                    )
            )
            // THEN the chip is active
            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Active::class.java)

            // WHEN the promoted content is removed
            addOngoingCallState(promotedContent = null)
            addOngoingCallState(
                promotedContent = OngoingCallTestHelper.PromotedContentInput.OverrideToNull
            )
            // THEN the chip stays active
            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Active::class.java)

            // WHEN there's promoted content again
            addOngoingCallState(promotedContent = callPromotedContentBuilder().build())
            addOngoingCallState(
                promotedContent =
                    OngoingCallTestHelper.PromotedContentInput.OverrideToValue(
                        callPromotedContentBuilder().build()
                    )
            )
            // THEN the chip is still active
            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Active::class.java)
        }

    @Test
    @EnableFlags(PromotedNotificationUi.FLAG_NAME)
    fun chip_promotedFlagOn_promotedContentChanges_modelUpdates() =
    @EnableFlags(PromotedNotificationUi.FLAG_NAME, FLAG_OPT_IN_RICH_ONGOING)
    fun chip_promotedFlagOn_requestedPromotionChanges_modelUpdates() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.chip)

            // WHEN there's promoted content
            addOngoingCallState(promotedContent = callPromotedContentBuilder().build())
            // THEN the chip is active
            addOngoingCallState(requestedPromotion = false)
            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Active::class.java)

            // WHEN the promoted content is removed
            addOngoingCallState(promotedContent = null)
            // THEN the chip is inactive
            addOngoingCallState(requestedPromotion = true)
            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Inactive::class.java)

            // WHEN there's promoted content again
            addOngoingCallState(promotedContent = callPromotedContentBuilder().build())
            // THEN the chip is active again
            addOngoingCallState(requestedPromotion = false)
            assertThat(latest).isInstanceOf(OngoingActivityChipModel.Active::class.java)
        }

+36 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.statusbar.chips.notification.domain.interactor

import android.app.Flags.FLAG_OPT_IN_RICH_ONGOING
import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -216,7 +217,8 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
    /** Regression test for b/388521980. */
    @Test
    @EnableFlags(PromotedNotificationUi.FLAG_NAME)
    fun allNotificationChips_callNotifIsAlsoPromoted_callNotifExcluded() =
    @DisableFlags(FLAG_OPT_IN_RICH_ONGOING)
    fun allNotificationChips_callNotifIsAlsoPromoted_optInDisabled_callNotifExcluded() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.allNotificationChips)

@@ -244,6 +246,39 @@ class StatusBarNotificationChipsInteractorTest : SysuiTestCase() {
            assertThat(latest!![0].key).isEqualTo("promotedNormal")
        }

    @Test
    @EnableFlags(PromotedNotificationUi.FLAG_NAME, FLAG_OPT_IN_RICH_ONGOING)
    fun allNotificationChips_callNotifIsAlsoPromoted_optInEnabled_callNotifIncluded() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.allNotificationChips)

            setNotifs(
                listOf(
                    activeNotificationModel(
                        key = "promotedNormal",
                        statusBarChipIcon = mock(),
                        requestedPromotion = true,
                        promotedContent =
                            PromotedNotificationContentBuilder("promotedNormal").build(),
                        callType = CallType.None,
                    ),
                    activeNotificationModel(
                        key = "promotedCall",
                        statusBarChipIcon = mock(),
                        requestedPromotion = true,
                        promotedContent =
                            PromotedNotificationContentBuilder("promotedCall").build(),
                        callType = CallType.Ongoing,
                    ),
                )
            )

            // Verify the promoted call notification is included
            assertThat(latest).hasSize(2)
            assertThat(latest!![0].key).isEqualTo("promotedNormal")
            assertThat(latest!![1].key).isEqualTo("promotedCall")
        }

    @Test
    @EnableFlags(PromotedNotificationUi.FLAG_NAME)
    fun allNotificationChips_notifUpdatesGoThrough() =
+156 −0

File changed.

Preview size limit exceeded, changes collapsed.

+25 −134

File changed.

Preview size limit exceeded, changes collapsed.

Loading