summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt21
-rw-r--r--packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt10
2 files changed, 21 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt b/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt
index db5a545c3f71..0d748a1cf077 100644
--- a/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt
+++ b/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt
@@ -17,11 +17,13 @@
package com.android.systemui.model
import com.android.compose.animation.scene.ObservableTransitionState
+import com.android.compose.animation.scene.OverlayKey
import com.android.compose.animation.scene.SceneKey
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.scene.domain.interactor.SceneContainerOcclusionInteractor
import com.android.systemui.scene.domain.interactor.SceneInteractor
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.shared.system.QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING
import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_COMMUNAL_HUB_SHOWING
@@ -57,12 +59,12 @@ constructor(
val transitionState = sceneInteractor.get().transitionState.value
val idleTransitionStateOrNull = transitionState as? ObservableTransitionState.Idle
- val currentSceneOrNull = idleTransitionStateOrNull?.currentScene
val invisibleDueToOcclusion = occlusionInteractor.get().invisibleDueToOcclusion.value
- return currentSceneOrNull?.let { sceneKey ->
+ return idleTransitionStateOrNull?.let { idleState ->
EvaluatorByFlag[flag]?.invoke(
SceneContainerPluginState(
- scene = sceneKey,
+ scene = idleState.currentScene,
+ overlays = idleState.currentOverlays,
invisibleDueToOcclusion = invisibleDueToOcclusion,
)
)
@@ -89,10 +91,15 @@ constructor(
it.invisibleDueToOcclusion -> false
it.scene == Scenes.Lockscreen -> true
it.scene == Scenes.Shade -> true
+ Overlays.NotificationsShade in it.overlays -> true
else -> false
}
},
- SYSUI_STATE_QUICK_SETTINGS_EXPANDED to { it.scene == Scenes.QuickSettings },
+ SYSUI_STATE_QUICK_SETTINGS_EXPANDED to
+ {
+ it.scene == Scenes.QuickSettings ||
+ Overlays.QuickSettingsShade in it.overlays
+ },
SYSUI_STATE_BOUNCER_SHOWING to { it.scene == Scenes.Bouncer },
SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING to
{
@@ -106,5 +113,9 @@ constructor(
)
}
- data class SceneContainerPluginState(val scene: SceneKey, val invisibleDueToOcclusion: Boolean)
+ data class SceneContainerPluginState(
+ val scene: SceneKey,
+ val overlays: Set<OverlayKey>,
+ val invisibleDueToOcclusion: Boolean,
+ )
}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt
index c5e0ccccb4d1..e11ffccb0be3 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt
@@ -107,6 +107,7 @@ import kotlinx.coroutines.launch
* Hooks up business logic that manipulates the state of the [SceneInteractor] for the system UI
* scene container based on state from other systems.
*/
+@OptIn(ExperimentalCoroutinesApi::class)
@SysUISingleton
class SceneContainerStartable
@Inject
@@ -408,8 +409,7 @@ constructor(
}
isOnPrimaryBouncer -> {
// When the device becomes unlocked in primary Bouncer,
- // notify dismiss succeeded and
- // go to previous scene or Gone.
+ // notify dismiss succeeded and go to previous scene or Gone.
dismissCallbackRegistry.notifyDismissSucceeded()
if (
previousScene.value == Scenes.Lockscreen ||
@@ -596,12 +596,12 @@ constructor(
combine(
sceneInteractor.transitionState
.mapNotNull { it as? ObservableTransitionState.Idle }
- .map { it.currentScene }
.distinctUntilChanged(),
occlusionInteractor.invisibleDueToOcclusion,
- ) { sceneKey, invisibleDueToOcclusion ->
+ ) { idleState, invisibleDueToOcclusion ->
SceneContainerPlugin.SceneContainerPluginState(
- scene = sceneKey,
+ scene = idleState.currentScene,
+ overlays = idleState.currentOverlays,
invisibleDueToOcclusion = invisibleDueToOcclusion,
)
}