Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainerTransitions.kt +13 −1 Original line number Diff line number Diff line Loading @@ -91,9 +91,21 @@ val SceneContainerTransitions = transitions { to(Overlays.NotificationsShade) { toNotificationsShadeTransition() } to(Overlays.QuickSettingsShade) { toQuickSettingsShadeTransition() } from(Overlays.NotificationsShade, Overlays.QuickSettingsShade) { from(Overlays.NotificationsShade, to = Overlays.QuickSettingsShade) { notificationsShadeToQuickSettingsShadeTransition() } from(Scenes.Gone, to = Overlays.NotificationsShade, key = SlightlyFasterShadeCollapse) { toNotificationsShadeTransition(durationScale = 0.9) } from(Scenes.Gone, to = Overlays.QuickSettingsShade, key = SlightlyFasterShadeCollapse) { toQuickSettingsShadeTransition(durationScale = 0.9) } from(Scenes.Lockscreen, to = Overlays.NotificationsShade, key = SlightlyFasterShadeCollapse) { toNotificationsShadeTransition(durationScale = 0.9) } from(Scenes.Lockscreen, to = Overlays.QuickSettingsShade, key = SlightlyFasterShadeCollapse) { toQuickSettingsShadeTransition(durationScale = 0.9) } // Scene overscroll Loading packages/SystemUI/multivalentTests/src/com/android/systemui/notifications/ui/viewmodel/NotificationsShadeOverlayContentViewModelTest.kt +4 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.notifications.ui.viewmodel import android.platform.test.annotations.EnableFlags import android.testing.TestableLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest Loading @@ -25,6 +26,7 @@ import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.kosmos.testScope import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.shade.shared.flag.DualShade import com.android.systemui.shade.ui.viewmodel.notificationsShadeOverlayContentViewModel import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat Loading @@ -36,13 +38,14 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) @TestableLooper.RunWithLooper @EnableSceneContainer @EnableFlags(DualShade.FLAG_NAME) class NotificationsShadeOverlayContentViewModelTest : SysuiTestCase() { private val kosmos = testKosmos() private val testScope = kosmos.testScope private val sceneInteractor = kosmos.sceneInteractor private val underTest = kosmos.notificationsShadeOverlayContentViewModel private val underTest by lazy { kosmos.notificationsShadeOverlayContentViewModel } @Test fun onScrimClicked_hidesShade() = Loading packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsShadeOverlayContentViewModelTest.kt +4 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.qs.ui.viewmodel import android.platform.test.annotations.EnableFlags import android.testing.TestableLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest Loading @@ -25,6 +26,7 @@ import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.kosmos.testScope import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.shade.shared.flag.DualShade import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest Loading @@ -35,13 +37,14 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) @TestableLooper.RunWithLooper @EnableSceneContainer @EnableFlags(DualShade.FLAG_NAME) class QuickSettingsShadeOverlayContentViewModelTest : SysuiTestCase() { private val kosmos = testKosmos() private val testScope = kosmos.testScope private val sceneInteractor = kosmos.sceneInteractor private val underTest = kosmos.quickSettingsShadeOverlayContentViewModel private val underTest by lazy { kosmos.quickSettingsShadeOverlayContentViewModel } @Test fun onScrimClicked_hidesShade() = Loading packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImplTest.kt +32 −2 Original line number Diff line number Diff line Loading @@ -287,7 +287,7 @@ class ShadeInteractorImplTest(flags: FlagsParameterization) : SysuiTestCase() { @Test fun anyExpansion_shadeGreater() = testScope.runTest() { testScope.runTest { // WHEN shade is more expanded than QS shadeTestUtil.setShadeAndQsExpansion(.5f, 0f) runCurrent() Loading @@ -298,7 +298,7 @@ class ShadeInteractorImplTest(flags: FlagsParameterization) : SysuiTestCase() { @Test fun anyExpansion_qsGreater() = testScope.runTest() { testScope.runTest { // WHEN qs is more expanded than shade shadeTestUtil.setShadeAndQsExpansion(0f, .5f) runCurrent() Loading @@ -307,6 +307,36 @@ class ShadeInteractorImplTest(flags: FlagsParameterization) : SysuiTestCase() { assertThat(underTest.anyExpansion.value).isEqualTo(.5f) } @Test fun isShadeAnyExpanded_shadeCollapsed() = testScope.runTest { val isShadeAnyExpanded by collectLastValue(underTest.isShadeAnyExpanded) shadeTestUtil.setShadeExpansion(0f) runCurrent() assertThat(isShadeAnyExpanded).isFalse() } @Test fun isShadeAnyExpanded_shadePartiallyExpanded() = testScope.runTest { val isShadeAnyExpanded by collectLastValue(underTest.isShadeAnyExpanded) shadeTestUtil.setShadeExpansion(0.01f) runCurrent() assertThat(isShadeAnyExpanded).isTrue() } @Test fun isShadeAnyExpanded_shadeFullyExpanded() = testScope.runTest { val isShadeAnyExpanded by collectLastValue(underTest.isShadeAnyExpanded) shadeTestUtil.setShadeExpansion(1f) runCurrent() assertThat(isShadeAnyExpanded).isTrue() } @Test fun isShadeTouchable_isFalse_whenDeviceAsleepAndNotPulsing() = testScope.runTest { Loading packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorLegacyImplTest.kt +41 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.Assert.assertThrows import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -382,4 +383,44 @@ class ShadeInteractorLegacyImplTest : SysuiTestCase() { // THEN user is not interacting assertThat(actual).isFalse() } @Test fun expandNotificationsShade_unsupported() = testScope.runTest { assertThrows(UnsupportedOperationException::class.java) { underTest.expandNotificationsShade("reason") } } @Test fun expandQuickSettingsShade_unsupported() = testScope.runTest { assertThrows(UnsupportedOperationException::class.java) { underTest.expandQuickSettingsShade("reason") } } @Test fun collapseNotificationsShade_unsupported() = testScope.runTest { assertThrows(UnsupportedOperationException::class.java) { underTest.collapseNotificationsShade("reason") } } @Test fun collapseQuickSettingsShade_unsupported() = testScope.runTest { assertThrows(UnsupportedOperationException::class.java) { underTest.collapseQuickSettingsShade("reason") } } @Test fun collapseEitherShade_unsupported() = testScope.runTest { assertThrows(UnsupportedOperationException::class.java) { underTest.collapseEitherShade("reason") } } } Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainerTransitions.kt +13 −1 Original line number Diff line number Diff line Loading @@ -91,9 +91,21 @@ val SceneContainerTransitions = transitions { to(Overlays.NotificationsShade) { toNotificationsShadeTransition() } to(Overlays.QuickSettingsShade) { toQuickSettingsShadeTransition() } from(Overlays.NotificationsShade, Overlays.QuickSettingsShade) { from(Overlays.NotificationsShade, to = Overlays.QuickSettingsShade) { notificationsShadeToQuickSettingsShadeTransition() } from(Scenes.Gone, to = Overlays.NotificationsShade, key = SlightlyFasterShadeCollapse) { toNotificationsShadeTransition(durationScale = 0.9) } from(Scenes.Gone, to = Overlays.QuickSettingsShade, key = SlightlyFasterShadeCollapse) { toQuickSettingsShadeTransition(durationScale = 0.9) } from(Scenes.Lockscreen, to = Overlays.NotificationsShade, key = SlightlyFasterShadeCollapse) { toNotificationsShadeTransition(durationScale = 0.9) } from(Scenes.Lockscreen, to = Overlays.QuickSettingsShade, key = SlightlyFasterShadeCollapse) { toQuickSettingsShadeTransition(durationScale = 0.9) } // Scene overscroll Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/notifications/ui/viewmodel/NotificationsShadeOverlayContentViewModelTest.kt +4 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.notifications.ui.viewmodel import android.platform.test.annotations.EnableFlags import android.testing.TestableLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest Loading @@ -25,6 +26,7 @@ import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.kosmos.testScope import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.shade.shared.flag.DualShade import com.android.systemui.shade.ui.viewmodel.notificationsShadeOverlayContentViewModel import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat Loading @@ -36,13 +38,14 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) @TestableLooper.RunWithLooper @EnableSceneContainer @EnableFlags(DualShade.FLAG_NAME) class NotificationsShadeOverlayContentViewModelTest : SysuiTestCase() { private val kosmos = testKosmos() private val testScope = kosmos.testScope private val sceneInteractor = kosmos.sceneInteractor private val underTest = kosmos.notificationsShadeOverlayContentViewModel private val underTest by lazy { kosmos.notificationsShadeOverlayContentViewModel } @Test fun onScrimClicked_hidesShade() = Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsShadeOverlayContentViewModelTest.kt +4 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.qs.ui.viewmodel import android.platform.test.annotations.EnableFlags import android.testing.TestableLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest Loading @@ -25,6 +26,7 @@ import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.kosmos.testScope import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.shade.shared.flag.DualShade import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest Loading @@ -35,13 +37,14 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) @TestableLooper.RunWithLooper @EnableSceneContainer @EnableFlags(DualShade.FLAG_NAME) class QuickSettingsShadeOverlayContentViewModelTest : SysuiTestCase() { private val kosmos = testKosmos() private val testScope = kosmos.testScope private val sceneInteractor = kosmos.sceneInteractor private val underTest = kosmos.quickSettingsShadeOverlayContentViewModel private val underTest by lazy { kosmos.quickSettingsShadeOverlayContentViewModel } @Test fun onScrimClicked_hidesShade() = Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImplTest.kt +32 −2 Original line number Diff line number Diff line Loading @@ -287,7 +287,7 @@ class ShadeInteractorImplTest(flags: FlagsParameterization) : SysuiTestCase() { @Test fun anyExpansion_shadeGreater() = testScope.runTest() { testScope.runTest { // WHEN shade is more expanded than QS shadeTestUtil.setShadeAndQsExpansion(.5f, 0f) runCurrent() Loading @@ -298,7 +298,7 @@ class ShadeInteractorImplTest(flags: FlagsParameterization) : SysuiTestCase() { @Test fun anyExpansion_qsGreater() = testScope.runTest() { testScope.runTest { // WHEN qs is more expanded than shade shadeTestUtil.setShadeAndQsExpansion(0f, .5f) runCurrent() Loading @@ -307,6 +307,36 @@ class ShadeInteractorImplTest(flags: FlagsParameterization) : SysuiTestCase() { assertThat(underTest.anyExpansion.value).isEqualTo(.5f) } @Test fun isShadeAnyExpanded_shadeCollapsed() = testScope.runTest { val isShadeAnyExpanded by collectLastValue(underTest.isShadeAnyExpanded) shadeTestUtil.setShadeExpansion(0f) runCurrent() assertThat(isShadeAnyExpanded).isFalse() } @Test fun isShadeAnyExpanded_shadePartiallyExpanded() = testScope.runTest { val isShadeAnyExpanded by collectLastValue(underTest.isShadeAnyExpanded) shadeTestUtil.setShadeExpansion(0.01f) runCurrent() assertThat(isShadeAnyExpanded).isTrue() } @Test fun isShadeAnyExpanded_shadeFullyExpanded() = testScope.runTest { val isShadeAnyExpanded by collectLastValue(underTest.isShadeAnyExpanded) shadeTestUtil.setShadeExpansion(1f) runCurrent() assertThat(isShadeAnyExpanded).isTrue() } @Test fun isShadeTouchable_isFalse_whenDeviceAsleepAndNotPulsing() = testScope.runTest { Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorLegacyImplTest.kt +41 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.Assert.assertThrows import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -382,4 +383,44 @@ class ShadeInteractorLegacyImplTest : SysuiTestCase() { // THEN user is not interacting assertThat(actual).isFalse() } @Test fun expandNotificationsShade_unsupported() = testScope.runTest { assertThrows(UnsupportedOperationException::class.java) { underTest.expandNotificationsShade("reason") } } @Test fun expandQuickSettingsShade_unsupported() = testScope.runTest { assertThrows(UnsupportedOperationException::class.java) { underTest.expandQuickSettingsShade("reason") } } @Test fun collapseNotificationsShade_unsupported() = testScope.runTest { assertThrows(UnsupportedOperationException::class.java) { underTest.collapseNotificationsShade("reason") } } @Test fun collapseQuickSettingsShade_unsupported() = testScope.runTest { assertThrows(UnsupportedOperationException::class.java) { underTest.collapseQuickSettingsShade("reason") } } @Test fun collapseEitherShade_unsupported() = testScope.runTest { assertThrows(UnsupportedOperationException::class.java) { underTest.collapseEitherShade("reason") } } }