Loading packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImplTest.kt +17 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ class ShadeInteractorImplTest : SysuiTestCase() { } @Test fun shadeExpansionWhenNotInSplitShadeAndQsExpanded() = fun shadeExpansionWhenNotInSplitShadeAndQsPartiallyExpanded() = testScope.runTest { val actual by collectLastValue(underTest.shadeExpansion) Loading @@ -337,6 +337,22 @@ class ShadeInteractorImplTest : SysuiTestCase() { shadeRepository.setLegacyShadeExpansion(1f) runCurrent() // THEN shade expansion is zero assertThat(actual).isEqualTo(.5f) } @Test fun shadeExpansionWhenNotInSplitShadeAndQsFullyExpanded() = testScope.runTest { val actual by collectLastValue(underTest.shadeExpansion) // WHEN split shade is not enabled and QS is expanded keyguardRepository.setStatusBarState(StatusBarState.SHADE) overrideResource(R.bool.config_use_split_notification_shade, false) shadeRepository.setQsExpansion(1f) shadeRepository.setLegacyShadeExpansion(1f) runCurrent() // THEN shade expansion is zero assertThat(actual).isEqualTo(0f) } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorLegacyImplTest.kt +22 −4 Original line number Diff line number Diff line Loading @@ -95,14 +95,14 @@ class ShadeInteractorLegacyImplTest : SysuiTestCase() { } @Test fun shadeExpansionWhenNotInSplitShadeAndQsExpanded() = fun shadeExpansionWhenNotInSplitShadeAndQsFullyExpanded() = testScope.runTest { val actual by collectLastValue(underTest.shadeExpansion) // WHEN split shade is not enabled and QS is expanded keyguardRepository.setStatusBarState(StatusBarState.SHADE) overrideResource(R.bool.config_use_split_notification_shade, false) shadeRepository.setQsExpansion(.5f) shadeRepository.setQsExpansion(1f) shadeRepository.setLegacyShadeExpansion(1f) runCurrent() Loading @@ -110,17 +110,35 @@ class ShadeInteractorLegacyImplTest : SysuiTestCase() { assertThat(actual).isEqualTo(0f) } @Test fun shadeExpansionWhenNotInSplitShadeAndQsPartlyExpanded() = testScope.runTest { val actual by collectLastValue(underTest.shadeExpansion) // WHEN split shade is not enabled and QS partly expanded keyguardRepository.setStatusBarState(StatusBarState.SHADE) overrideResource(R.bool.config_use_split_notification_shade, false) shadeRepository.setQsExpansion(.4f) shadeRepository.setLegacyShadeExpansion(1f) runCurrent() // THEN shade expansion is the difference assertThat(actual).isEqualTo(.6f) } @Test fun shadeExpansionWhenNotInSplitShadeAndQsCollapsed() = testScope.runTest { val actual by collectLastValue(underTest.shadeExpansion) // WHEN split shade is not enabled and QS is expanded // WHEN split shade is not enabled and QS collapsed keyguardRepository.setStatusBarState(StatusBarState.SHADE) overrideResource(R.bool.config_use_split_notification_shade, false) shadeRepository.setQsExpansion(0f) shadeRepository.setLegacyShadeExpansion(.6f) runCurrent() // THEN shade expansion is zero // THEN shade expansion is the legacy one assertThat(actual).isEqualTo(.6f) } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt +15 −0 Original line number Diff line number Diff line Loading @@ -482,6 +482,21 @@ class NotificationListViewModelTest : SysuiTestCase() { assertThat(shouldHide).isFalse() } @Test fun shouldHideFooterView_falseWhenQSPartiallyOpen() = testScope.runTest { val shouldHide by collectLastValue(underTest.shouldHideFooterView) // WHEN QS partially open fakeKeyguardRepository.setStatusBarState(StatusBarState.SHADE) fakeShadeRepository.setQsExpansion(0.5f) fakeShadeRepository.setLegacyShadeExpansion(0.5f) runCurrent() // THEN footer is hidden assertThat(shouldHide).isFalse() } @Test @EnableFlags(NotificationsHeadsUpRefactor.FLAG_NAME) fun pinnedHeadsUpRows_filtersForPinnedItems() = Loading packages/SystemUI/src/com/android/systemui/shade/QuickSettingsControllerImpl.java +14 −2 Original line number Diff line number Diff line Loading @@ -965,14 +965,21 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum } } void updateQsState() { boolean qsFullScreen = getExpanded() && !mSplitShadeEnabled; private void setQsFullScreen(boolean qsFullScreen) { mShadeRepository.setLegacyQsFullscreen(qsFullScreen); mNotificationStackScrollLayoutController.setQsFullScreen(qsFullScreen); if (!SceneContainerFlag.isEnabled()) { mNotificationStackScrollLayoutController.setScrollingEnabled( mBarState != KEYGUARD && (!qsFullScreen || mExpansionFromOverscroll)); } } void updateQsState() { if (!FooterViewRefactor.isEnabled()) { // Update full screen state; note that this will be true if the QS panel is only // partially expanded, and that is fixed with the footer view refactor. setQsFullScreen(/* qsFullScreen = */ getExpanded() && !mSplitShadeEnabled); } if (mQsStateUpdateListener != null) { mQsStateUpdateListener.onQsStateUpdated(getExpanded(), mStackScrollerOverscrolling); Loading Loading @@ -1035,6 +1042,11 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum // Update the light bar mLightBarController.setQsExpanded(mFullyExpanded); if (FooterViewRefactor.isEnabled()) { // Update full screen state setQsFullScreen(/* qsFullScreen = */ mFullyExpanded && !mSplitShadeEnabled); } } float getLockscreenShadeDragProgress() { Loading packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorLegacyImpl.kt +2 −1 Original line number Diff line number Diff line Loading @@ -66,7 +66,8 @@ constructor( when (statusBarState) { // legacyShadeExpansion is 1 instead of 0 when QS is expanded StatusBarState.SHADE -> if (!splitShadeEnabled && qsExpansion > 0f) 0f else legacyShadeExpansion if (!splitShadeEnabled && qsExpansion > 0f) 1f - qsExpansion else legacyShadeExpansion StatusBarState.KEYGUARD -> lockscreenShadeExpansion // dragDownAmount, which drives lockscreenShadeExpansion resets to 0f when // the pointer is lifted and the lockscreen shade is fully expanded Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImplTest.kt +17 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ class ShadeInteractorImplTest : SysuiTestCase() { } @Test fun shadeExpansionWhenNotInSplitShadeAndQsExpanded() = fun shadeExpansionWhenNotInSplitShadeAndQsPartiallyExpanded() = testScope.runTest { val actual by collectLastValue(underTest.shadeExpansion) Loading @@ -337,6 +337,22 @@ class ShadeInteractorImplTest : SysuiTestCase() { shadeRepository.setLegacyShadeExpansion(1f) runCurrent() // THEN shade expansion is zero assertThat(actual).isEqualTo(.5f) } @Test fun shadeExpansionWhenNotInSplitShadeAndQsFullyExpanded() = testScope.runTest { val actual by collectLastValue(underTest.shadeExpansion) // WHEN split shade is not enabled and QS is expanded keyguardRepository.setStatusBarState(StatusBarState.SHADE) overrideResource(R.bool.config_use_split_notification_shade, false) shadeRepository.setQsExpansion(1f) shadeRepository.setLegacyShadeExpansion(1f) runCurrent() // THEN shade expansion is zero assertThat(actual).isEqualTo(0f) } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorLegacyImplTest.kt +22 −4 Original line number Diff line number Diff line Loading @@ -95,14 +95,14 @@ class ShadeInteractorLegacyImplTest : SysuiTestCase() { } @Test fun shadeExpansionWhenNotInSplitShadeAndQsExpanded() = fun shadeExpansionWhenNotInSplitShadeAndQsFullyExpanded() = testScope.runTest { val actual by collectLastValue(underTest.shadeExpansion) // WHEN split shade is not enabled and QS is expanded keyguardRepository.setStatusBarState(StatusBarState.SHADE) overrideResource(R.bool.config_use_split_notification_shade, false) shadeRepository.setQsExpansion(.5f) shadeRepository.setQsExpansion(1f) shadeRepository.setLegacyShadeExpansion(1f) runCurrent() Loading @@ -110,17 +110,35 @@ class ShadeInteractorLegacyImplTest : SysuiTestCase() { assertThat(actual).isEqualTo(0f) } @Test fun shadeExpansionWhenNotInSplitShadeAndQsPartlyExpanded() = testScope.runTest { val actual by collectLastValue(underTest.shadeExpansion) // WHEN split shade is not enabled and QS partly expanded keyguardRepository.setStatusBarState(StatusBarState.SHADE) overrideResource(R.bool.config_use_split_notification_shade, false) shadeRepository.setQsExpansion(.4f) shadeRepository.setLegacyShadeExpansion(1f) runCurrent() // THEN shade expansion is the difference assertThat(actual).isEqualTo(.6f) } @Test fun shadeExpansionWhenNotInSplitShadeAndQsCollapsed() = testScope.runTest { val actual by collectLastValue(underTest.shadeExpansion) // WHEN split shade is not enabled and QS is expanded // WHEN split shade is not enabled and QS collapsed keyguardRepository.setStatusBarState(StatusBarState.SHADE) overrideResource(R.bool.config_use_split_notification_shade, false) shadeRepository.setQsExpansion(0f) shadeRepository.setLegacyShadeExpansion(.6f) runCurrent() // THEN shade expansion is zero // THEN shade expansion is the legacy one assertThat(actual).isEqualTo(.6f) } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt +15 −0 Original line number Diff line number Diff line Loading @@ -482,6 +482,21 @@ class NotificationListViewModelTest : SysuiTestCase() { assertThat(shouldHide).isFalse() } @Test fun shouldHideFooterView_falseWhenQSPartiallyOpen() = testScope.runTest { val shouldHide by collectLastValue(underTest.shouldHideFooterView) // WHEN QS partially open fakeKeyguardRepository.setStatusBarState(StatusBarState.SHADE) fakeShadeRepository.setQsExpansion(0.5f) fakeShadeRepository.setLegacyShadeExpansion(0.5f) runCurrent() // THEN footer is hidden assertThat(shouldHide).isFalse() } @Test @EnableFlags(NotificationsHeadsUpRefactor.FLAG_NAME) fun pinnedHeadsUpRows_filtersForPinnedItems() = Loading
packages/SystemUI/src/com/android/systemui/shade/QuickSettingsControllerImpl.java +14 −2 Original line number Diff line number Diff line Loading @@ -965,14 +965,21 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum } } void updateQsState() { boolean qsFullScreen = getExpanded() && !mSplitShadeEnabled; private void setQsFullScreen(boolean qsFullScreen) { mShadeRepository.setLegacyQsFullscreen(qsFullScreen); mNotificationStackScrollLayoutController.setQsFullScreen(qsFullScreen); if (!SceneContainerFlag.isEnabled()) { mNotificationStackScrollLayoutController.setScrollingEnabled( mBarState != KEYGUARD && (!qsFullScreen || mExpansionFromOverscroll)); } } void updateQsState() { if (!FooterViewRefactor.isEnabled()) { // Update full screen state; note that this will be true if the QS panel is only // partially expanded, and that is fixed with the footer view refactor. setQsFullScreen(/* qsFullScreen = */ getExpanded() && !mSplitShadeEnabled); } if (mQsStateUpdateListener != null) { mQsStateUpdateListener.onQsStateUpdated(getExpanded(), mStackScrollerOverscrolling); Loading Loading @@ -1035,6 +1042,11 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum // Update the light bar mLightBarController.setQsExpanded(mFullyExpanded); if (FooterViewRefactor.isEnabled()) { // Update full screen state setQsFullScreen(/* qsFullScreen = */ mFullyExpanded && !mSplitShadeEnabled); } } float getLockscreenShadeDragProgress() { Loading
packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorLegacyImpl.kt +2 −1 Original line number Diff line number Diff line Loading @@ -66,7 +66,8 @@ constructor( when (statusBarState) { // legacyShadeExpansion is 1 instead of 0 when QS is expanded StatusBarState.SHADE -> if (!splitShadeEnabled && qsExpansion > 0f) 0f else legacyShadeExpansion if (!splitShadeEnabled && qsExpansion > 0f) 1f - qsExpansion else legacyShadeExpansion StatusBarState.KEYGUARD -> lockscreenShadeExpansion // dragDownAmount, which drives lockscreenShadeExpansion resets to 0f when // the pointer is lifted and the lockscreen shade is fully expanded Loading