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

Commit 261b4c3f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix redundant smartspace update" into main

parents 0a170d3d 83483e6d
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -123,4 +123,26 @@ class SmartspaceViewModelTest : SysuiTestCase() {

            assertThat(dozeTimeTick).isEqualTo(0)
        }

    @Test
    fun weather_dozeTimeTick_noAodTimeTick() =
        testScope.runTest {
            underTest = smartspaceViewModelFactory.create(SmartspaceViewModel.SURFACE_WEATHER_VIEW)

            fakeKeyguardRepository.dozeTimeTick()
            val dozeTimeTick = withTimeoutOrNull(100) { underTest.aodTimeTick.firstOrNull() }

            assertThat(dozeTimeTick).isNull()
        }

    @Test
    fun date_dozeTimeTick_noAodTimeTick() =
        testScope.runTest {
            underTest = smartspaceViewModelFactory.create(SmartspaceViewModel.SURFACE_DATE_VIEW)

            fakeKeyguardRepository.dozeTimeTick()
            val dozeTimeTick = withTimeoutOrNull(100) { underTest.aodTimeTick.firstOrNull() }

            assertThat(dozeTimeTick).isNull()
        }
}
+2 −1
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ constructor(
        powerInteractor.isAwake.filter { surfaceName != SURFACE_WEATHER_VIEW }

    /** Time tick flow */
    val aodTimeTick: Flow<Long> = keyguardInteractor.dozeTimeTick
    val aodTimeTick: Flow<Long> =
        keyguardInteractor.dozeTimeTick.filter { surfaceName == SURFACE_GENERAL_VIEW }

    @AssistedFactory
    interface Factory {