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

Commit b74ff428 authored by Will Leshner's avatar Will Leshner Committed by William Leshner
Browse files

Remove CTA tile for hub v2.

Bug: 389953811
Test: atest CommunalInteractorTest CommunalViewModelTest
Flag: com.android.systemui.glanceable_hub_v2
Change-Id: Ifc69cc7e8fb360f9da408cc17ea1c93f8371195c
parent f7e95e04
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -398,6 +398,7 @@ class CommunalInteractorTest(flags: FlagsParameterization) : SysuiTestCase() {
        }

    @Test
    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
    fun ctaTile_showsByDefault() =
        kosmos.runTest {
            fakeCommunalTutorialRepository.setTutorialSettingState(HUB_MODE_TUTORIAL_COMPLETED)
@@ -412,6 +413,7 @@ class CommunalInteractorTest(flags: FlagsParameterization) : SysuiTestCase() {
        }

    @Test
    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
    fun ctaTile_afterDismiss_doesNotShow() =
        kosmos.runTest {
            // Set to main user, so we can dismiss the tile for the main user.
+9 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.systemui.Flags.FLAG_BOUNCER_UI_REVAMP
import com.android.systemui.Flags.FLAG_COMMUNAL_HUB
import com.android.systemui.Flags.FLAG_COMMUNAL_RESPONSIVE_GRID
import com.android.systemui.Flags.FLAG_GLANCEABLE_HUB_DIRECT_EDIT_MODE
import com.android.systemui.Flags.FLAG_GLANCEABLE_HUB_V2
import com.android.systemui.SysuiTestCase
import com.android.systemui.bouncer.data.repository.fakeKeyguardBouncerRepository
import com.android.systemui.communal.data.model.CommunalSmartspaceTimer
@@ -219,6 +220,7 @@ class CommunalViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
        }

    @Test
    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
    fun ordering_smartspaceBeforeUmoBeforeWidgetsBeforeCtaTile() =
        testScope.runTest {
            tutorialRepository.setTutorialSettingState(Settings.Secure.HUB_MODE_TUTORIAL_COMPLETED)
@@ -258,7 +260,7 @@ class CommunalViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {

    /** TODO(b/378171351): Handle ongoing content in responsive grid. */
    @Test
    @DisableFlags(FLAG_COMMUNAL_RESPONSIVE_GRID)
    @DisableFlags(FLAG_COMMUNAL_RESPONSIVE_GRID, FLAG_GLANCEABLE_HUB_V2)
    fun ongoingContent_umoAndOneTimer_sizedAppropriately() =
        testScope.runTest {
            // Widgets available.
@@ -296,7 +298,7 @@ class CommunalViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {

    /** TODO(b/378171351): Handle ongoing content in responsive grid. */
    @Test
    @DisableFlags(FLAG_COMMUNAL_RESPONSIVE_GRID)
    @DisableFlags(FLAG_COMMUNAL_RESPONSIVE_GRID, FLAG_GLANCEABLE_HUB_V2)
    fun ongoingContent_umoAndTwoTimers_sizedAppropriately() =
        testScope.runTest {
            // Widgets available.
@@ -342,6 +344,7 @@ class CommunalViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
        }

    @Test
    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
    fun communalContent_mediaHostVisible_umoIncluded() =
        testScope.runTest {
            // Media playing.
@@ -353,6 +356,7 @@ class CommunalViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
        }

    @Test
    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
    fun communalContent_mediaHostVisible_umoExcluded() =
        testScope.runTest {
            whenever(mediaHost.visible).thenReturn(false)
@@ -408,6 +412,7 @@ class CommunalViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
        }

    @Test
    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
    fun dismissCta_hidesCtaTileAndShowsPopup_thenHidesPopupAfterTimeout() =
        testScope.runTest {
            setIsMainUser(true)
@@ -734,6 +739,7 @@ class CommunalViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
        }

    @Test
    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
    fun communalContent_emitsFrozenContent_whenFrozen() =
        testScope.runTest {
            val communalContent by collectLastValue(underTest.communalContent)
@@ -790,6 +796,7 @@ class CommunalViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
        }

    @Test
    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
    fun communalContent_emitsLatestContent_whenNotFrozen() =
        testScope.runTest {
            val communalContent by collectLastValue(underTest.communalContent)
+9 −3
Original line number Diff line number Diff line
@@ -541,9 +541,15 @@ constructor(
        }

    /** CTA tile to be displayed in the glanceable hub (view mode). */
    val ctaTileContent: Flow<List<CommunalContentModel.CtaTileInViewMode>> =
    val ctaTileContent: Flow<List<CommunalContentModel.CtaTileInViewMode>> by lazy {
        if (communalSettingsInteractor.isV2FlagEnabled()) {
            flowOf(listOf<CommunalContentModel.CtaTileInViewMode>())
        } else {
            communalPrefsInteractor.isCtaDismissed.map { isDismissed ->
            if (isDismissed) emptyList() else listOf(CommunalContentModel.CtaTileInViewMode())
                if (isDismissed) listOf<CommunalContentModel.CtaTileInViewMode>()
                else listOf(CommunalContentModel.CtaTileInViewMode())
            }
        }
    }

    /** A list of tutorial content to be displayed in the communal hub in tutorial mode. */