Loading packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalInteractor.kt +24 −20 Original line number Diff line number Diff line Loading @@ -186,7 +186,7 @@ constructor( * Whether communal hub should be shown automatically, depending on the user's [WhenToDream] * state. */ val shouldShowCommunal: Flow<Boolean> = val shouldShowCommunal: StateFlow<Boolean> = allOf( isCommunalAvailable, communalSettingsInteractor.whenToDream Loading @@ -203,11 +203,15 @@ constructor( ) WhenToDream.WHILE_POSTURED -> allOf(batteryInteractor.isDevicePluggedIn, posturingInteractor.postured) allOf( batteryInteractor.isDevicePluggedIn, posturingInteractor.postured, ) } } .flowOn(bgDispatcher), ) .stateIn(scope = bgScope, started = SharingStarted.Eagerly, initialValue = false) private val _isDisclaimerDismissed = MutableStateFlow(false) val isDisclaimerDismissed: Flow<Boolean> = _isDisclaimerDismissed.asStateFlow() Loading packages/SystemUI/src/com/android/systemui/dreams/ui/viewmodel/DreamViewModel.kt +8 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.keyguard.KeyguardUpdateMonitor import com.android.systemui.Flags.glanceableHubAllowKeyguardWhenDreaming import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor import com.android.systemui.communal.domain.interactor.CommunalInteractor import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dump.DumpManager import com.android.systemui.keyguard.domain.interactor.FromDreamingTransitionInteractor Loading Loading @@ -51,6 +52,7 @@ constructor( private val toLockscreenTransitionViewModel: DreamingToLockscreenTransitionViewModel, private val fromDreamingTransitionInteractor: FromDreamingTransitionInteractor, private val communalInteractor: CommunalInteractor, private val communalSettingsInteractor: CommunalSettingsInteractor, private val keyguardUpdateMonitor: KeyguardUpdateMonitor, private val userTracker: UserTracker, dumpManager: DumpManager, Loading @@ -58,8 +60,12 @@ constructor( fun startTransitionFromDream() { val showGlanceableHub = if (communalSettingsInteractor.isV2FlagEnabled()) { communalInteractor.shouldShowCommunal.value } else { communalInteractor.isCommunalEnabled.value && !keyguardUpdateMonitor.isEncryptedOrLockdown(userTracker.userId) } fromDreamingTransitionInteractor.startToLockscreenOrGlanceableHubTransition( showGlanceableHub && !glanceableHubAllowKeyguardWhenDreaming() ) Loading Loading
packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalInteractor.kt +24 −20 Original line number Diff line number Diff line Loading @@ -186,7 +186,7 @@ constructor( * Whether communal hub should be shown automatically, depending on the user's [WhenToDream] * state. */ val shouldShowCommunal: Flow<Boolean> = val shouldShowCommunal: StateFlow<Boolean> = allOf( isCommunalAvailable, communalSettingsInteractor.whenToDream Loading @@ -203,11 +203,15 @@ constructor( ) WhenToDream.WHILE_POSTURED -> allOf(batteryInteractor.isDevicePluggedIn, posturingInteractor.postured) allOf( batteryInteractor.isDevicePluggedIn, posturingInteractor.postured, ) } } .flowOn(bgDispatcher), ) .stateIn(scope = bgScope, started = SharingStarted.Eagerly, initialValue = false) private val _isDisclaimerDismissed = MutableStateFlow(false) val isDisclaimerDismissed: Flow<Boolean> = _isDisclaimerDismissed.asStateFlow() Loading
packages/SystemUI/src/com/android/systemui/dreams/ui/viewmodel/DreamViewModel.kt +8 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.keyguard.KeyguardUpdateMonitor import com.android.systemui.Flags.glanceableHubAllowKeyguardWhenDreaming import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor import com.android.systemui.communal.domain.interactor.CommunalInteractor import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dump.DumpManager import com.android.systemui.keyguard.domain.interactor.FromDreamingTransitionInteractor Loading Loading @@ -51,6 +52,7 @@ constructor( private val toLockscreenTransitionViewModel: DreamingToLockscreenTransitionViewModel, private val fromDreamingTransitionInteractor: FromDreamingTransitionInteractor, private val communalInteractor: CommunalInteractor, private val communalSettingsInteractor: CommunalSettingsInteractor, private val keyguardUpdateMonitor: KeyguardUpdateMonitor, private val userTracker: UserTracker, dumpManager: DumpManager, Loading @@ -58,8 +60,12 @@ constructor( fun startTransitionFromDream() { val showGlanceableHub = if (communalSettingsInteractor.isV2FlagEnabled()) { communalInteractor.shouldShowCommunal.value } else { communalInteractor.isCommunalEnabled.value && !keyguardUpdateMonitor.isEncryptedOrLockdown(userTracker.userId) } fromDreamingTransitionInteractor.startToLockscreenOrGlanceableHubTransition( showGlanceableHub && !glanceableHubAllowKeyguardWhenDreaming() ) Loading