Loading packages/SystemUI/src/com/android/systemui/scene/domain/interactor/WindowRootViewVisibilityInteractor.kt +13 −11 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import com.android.systemui.keyguard.shared.model.StatusBarState import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.scene.data.repository.WindowRootViewVisibilityRepository import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.statusbar.NotificationPresenter import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor Loading @@ -34,6 +35,7 @@ import com.android.systemui.statusbar.policy.HeadsUpManager import javax.inject.Inject import javax.inject.Provider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.combine Loading @@ -45,6 +47,7 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch /** Business logic about the visibility of various parts of the window root view. */ @OptIn(ExperimentalCoroutinesApi::class) @SysUISingleton class WindowRootViewVisibilityInteractor @Inject Loading Loading @@ -80,9 +83,9 @@ constructor( is ObservableTransitionState.Idle -> flowOf( state.currentScene == Scenes.Shade || state.currentScene == Scenes.NotificationsShade || state.currentScene == Scenes.QuickSettingsShade || state.currentScene == Scenes.Lockscreen state.currentScene == Scenes.Lockscreen || Overlays.NotificationsShade in state.currentOverlays || Overlays.QuickSettingsShade in state.currentOverlays ) is ObservableTransitionState.Transition -> if ( Loading @@ -94,12 +97,12 @@ constructor( } else { flowOf( state.toContent == Scenes.Shade || state.toContent == Scenes.NotificationsShade || state.toContent == Scenes.QuickSettingsShade || state.toContent == Overlays.NotificationsShade || state.toContent == Overlays.QuickSettingsShade || state.toContent == Scenes.Lockscreen || state.fromContent == Scenes.Shade || state.fromContent == Scenes.NotificationsShade || state.fromContent == Scenes.QuickSettingsShade || state.fromContent == Overlays.NotificationsShade || state.fromContent == Overlays.QuickSettingsShade || state.fromContent == Scenes.Lockscreen ) } Loading @@ -115,10 +118,9 @@ constructor( * false if the device is asleep. */ val isLockscreenOrShadeVisibleAndInteractive: StateFlow<Boolean> = combine( isLockscreenOrShadeVisible, powerInteractor.isAwake, ) { isKeyguardAodOrShadeVisible, isAwake -> combine(isLockscreenOrShadeVisible, powerInteractor.isAwake) { isKeyguardAodOrShadeVisible, isAwake -> isKeyguardAodOrShadeVisible && isAwake } .stateIn(scope, SharingStarted.Eagerly, initialValue = false) Loading Loading
packages/SystemUI/src/com/android/systemui/scene/domain/interactor/WindowRootViewVisibilityInteractor.kt +13 −11 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import com.android.systemui.keyguard.shared.model.StatusBarState import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.scene.data.repository.WindowRootViewVisibilityRepository import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.statusbar.NotificationPresenter import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor Loading @@ -34,6 +35,7 @@ import com.android.systemui.statusbar.policy.HeadsUpManager import javax.inject.Inject import javax.inject.Provider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.combine Loading @@ -45,6 +47,7 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch /** Business logic about the visibility of various parts of the window root view. */ @OptIn(ExperimentalCoroutinesApi::class) @SysUISingleton class WindowRootViewVisibilityInteractor @Inject Loading Loading @@ -80,9 +83,9 @@ constructor( is ObservableTransitionState.Idle -> flowOf( state.currentScene == Scenes.Shade || state.currentScene == Scenes.NotificationsShade || state.currentScene == Scenes.QuickSettingsShade || state.currentScene == Scenes.Lockscreen state.currentScene == Scenes.Lockscreen || Overlays.NotificationsShade in state.currentOverlays || Overlays.QuickSettingsShade in state.currentOverlays ) is ObservableTransitionState.Transition -> if ( Loading @@ -94,12 +97,12 @@ constructor( } else { flowOf( state.toContent == Scenes.Shade || state.toContent == Scenes.NotificationsShade || state.toContent == Scenes.QuickSettingsShade || state.toContent == Overlays.NotificationsShade || state.toContent == Overlays.QuickSettingsShade || state.toContent == Scenes.Lockscreen || state.fromContent == Scenes.Shade || state.fromContent == Scenes.NotificationsShade || state.fromContent == Scenes.QuickSettingsShade || state.fromContent == Overlays.NotificationsShade || state.fromContent == Overlays.QuickSettingsShade || state.fromContent == Scenes.Lockscreen ) } Loading @@ -115,10 +118,9 @@ constructor( * false if the device is asleep. */ val isLockscreenOrShadeVisibleAndInteractive: StateFlow<Boolean> = combine( isLockscreenOrShadeVisible, powerInteractor.isAwake, ) { isKeyguardAodOrShadeVisible, isAwake -> combine(isLockscreenOrShadeVisible, powerInteractor.isAwake) { isKeyguardAodOrShadeVisible, isAwake -> isKeyguardAodOrShadeVisible && isAwake } .stateIn(scope, SharingStarted.Eagerly, initialValue = false) Loading