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

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

Merge "Only transition to GH from dreaming if charging/postured/docked" into main

parents 0f86bc8e 028c27bb
Loading
Loading
Loading
Loading
+24 −20
Original line number Diff line number Diff line
@@ -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
@@ -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()
+8 −2
Original line number Diff line number Diff line
@@ -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
@@ -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,
@@ -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()
        )