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

Commit 1d1ac020 authored by Bryce Lee's avatar Bryce Lee
Browse files

Allow navigating to keyguard from dreaming with Glanceable Hub.

This changelist allows reaching the keyguard when exiting a dream.

Test: manual
Fixes: 343505271
Flag: com.android.systemui.glanceable_hub_allow_keyguard_when_dreamin
Change-Id: I87107366dd75b1d41576ef2f3442bf5da7878599
parent e89f7097
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1010,6 +1010,13 @@ flag {
  bug: "339667383"
}

flag {
  name: "glanceable_hub_allow_keyguard_when_dreaming"
  namespace: "systemui"
  description: "Allows users to exit dream to keyguard with glanceable hub enabled"
  bug: "343505271"
}

flag {
  name: "new_touchpad_gestures_tutorial"
  namespace: "systemui"
+3 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.communal
import android.annotation.SuppressLint
import android.app.DreamManager
import com.android.systemui.CoreStartable
import com.android.systemui.Flags.glanceableHubAllowKeyguardWhenDreaming
import com.android.systemui.Flags.communalHub
import com.android.systemui.Flags.restartDreamOnUnocclude
import com.android.systemui.communal.domain.interactor.CommunalInteractor
@@ -30,11 +31,11 @@ import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.util.kotlin.Utils.Companion.sample
import com.android.systemui.util.kotlin.sample
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import javax.inject.Inject

/**
 * A [CoreStartable] responsible for automatically starting the dream when the communal hub is
@@ -78,6 +79,7 @@ constructor(
                if (
                    finishedState == KeyguardState.GLANCEABLE_HUB &&
                        !dreaming &&
                        !glanceableHubAllowKeyguardWhenDreaming() &&
                        dreamManager.canStartDreaming(isAwake)
                ) {
                    dreamManager.startDream()
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.dreams;

import static android.service.dreams.Flags.dreamWakeRedirect;

import static com.android.systemui.Flags.glanceableHubAllowKeyguardWhenDreaming;
import static com.android.systemui.dreams.dagger.DreamModule.DREAM_OVERLAY_WINDOW_TITLE;
import static com.android.systemui.dreams.dagger.DreamModule.DREAM_TOUCH_INSET_MANAGER;
import static com.android.systemui.dreams.dagger.DreamModule.HOME_CONTROL_PANEL_DREAM_COMPONENT;
@@ -395,7 +396,7 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
            return;
        }

        redirectWake(mCommunalAvailable);
        redirectWake(mCommunalAvailable && !glanceableHubAllowKeyguardWhenDreaming());
    }

    @Override
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.dreams.ui.viewmodel

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.shared.model.CommunalScenes
@@ -60,7 +61,7 @@ constructor(
        val showGlanceableHub =
            communalInteractor.isCommunalEnabled.value &&
                !keyguardUpdateMonitor.isEncryptedOrLockdown(userTracker.userId)
        if (showGlanceableHub) {
        if (showGlanceableHub && !glanceableHubAllowKeyguardWhenDreaming()) {
            communalInteractor.changeScene(CommunalScenes.Communal)
        } else {
            toLockscreenTransitionViewModel.startTransition()