summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt1
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneViewModelTest.kt20
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneViewModel.kt12
3 files changed, 14 insertions, 19 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt
index efbdb7d466d1..4d22383bd2a4 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt
@@ -261,6 +261,7 @@ class SceneFrameworkIntegrationTest : SysuiTestCase() {
shadeInteractor = kosmos.shadeInteractor,
footerActionsController = kosmos.footerActionsController,
footerActionsViewModelFactory = kosmos.footerActionsViewModelFactory,
+ sceneInteractor = sceneInteractor,
)
kosmos.fakeDeviceEntryRepository.setUnlocked(false)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneViewModelTest.kt
index f90a3b14f968..1d6b22309579 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneViewModelTest.kt
@@ -129,6 +129,7 @@ class ShadeSceneViewModelTest : SysuiTestCase() {
shadeInteractor = kosmos.shadeInteractor,
footerActionsViewModelFactory = kosmos.footerActionsViewModelFactory,
footerActionsController = kosmos.footerActionsController,
+ sceneInteractor = kosmos.sceneInteractor,
)
}
@@ -215,22 +216,7 @@ class ShadeSceneViewModelTest : SysuiTestCase() {
}
@Test
- fun onContentClicked_deviceUnlocked_switchesToGone() =
- testScope.runTest {
- val currentScene by collectLastValue(sceneInteractor.currentScene)
- kosmos.fakeAuthenticationRepository.setAuthenticationMethod(
- AuthenticationMethodModel.Pin
- )
- kosmos.fakeDeviceEntryRepository.setUnlocked(true)
- runCurrent()
-
- underTest.onContentClicked()
-
- assertThat(currentScene).isEqualTo(Scenes.Gone)
- }
-
- @Test
- fun onContentClicked_deviceLockedSecurely_switchesToBouncer() =
+ fun onContentClicked_deviceLockedSecurely_switchesToLockscreen() =
testScope.runTest {
val currentScene by collectLastValue(sceneInteractor.currentScene)
kosmos.fakeAuthenticationRepository.setAuthenticationMethod(
@@ -241,7 +227,7 @@ class ShadeSceneViewModelTest : SysuiTestCase() {
underTest.onContentClicked()
- assertThat(currentScene).isEqualTo(Scenes.Bouncer)
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
}
@Test
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneViewModel.kt b/packages/SystemUI/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneViewModel.kt
index 24b7533d6c26..9362cd058929 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneViewModel.kt
@@ -31,6 +31,7 @@ import com.android.systemui.media.controls.domain.pipeline.MediaDataManager
import com.android.systemui.qs.FooterActionsController
import com.android.systemui.qs.footer.ui.viewmodel.FooterActionsViewModel
import com.android.systemui.qs.ui.adapter.QSSceneAdapter
+import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.shared.model.ShadeMode
@@ -52,7 +53,7 @@ class ShadeSceneViewModel
@Inject
constructor(
@Application private val applicationScope: CoroutineScope,
- private val deviceEntryInteractor: DeviceEntryInteractor,
+ deviceEntryInteractor: DeviceEntryInteractor,
val qsSceneAdapter: QSSceneAdapter,
val shadeHeaderViewModel: ShadeHeaderViewModel,
val notifications: NotificationsPlaceholderViewModel,
@@ -60,6 +61,7 @@ constructor(
shadeInteractor: ShadeInteractor,
private val footerActionsViewModelFactory: FooterActionsViewModel.Factory,
private val footerActionsController: FooterActionsController,
+ private val sceneInteractor: SceneInteractor,
) {
val destinationScenes: StateFlow<Map<UserAction, UserActionResult>> =
combine(
@@ -103,7 +105,13 @@ constructor(
val shadeMode: StateFlow<ShadeMode> = shadeInteractor.shadeMode
/** Notifies that some content in the shade was clicked. */
- fun onContentClicked() = deviceEntryInteractor.attemptDeviceEntry()
+ fun onContentClicked() {
+ if (!isClickable.value) {
+ return
+ }
+
+ sceneInteractor.changeScene(Scenes.Lockscreen, "Shade empty content clicked")
+ }
fun isMediaVisible(): Boolean {
// TODO(b/296122467): handle updates to carousel visibility while scene is still visible