Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt +7 −2 Original line number Diff line number Diff line Loading @@ -290,10 +290,15 @@ class SharedNotificationContainerViewModelTest : SysuiTestCase() { testScope.runTest { val alpha by collectLastValue(underTest.glanceableHubAlpha) // Start on dream showDream() // Start on lockscreen, notifications should be unhidden. showLockscreen() assertThat(alpha).isEqualTo(1f) // Transition to dream, notifications should be hidden so that transition // from dream->hub doesn't cause notification flicker. showDream() assertThat(alpha).isEqualTo(0f) // Start transitioning to glanceable hub val progress = 0.6f keyguardTransitionRepository.sendTransitionStep( Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt +6 −3 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.view.View import android.view.WindowInsets import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.android.systemui.Flags.communalHub import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.keyguard.ui.viewmodel.BurnInParameters Loading Loading @@ -150,6 +151,7 @@ constructor( } } if (communalHub()) { launch { viewModel.glanceableHubAlpha.collect { controller.setMaxAlphaForGlanceableHub(it) Loading @@ -157,6 +159,7 @@ constructor( } } } } if (sceneContainerFlags.isEnabled()) { disposables += notificationStackViewBinder.bindWhileAttached() Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt +21 −3 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.shared.model.KeyguardState.ALTERNATE_BOUNCER import com.android.systemui.keyguard.shared.model.KeyguardState.AOD import com.android.systemui.keyguard.shared.model.KeyguardState.DOZING import com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING import com.android.systemui.keyguard.shared.model.KeyguardState.GLANCEABLE_HUB import com.android.systemui.keyguard.shared.model.KeyguardState.GONE import com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN Loading Loading @@ -241,7 +242,22 @@ constructor( started = SharingStarted.Eagerly, initialValue = false, ) .dumpWhileCollecting("isOnGlanceableHubWithoutShade") .dumpValue("isOnGlanceableHubWithoutShade") /** Are we on the dream without the shade/qs? */ private val isDreamingWithoutShade: Flow<Boolean> = combine( keyguardTransitionInteractor.isFinishedInState(DREAMING), isAnyExpanded, ) { isDreaming, isAnyExpanded -> isDreaming && !isAnyExpanded } .stateIn( scope = applicationScope, started = SharingStarted.Eagerly, initialValue = false, ) .dumpValue("isDreamingWithoutShade") /** * Fade in if the user swipes the shade back up, not if collapsed by going to AOD. This is Loading Loading @@ -460,6 +476,7 @@ constructor( combineTransform( isOnGlanceableHubWithoutShade, isOnLockscreen, isDreamingWithoutShade, merge( lockscreenToGlanceableHubTransitionViewModel.notificationAlpha, glanceableHubToLockscreenTransitionViewModel.notificationAlpha, Loading @@ -467,9 +484,9 @@ constructor( // Manually emit on start because [notificationAlpha] only starts emitting // when transitions start. .onStart { emit(1f) } ) { isOnGlanceableHubWithoutShade, isOnLockscreen, alpha, ) { isOnGlanceableHubWithoutShade, isOnLockscreen, isDreamingWithoutShade, alpha, -> if (isOnGlanceableHubWithoutShade && !isOnLockscreen) { if ((isOnGlanceableHubWithoutShade || isDreamingWithoutShade) && !isOnLockscreen) { // Notifications should not be visible on the glanceable hub. // TODO(b/321075734): implement a way to actually set the notifications to // gone while on the hub instead of just adjusting alpha Loading @@ -484,6 +501,7 @@ constructor( emit(1f) } } .distinctUntilChanged() .dumpWhileCollecting("glanceableHubAlpha") /** Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt +7 −2 Original line number Diff line number Diff line Loading @@ -290,10 +290,15 @@ class SharedNotificationContainerViewModelTest : SysuiTestCase() { testScope.runTest { val alpha by collectLastValue(underTest.glanceableHubAlpha) // Start on dream showDream() // Start on lockscreen, notifications should be unhidden. showLockscreen() assertThat(alpha).isEqualTo(1f) // Transition to dream, notifications should be hidden so that transition // from dream->hub doesn't cause notification flicker. showDream() assertThat(alpha).isEqualTo(0f) // Start transitioning to glanceable hub val progress = 0.6f keyguardTransitionRepository.sendTransitionStep( Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt +6 −3 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.view.View import android.view.WindowInsets import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.android.systemui.Flags.communalHub import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.keyguard.ui.viewmodel.BurnInParameters Loading Loading @@ -150,6 +151,7 @@ constructor( } } if (communalHub()) { launch { viewModel.glanceableHubAlpha.collect { controller.setMaxAlphaForGlanceableHub(it) Loading @@ -157,6 +159,7 @@ constructor( } } } } if (sceneContainerFlags.isEnabled()) { disposables += notificationStackViewBinder.bindWhileAttached() Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt +21 −3 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.shared.model.KeyguardState.ALTERNATE_BOUNCER import com.android.systemui.keyguard.shared.model.KeyguardState.AOD import com.android.systemui.keyguard.shared.model.KeyguardState.DOZING import com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING import com.android.systemui.keyguard.shared.model.KeyguardState.GLANCEABLE_HUB import com.android.systemui.keyguard.shared.model.KeyguardState.GONE import com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN Loading Loading @@ -241,7 +242,22 @@ constructor( started = SharingStarted.Eagerly, initialValue = false, ) .dumpWhileCollecting("isOnGlanceableHubWithoutShade") .dumpValue("isOnGlanceableHubWithoutShade") /** Are we on the dream without the shade/qs? */ private val isDreamingWithoutShade: Flow<Boolean> = combine( keyguardTransitionInteractor.isFinishedInState(DREAMING), isAnyExpanded, ) { isDreaming, isAnyExpanded -> isDreaming && !isAnyExpanded } .stateIn( scope = applicationScope, started = SharingStarted.Eagerly, initialValue = false, ) .dumpValue("isDreamingWithoutShade") /** * Fade in if the user swipes the shade back up, not if collapsed by going to AOD. This is Loading Loading @@ -460,6 +476,7 @@ constructor( combineTransform( isOnGlanceableHubWithoutShade, isOnLockscreen, isDreamingWithoutShade, merge( lockscreenToGlanceableHubTransitionViewModel.notificationAlpha, glanceableHubToLockscreenTransitionViewModel.notificationAlpha, Loading @@ -467,9 +484,9 @@ constructor( // Manually emit on start because [notificationAlpha] only starts emitting // when transitions start. .onStart { emit(1f) } ) { isOnGlanceableHubWithoutShade, isOnLockscreen, alpha, ) { isOnGlanceableHubWithoutShade, isOnLockscreen, isDreamingWithoutShade, alpha, -> if (isOnGlanceableHubWithoutShade && !isOnLockscreen) { if ((isOnGlanceableHubWithoutShade || isDreamingWithoutShade) && !isOnLockscreen) { // Notifications should not be visible on the glanceable hub. // TODO(b/321075734): implement a way to actually set the notifications to // gone while on the hub instead of just adjusting alpha Loading @@ -484,6 +501,7 @@ constructor( emit(1f) } } .distinctUntilChanged() .dumpWhileCollecting("glanceableHubAlpha") /** Loading