Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainer.kt +10 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.scene.ui.composable import androidx.compose.foundation.gestures.awaitEachGesture import androidx.compose.foundation.gestures.awaitFirstDown import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.Text Loading @@ -28,6 +30,7 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.input.pointer.pointerInput import com.android.compose.animation.scene.MutableSceneTransitionLayoutState import com.android.compose.animation.scene.SceneKey import com.android.compose.animation.scene.SceneTransitionLayout Loading Loading @@ -100,7 +103,13 @@ fun SceneContainer( } Box( modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize().pointerInput(Unit) { awaitEachGesture { awaitFirstDown(false) viewModel.onSceneContainerUserInputStarted() } }, ) { SceneTransitionLayout(state = state, modifier = modifier.fillMaxSize()) { sceneByKey.forEach { (sceneKey, composableScene) -> Loading packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -401,10 +401,10 @@ class SceneInteractorTest : SysuiTestCase() { underTest.setVisible(false, "reason") val isVisible by collectLastValue(underTest.isVisible) assertThat(isVisible).isFalse() underTest.onRemoteUserInteractionStarted("reason") underTest.onRemoteUserInputStarted("reason") assertThat(isVisible).isTrue() underTest.onUserInteractionFinished() underTest.onUserInputFinished() assertThat(isVisible).isFalse() } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModelTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -237,7 +237,7 @@ class SceneContainerViewModelTest : SysuiTestCase() { sceneInteractor.setVisible(false, "reason") runCurrent() assertThat(underTest.isVisible).isFalse() sceneInteractor.onRemoteUserInteractionStarted("reason") sceneInteractor.onRemoteUserInputStarted("reason") runCurrent() assertThat(underTest.isVisible).isTrue() Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/NotificationStackAppearanceInteractorTest.kt +45 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.kosmos.testScope import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.shade.data.repository.shadeRepository import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimRounding Loading Loading @@ -84,4 +85,48 @@ class NotificationStackAppearanceInteractorTest : SysuiTestCase() { ) ) } @Test fun shouldCloseGuts_userInputOngoing_currentGestureInGuts() = testScope.runTest { val shouldCloseGuts by collectLastValue(underTest.shouldCloseGuts) kosmos.sceneInteractor.onSceneContainerUserInputStarted() underTest.setCurrentGestureInGuts(true) assertThat(shouldCloseGuts).isFalse() } @Test fun shouldCloseGuts_userInputOngoing_currentGestureNotInGuts() = testScope.runTest { val shouldCloseGuts by collectLastValue(underTest.shouldCloseGuts) kosmos.sceneInteractor.onSceneContainerUserInputStarted() underTest.setCurrentGestureInGuts(false) assertThat(shouldCloseGuts).isTrue() } @Test fun shouldCloseGuts_userInputNotOngoing_currentGestureInGuts() = testScope.runTest { val shouldCloseGuts by collectLastValue(underTest.shouldCloseGuts) kosmos.sceneInteractor.onUserInputFinished() underTest.setCurrentGestureInGuts(true) assertThat(shouldCloseGuts).isFalse() } @Test fun shouldCloseGuts_userInputNotOngoing_currentGestureNotInGuts() = testScope.runTest { val shouldCloseGuts by collectLastValue(underTest.shouldCloseGuts) kosmos.sceneInteractor.onUserInputFinished() underTest.setCurrentGestureInGuts(false) assertThat(shouldCloseGuts).isFalse() } } packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +2 −2 Original line number Diff line number Diff line Loading @@ -230,7 +230,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // If scene framework is enabled, set the scene container window to // visible and let the touch "slip" into that window. if (SceneContainerFlag.isEnabled()) { mSceneInteractor.get().onRemoteUserInteractionStarted("launcher swipe"); mSceneInteractor.get().onRemoteUserInputStarted("launcher swipe"); } else { mShadeViewControllerLazy.get().startInputFocusTransfer(); } Loading Loading @@ -266,7 +266,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis if (SceneContainerFlag.isEnabled()) { int action = event.getActionMasked(); if (action == ACTION_DOWN) { mSceneInteractor.get().onRemoteUserInteractionStarted( mSceneInteractor.get().onRemoteUserInputStarted( "trackpad swipe"); } else if (action == ACTION_UP) { mSceneInteractor.get().changeScene( Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainer.kt +10 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.scene.ui.composable import androidx.compose.foundation.gestures.awaitEachGesture import androidx.compose.foundation.gestures.awaitFirstDown import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.Text Loading @@ -28,6 +30,7 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.input.pointer.pointerInput import com.android.compose.animation.scene.MutableSceneTransitionLayoutState import com.android.compose.animation.scene.SceneKey import com.android.compose.animation.scene.SceneTransitionLayout Loading Loading @@ -100,7 +103,13 @@ fun SceneContainer( } Box( modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize().pointerInput(Unit) { awaitEachGesture { awaitFirstDown(false) viewModel.onSceneContainerUserInputStarted() } }, ) { SceneTransitionLayout(state = state, modifier = modifier.fillMaxSize()) { sceneByKey.forEach { (sceneKey, composableScene) -> Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -401,10 +401,10 @@ class SceneInteractorTest : SysuiTestCase() { underTest.setVisible(false, "reason") val isVisible by collectLastValue(underTest.isVisible) assertThat(isVisible).isFalse() underTest.onRemoteUserInteractionStarted("reason") underTest.onRemoteUserInputStarted("reason") assertThat(isVisible).isTrue() underTest.onUserInteractionFinished() underTest.onUserInputFinished() assertThat(isVisible).isFalse() } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModelTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -237,7 +237,7 @@ class SceneContainerViewModelTest : SysuiTestCase() { sceneInteractor.setVisible(false, "reason") runCurrent() assertThat(underTest.isVisible).isFalse() sceneInteractor.onRemoteUserInteractionStarted("reason") sceneInteractor.onRemoteUserInputStarted("reason") runCurrent() assertThat(underTest.isVisible).isTrue() Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/NotificationStackAppearanceInteractorTest.kt +45 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.kosmos.testScope import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.shade.data.repository.shadeRepository import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimRounding Loading Loading @@ -84,4 +85,48 @@ class NotificationStackAppearanceInteractorTest : SysuiTestCase() { ) ) } @Test fun shouldCloseGuts_userInputOngoing_currentGestureInGuts() = testScope.runTest { val shouldCloseGuts by collectLastValue(underTest.shouldCloseGuts) kosmos.sceneInteractor.onSceneContainerUserInputStarted() underTest.setCurrentGestureInGuts(true) assertThat(shouldCloseGuts).isFalse() } @Test fun shouldCloseGuts_userInputOngoing_currentGestureNotInGuts() = testScope.runTest { val shouldCloseGuts by collectLastValue(underTest.shouldCloseGuts) kosmos.sceneInteractor.onSceneContainerUserInputStarted() underTest.setCurrentGestureInGuts(false) assertThat(shouldCloseGuts).isTrue() } @Test fun shouldCloseGuts_userInputNotOngoing_currentGestureInGuts() = testScope.runTest { val shouldCloseGuts by collectLastValue(underTest.shouldCloseGuts) kosmos.sceneInteractor.onUserInputFinished() underTest.setCurrentGestureInGuts(true) assertThat(shouldCloseGuts).isFalse() } @Test fun shouldCloseGuts_userInputNotOngoing_currentGestureNotInGuts() = testScope.runTest { val shouldCloseGuts by collectLastValue(underTest.shouldCloseGuts) kosmos.sceneInteractor.onUserInputFinished() underTest.setCurrentGestureInGuts(false) assertThat(shouldCloseGuts).isFalse() } }
packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +2 −2 Original line number Diff line number Diff line Loading @@ -230,7 +230,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // If scene framework is enabled, set the scene container window to // visible and let the touch "slip" into that window. if (SceneContainerFlag.isEnabled()) { mSceneInteractor.get().onRemoteUserInteractionStarted("launcher swipe"); mSceneInteractor.get().onRemoteUserInputStarted("launcher swipe"); } else { mShadeViewControllerLazy.get().startInputFocusTransfer(); } Loading Loading @@ -266,7 +266,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis if (SceneContainerFlag.isEnabled()) { int action = event.getActionMasked(); if (action == ACTION_DOWN) { mSceneInteractor.get().onRemoteUserInteractionStarted( mSceneInteractor.get().onRemoteUserInputStarted( "trackpad swipe"); } else if (action == ACTION_UP) { mSceneInteractor.get().changeScene( Loading