diff options
| author | 2024-05-17 16:59:19 +0000 | |
|---|---|---|
| committer | 2024-05-21 18:26:27 +0000 | |
| commit | 9cb59d20a67ef6ee435c72b7b31f5fc1b2fb03cc (patch) | |
| tree | 524154cacdf2dc5d42081863e84bf61d05ce26ab | |
| parent | c7daf2680fb1be2c1b39766c791d0f122838143c (diff) | |
Udate sources for determining NSSL.headsUpAnimationsEnabled
Rely on the StatusBarState, and the isShadeFullyCollapsed signal to
match previous behavior before the refactor.
Bug: 325936094
Test: observe HUN intro/outro animations
Flag: ACONFIG com.android.systemui.notifications_heads_up_refactor
STAGING
Change-Id: Ie7a86a3d37a4c985ea7dbfe82e80210b3cd5a1ac
3 files changed, 8 insertions, 11 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt index f6f84c7df399..9fde116e968c 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt @@ -607,7 +607,7 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas val animationsEnabled by collectLastValue(underTest.headsUpAnimationsEnabled) shadeTestUtil.setQsExpansion(0.0f) - fakeKeyguardRepository.setKeyguardShowing(false) + fakeKeyguardRepository.setStatusBarState(StatusBarState.SHADE) runCurrent() assertThat(animationsEnabled).isTrue() @@ -620,7 +620,7 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas val animationsEnabled by collectLastValue(underTest.headsUpAnimationsEnabled) shadeTestUtil.setQsExpansion(0.0f) - fakeKeyguardRepository.setKeyguardShowing(true) + fakeKeyguardRepository.setStatusBarState(StatusBarState.KEYGUARD) runCurrent() assertThat(animationsEnabled).isFalse() diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt index 3a89630ebe77..b54f9c4c6d32 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt @@ -18,7 +18,6 @@ package com.android.systemui.statusbar.notification.stack.ui.viewmodel import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dump.DumpManager -import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.statusbar.domain.interactor.RemoteInputInteractor import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor @@ -59,7 +58,6 @@ constructor( activeNotificationsInteractor: ActiveNotificationsInteractor, notificationStackInteractor: NotificationStackInteractor, private val headsUpNotificationInteractor: HeadsUpNotificationInteractor, - keyguardInteractor: KeyguardInteractor, remoteInputInteractor: RemoteInputInteractor, seenNotificationsInteractor: SeenNotificationsInteractor, shadeInteractor: ShadeInteractor, @@ -277,11 +275,12 @@ constructor( if (NotificationsHeadsUpRefactor.isUnexpectedlyInLegacyMode()) { flowOf(false) } else { - combine(keyguardInteractor.isKeyguardShowing, shadeInteractor.isShadeFullyExpanded) { - (isKeyguardShowing, isShadeFullyExpanded) -> - // TODO(b/325936094) use isShadeFullyCollapsed instead - !isKeyguardShowing && !isShadeFullyExpanded - } + combine( + notificationStackInteractor.isShowingOnLockscreen, + shadeInteractor.isShadeFullyCollapsed + ) { (isKeyguardShowing, isShadeFullyCollapsed) -> + !isKeyguardShowing && isShadeFullyCollapsed + } .dumpWhileCollecting("headsUpAnimationsEnabled") } } diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelKosmos.kt index 94f6ecd36c7c..de8b3500a88a 100644 --- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelKosmos.kt +++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelKosmos.kt @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.notification.stack.ui.viewmodel import com.android.systemui.dump.dumpManager -import com.android.systemui.keyguard.domain.interactor.keyguardInteractor import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.Kosmos.Fixture import com.android.systemui.kosmos.testDispatcher @@ -42,7 +41,6 @@ val Kosmos.notificationListViewModel by Fixture { activeNotificationsInteractor, notificationStackInteractor, headsUpNotificationInteractor, - keyguardInteractor, remoteInputInteractor, seenNotificationsInteractor, shadeInteractor, |