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

Commit 5cee9fa5 authored by burakov's avatar burakov
Browse files

[Dual Shade] Open the clock app when clicking on the notifications chip.

Bug: 418136012
Test: Manually tested by opening the notifications shade on an unfolded
 device, clicking the notifications highlight chip, and observing that
 the clock app was opened.
Flag: com.android.systemui.scene_container
Change-Id: Ic25a4c32aee15801e80c0c050950251ae23151a5
parent 742c54e8
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -181,9 +181,10 @@ class ShadeHeaderViewModelTest : SysuiTestCase() {
        }

    @Test
    fun onNotificationIconChipClicked_lockedOnNotifShade_collapsesShadeToLockscreen() =
    fun onNotificationIconChipClicked_lockedOnNotifShade_collapsesShadeToLockscreen_opensClock() =
        testScope.runTest {
            setupDualShadeState(scene = Scenes.Lockscreen, overlay = Overlays.NotificationsShade)
            val activityStarter = kosmos.activityStarter
            val currentScene by collectLastValue(sceneInteractor.currentScene)
            val currentOverlays by collectLastValue(sceneInteractor.currentOverlays)

@@ -191,6 +192,11 @@ class ShadeHeaderViewModelTest : SysuiTestCase() {

            assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
            assertThat(currentOverlays).isEmpty()
            verify(activityStarter)
                .postStartActivityDismissingKeyguard(
                    argThat(IntentMatcherAction(AlarmClock.ACTION_SHOW_ALARMS)),
                    anyInt(),
                )
        }

    @Test
@@ -208,9 +214,10 @@ class ShadeHeaderViewModelTest : SysuiTestCase() {
        }

    @Test
    fun onNotificationIconChipClicked_unlockedOnNotifShade_collapsesShadeToGone() =
    fun onNotificationIconChipClicked_unlockedOnNotifShade_collapsesShadeToGone_opensClock() =
        testScope.runTest {
            setupDualShadeState(scene = Scenes.Gone, overlay = Overlays.NotificationsShade)
            val activityStarter = kosmos.activityStarter
            val currentScene by collectLastValue(sceneInteractor.currentScene)
            val currentOverlays by collectLastValue(sceneInteractor.currentOverlays)

@@ -218,6 +225,11 @@ class ShadeHeaderViewModelTest : SysuiTestCase() {

            assertThat(currentScene).isEqualTo(Scenes.Gone)
            assertThat(currentOverlays).isEmpty()
            verify(activityStarter)
                .postStartActivityDismissingKeyguard(
                    argThat(IntentMatcherAction(AlarmClock.ACTION_SHOW_ALARMS)),
                    anyInt(),
                )
        }

    @Test
+2 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ constructor(
        clockInteractor.launchClockActivity()
    }

    /** Notifies that the system icons container was clicked. */
    /** Notifies that the notification icons container was clicked. */
    fun onNotificationIconChipClicked() {
        if (!shadeModeInteractor.isDualShade) {
            return
@@ -222,6 +222,7 @@ constructor(
                loggingReason = loggingReason,
                transitionKey = SlightlyFasterShadeCollapse,
            )
            onClockClicked()
        } else {
            shadeInteractor.expandNotificationsShade(loggingReason)
        }