Loading packages/SystemUI/multivalentTests/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorControllerTest.kt +14 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import com.android.systemui.coroutines.collectLastValue import com.android.systemui.kosmos.testScope import com.android.systemui.testKosmos import com.google.common.truth.Truth import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.advanceTimeBy import kotlinx.coroutines.test.runTest import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue Loading @@ -35,6 +37,7 @@ import org.junit.runner.RunWith import org.mockito.kotlin.mock import org.mockito.kotlin.verify @ExperimentalCoroutinesApi @SmallTest @RunWith(AndroidJUnit4::class) class CommunalTransitionAnimatorControllerTest : SysuiTestCase() { Loading Loading @@ -67,7 +70,7 @@ class CommunalTransitionAnimatorControllerTest : SysuiTestCase() { } @Test fun animationCancelled_launchingWidgetStateIsClearedAndSceneIsNotChanged() { fun animationCancelled_launchingWidgetStateIsCleared() { with(kosmos) { testScope.runTest { val launching by collectLastValue(communalSceneInteractor.isLaunchingWidget) Loading @@ -82,9 +85,12 @@ class CommunalTransitionAnimatorControllerTest : SysuiTestCase() { assertTrue(launching!!) verify(controller).onIntentStarted(willAnimate = true) underTest.onTransitionAnimationStart(isExpandingFullyAbove = true) assertTrue(launching!!) verify(controller).onTransitionAnimationStart(isExpandingFullyAbove = true) underTest.onTransitionAnimationCancelled(newKeyguardOccludedState = true) assertFalse(launching!!) Truth.assertThat(scene).isEqualTo(CommunalScenes.Communal) verify(controller).onTransitionAnimationCancelled(newKeyguardOccludedState = true) } } Loading @@ -106,6 +112,12 @@ class CommunalTransitionAnimatorControllerTest : SysuiTestCase() { assertTrue(launching!!) verify(controller).onIntentStarted(willAnimate = true) underTest.onTransitionAnimationStart(isExpandingFullyAbove = true) assertTrue(launching!!) verify(controller).onTransitionAnimationStart(isExpandingFullyAbove = true) testScope.advanceTimeBy(ActivityTransitionAnimator.TIMINGS.totalDuration) underTest.onTransitionAnimationEnd(isExpandingFullyAbove = true) assertFalse(launching!!) Truth.assertThat(scene).isEqualTo(CommunalScenes.Blank) Loading packages/SystemUI/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorController.kt +9 −1 Original line number Diff line number Diff line Loading @@ -37,13 +37,21 @@ class CommunalTransitionAnimatorController( delegate.onIntentStarted(willAnimate) } override fun onTransitionAnimationStart(isExpandingFullyAbove: Boolean) { delegate.onTransitionAnimationStart(isExpandingFullyAbove) // TODO(b/330672236): move this to onTransitionAnimationEnd() without the delay. communalSceneInteractor.snapToScene( CommunalScenes.Blank, ActivityTransitionAnimator.TIMINGS.totalDuration ) } override fun onTransitionAnimationCancelled(newKeyguardOccludedState: Boolean?) { communalSceneInteractor.setIsLaunchingWidget(false) delegate.onTransitionAnimationCancelled(newKeyguardOccludedState) } override fun onTransitionAnimationEnd(isExpandingFullyAbove: Boolean) { communalSceneInteractor.snapToScene(CommunalScenes.Blank) communalSceneInteractor.setIsLaunchingWidget(false) delegate.onTransitionAnimationEnd(isExpandingFullyAbove) } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyActivityStarterInternalImpl.kt +0 −7 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import com.android.systemui.assist.AssistManager import com.android.systemui.camera.CameraIntents import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor import com.android.systemui.communal.shared.model.CommunalScenes import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.DisplayId import com.android.systemui.dagger.qualifiers.Main Loading Loading @@ -576,12 +575,6 @@ constructor( override fun onTransitionAnimationStart(isExpandingFullyAbove: Boolean) { super.onTransitionAnimationStart(isExpandingFullyAbove) if (communalSettingsInteractor.isCommunalFlagEnabled()) { communalSceneInteractor.snapToScene( CommunalScenes.Blank, ActivityTransitionAnimator.TIMINGS.totalDuration ) } // Double check that the keyguard is still showing and not going // away, but if so set the keyguard occluded. Typically, WM will let // KeyguardViewMediator know directly, but we're overriding that to Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorControllerTest.kt +14 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import com.android.systemui.coroutines.collectLastValue import com.android.systemui.kosmos.testScope import com.android.systemui.testKosmos import com.google.common.truth.Truth import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.advanceTimeBy import kotlinx.coroutines.test.runTest import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue Loading @@ -35,6 +37,7 @@ import org.junit.runner.RunWith import org.mockito.kotlin.mock import org.mockito.kotlin.verify @ExperimentalCoroutinesApi @SmallTest @RunWith(AndroidJUnit4::class) class CommunalTransitionAnimatorControllerTest : SysuiTestCase() { Loading Loading @@ -67,7 +70,7 @@ class CommunalTransitionAnimatorControllerTest : SysuiTestCase() { } @Test fun animationCancelled_launchingWidgetStateIsClearedAndSceneIsNotChanged() { fun animationCancelled_launchingWidgetStateIsCleared() { with(kosmos) { testScope.runTest { val launching by collectLastValue(communalSceneInteractor.isLaunchingWidget) Loading @@ -82,9 +85,12 @@ class CommunalTransitionAnimatorControllerTest : SysuiTestCase() { assertTrue(launching!!) verify(controller).onIntentStarted(willAnimate = true) underTest.onTransitionAnimationStart(isExpandingFullyAbove = true) assertTrue(launching!!) verify(controller).onTransitionAnimationStart(isExpandingFullyAbove = true) underTest.onTransitionAnimationCancelled(newKeyguardOccludedState = true) assertFalse(launching!!) Truth.assertThat(scene).isEqualTo(CommunalScenes.Communal) verify(controller).onTransitionAnimationCancelled(newKeyguardOccludedState = true) } } Loading @@ -106,6 +112,12 @@ class CommunalTransitionAnimatorControllerTest : SysuiTestCase() { assertTrue(launching!!) verify(controller).onIntentStarted(willAnimate = true) underTest.onTransitionAnimationStart(isExpandingFullyAbove = true) assertTrue(launching!!) verify(controller).onTransitionAnimationStart(isExpandingFullyAbove = true) testScope.advanceTimeBy(ActivityTransitionAnimator.TIMINGS.totalDuration) underTest.onTransitionAnimationEnd(isExpandingFullyAbove = true) assertFalse(launching!!) Truth.assertThat(scene).isEqualTo(CommunalScenes.Blank) Loading
packages/SystemUI/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorController.kt +9 −1 Original line number Diff line number Diff line Loading @@ -37,13 +37,21 @@ class CommunalTransitionAnimatorController( delegate.onIntentStarted(willAnimate) } override fun onTransitionAnimationStart(isExpandingFullyAbove: Boolean) { delegate.onTransitionAnimationStart(isExpandingFullyAbove) // TODO(b/330672236): move this to onTransitionAnimationEnd() without the delay. communalSceneInteractor.snapToScene( CommunalScenes.Blank, ActivityTransitionAnimator.TIMINGS.totalDuration ) } override fun onTransitionAnimationCancelled(newKeyguardOccludedState: Boolean?) { communalSceneInteractor.setIsLaunchingWidget(false) delegate.onTransitionAnimationCancelled(newKeyguardOccludedState) } override fun onTransitionAnimationEnd(isExpandingFullyAbove: Boolean) { communalSceneInteractor.snapToScene(CommunalScenes.Blank) communalSceneInteractor.setIsLaunchingWidget(false) delegate.onTransitionAnimationEnd(isExpandingFullyAbove) } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyActivityStarterInternalImpl.kt +0 −7 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import com.android.systemui.assist.AssistManager import com.android.systemui.camera.CameraIntents import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor import com.android.systemui.communal.shared.model.CommunalScenes import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.DisplayId import com.android.systemui.dagger.qualifiers.Main Loading Loading @@ -576,12 +575,6 @@ constructor( override fun onTransitionAnimationStart(isExpandingFullyAbove: Boolean) { super.onTransitionAnimationStart(isExpandingFullyAbove) if (communalSettingsInteractor.isCommunalFlagEnabled()) { communalSceneInteractor.snapToScene( CommunalScenes.Blank, ActivityTransitionAnimator.TIMINGS.totalDuration ) } // Double check that the keyguard is still showing and not going // away, but if so set the keyguard occluded. Typically, WM will let // KeyguardViewMediator know directly, but we're overriding that to Loading