Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModelTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,6 @@ class KeyguardStatusBarViewModelTest(flags: FlagsParameterization) : SysuiTestCa fun setup() { underTest = KeyguardStatusBarViewModel( testScope.backgroundScope, headsUpNotificationInteractor, kosmos.sceneInteractor, keyguardInteractor, Loading packages/SystemUI/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModel.kt +27 −20 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.statusbar.ui.viewmodel import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.lifecycle.HydratedActivatable import com.android.systemui.scene.domain.interactor.SceneInteractor Loading @@ -33,15 +32,16 @@ import com.android.systemui.statusbar.policy.BatteryController.BatteryStateChang import com.android.systemui.user.domain.interactor.UserLogoutInteractor import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch /** * A view model for the status bar displayed on keyguard (lockscreen). Loading @@ -55,9 +55,8 @@ import kotlinx.coroutines.flow.stateIn class KeyguardStatusBarViewModel @Inject constructor( @Application scope: CoroutineScope, headsUpNotificationInteractor: HeadsUpNotificationInteractor, sceneInteractor: SceneInteractor, private val sceneInteractor: SceneInteractor, private val keyguardInteractor: KeyguardInteractor, keyguardStatusBarInteractor: KeyguardStatusBarInteractor, private val userLogoutInteractor: UserLogoutInteractor, Loading @@ -71,8 +70,13 @@ constructor( flowOf(false) } private val _isVisible = MutableStateFlow(false) /** True if this view should be visible and false otherwise. */ val isVisible: StateFlow<Boolean> = val isVisible: StateFlow<Boolean> = _isVisible.asStateFlow() override suspend fun onActivated() { coroutineScope { launch { combine( sceneInteractor.currentScene, sceneInteractor.currentOverlays, Loading @@ -86,7 +90,10 @@ constructor( !isDozing && !showHeadsUpStatusBar } .stateIn(scope, SharingStarted.WhileSubscribed(), false) .collect { _isVisible.value = it } } } } /** True if the device's battery is currently charging and false otherwise. */ // Note: Never make this an eagerly-started state flow so that the callback is removed when the Loading packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModelKosmos.kt +0 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.statusbar.ui.viewmodel import com.android.systemui.keyguard.domain.interactor.keyguardInteractor import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.applicationCoroutineScope import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.statusbar.domain.interactor.keyguardStatusBarInteractor import com.android.systemui.statusbar.notification.stack.domain.interactor.headsUpNotificationInteractor Loading @@ -28,7 +27,6 @@ import com.android.systemui.user.domain.interactor.userLogoutInteractor val Kosmos.keyguardStatusBarViewModel: KeyguardStatusBarViewModel by Kosmos.Fixture { KeyguardStatusBarViewModel( applicationCoroutineScope, headsUpNotificationInteractor, sceneInteractor, keyguardInteractor, Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModelTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,6 @@ class KeyguardStatusBarViewModelTest(flags: FlagsParameterization) : SysuiTestCa fun setup() { underTest = KeyguardStatusBarViewModel( testScope.backgroundScope, headsUpNotificationInteractor, kosmos.sceneInteractor, keyguardInteractor, Loading
packages/SystemUI/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModel.kt +27 −20 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.statusbar.ui.viewmodel import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.lifecycle.HydratedActivatable import com.android.systemui.scene.domain.interactor.SceneInteractor Loading @@ -33,15 +32,16 @@ import com.android.systemui.statusbar.policy.BatteryController.BatteryStateChang import com.android.systemui.user.domain.interactor.UserLogoutInteractor import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch /** * A view model for the status bar displayed on keyguard (lockscreen). Loading @@ -55,9 +55,8 @@ import kotlinx.coroutines.flow.stateIn class KeyguardStatusBarViewModel @Inject constructor( @Application scope: CoroutineScope, headsUpNotificationInteractor: HeadsUpNotificationInteractor, sceneInteractor: SceneInteractor, private val sceneInteractor: SceneInteractor, private val keyguardInteractor: KeyguardInteractor, keyguardStatusBarInteractor: KeyguardStatusBarInteractor, private val userLogoutInteractor: UserLogoutInteractor, Loading @@ -71,8 +70,13 @@ constructor( flowOf(false) } private val _isVisible = MutableStateFlow(false) /** True if this view should be visible and false otherwise. */ val isVisible: StateFlow<Boolean> = val isVisible: StateFlow<Boolean> = _isVisible.asStateFlow() override suspend fun onActivated() { coroutineScope { launch { combine( sceneInteractor.currentScene, sceneInteractor.currentOverlays, Loading @@ -86,7 +90,10 @@ constructor( !isDozing && !showHeadsUpStatusBar } .stateIn(scope, SharingStarted.WhileSubscribed(), false) .collect { _isVisible.value = it } } } } /** True if the device's battery is currently charging and false otherwise. */ // Note: Never make this an eagerly-started state flow so that the callback is removed when the Loading
packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModelKosmos.kt +0 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.statusbar.ui.viewmodel import com.android.systemui.keyguard.domain.interactor.keyguardInteractor import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.applicationCoroutineScope import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.statusbar.domain.interactor.keyguardStatusBarInteractor import com.android.systemui.statusbar.notification.stack.domain.interactor.headsUpNotificationInteractor Loading @@ -28,7 +27,6 @@ import com.android.systemui.user.domain.interactor.userLogoutInteractor val Kosmos.keyguardStatusBarViewModel: KeyguardStatusBarViewModel by Kosmos.Fixture { KeyguardStatusBarViewModel( applicationCoroutineScope, headsUpNotificationInteractor, sceneInteractor, keyguardInteractor, Loading