Loading packages/SystemUI/multivalentTests/src/com/android/systemui/smartspace/SmartspaceViewModelTest.kt +22 −0 Original line number Diff line number Diff line Loading @@ -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() } } packages/SystemUI/src/com/android/systemui/smartspace/ui/viewmodel/SmartspaceViewModel.kt +2 −1 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/smartspace/SmartspaceViewModelTest.kt +22 −0 Original line number Diff line number Diff line Loading @@ -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() } }
packages/SystemUI/src/com/android/systemui/smartspace/ui/viewmodel/SmartspaceViewModel.kt +2 −1 Original line number Diff line number Diff line Loading @@ -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 { Loading