summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author 0 <syeonlee@google.com> 2024-10-15 16:21:26 -0700
committer 0 <syeonlee@google.com> 2024-10-15 16:41:46 -0700
commitb39dded2a2589b366950e82c7da2ba427acdf2f0 (patch)
treefd166ba8d237ddc1948abe922167e01d2f684db5
parent5bc4afb9a41e2cfa8905e070bfee446bfa6f8a8e (diff)
[flexiglass] use LSToGoneTransitionViewModel for keyguardAlpha during LS -> GONE
With flexiglass on, using the shade/QS alpha for keyguard when on Gone scene was causing the stack to flicker when going from LS -> Gone scene, as well as during the first shade invocation after going from LS -> Gone. This CL switches us over to the alpha provided by LockscreenToGoneTransitionViewModel and only uses shade/QS alpha when shade/QS are actually occluding keyguard. Bug: 364887368 Test: Manually verified keyguard alpha during LS -> Gone transition Flag: com.android.systemui.scene_container Change-Id: I837156b5e39cfc512ec7564824683a5acb6fc98b
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt27
1 files changed, 18 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
index f39af18afcea..472e7794cd0a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
@@ -475,19 +475,28 @@ constructor(
}
fun keyguardAlpha(viewState: ViewStateAccessor, scope: CoroutineScope): Flow<Float> {
- // Transitions are not (yet) authoritative for NSSL; they still rely on StatusBarState to
- // help determine when the device has fully moved to GONE or OCCLUDED state. Once SHADE
- // state has been set, let shade alpha take over
- val isKeyguardNotVisible =
- combine(
+ val isKeyguardOccluded =
+ keyguardTransitionInteractor.transitionValue(OCCLUDED).map { it == 1f }
+
+ val isKeyguardNotVisibleInState =
+ if (SceneContainerFlag.isEnabled) {
+ isKeyguardOccluded
+ } else {
anyOf(
- keyguardTransitionInteractor.transitionValue(OCCLUDED).map { it == 1f },
+ isKeyguardOccluded,
keyguardTransitionInteractor
.transitionValue(scene = Scenes.Gone, stateWithoutSceneContainer = GONE)
.map { it == 1f },
- ),
- keyguardInteractor.statusBarState,
- ) { isKeyguardNotVisibleInState, statusBarState ->
+ )
+ }
+
+ // Transitions are not (yet) authoritative for NSSL; they still rely on StatusBarState to
+ // help determine when the device has fully moved to GONE or OCCLUDED state. Once SHADE
+ // state has been set, let shade alpha take over
+ val isKeyguardNotVisible =
+ combine(isKeyguardNotVisibleInState, keyguardInteractor.statusBarState) {
+ isKeyguardNotVisibleInState,
+ statusBarState ->
isKeyguardNotVisibleInState && statusBarState == SHADE
}