Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/RemoteTransitionHandler.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.wm.shell.transition; import static com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary; import static com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived; import android.annotation.NonNull; import android.annotation.Nullable; Loading Loading @@ -257,7 +257,7 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler { @Override public Transitions.TransitionHandler getHandlerForTakeover( @NonNull IBinder transition, @NonNull TransitionInfo info) { if (!returnAnimationFrameworkLibrary()) { if (!returnAnimationFrameworkLongLived()) { return null; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +2 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ import static android.window.TransitionInfo.FLAG_IS_WALLPAPER; import static android.window.TransitionInfo.FLAG_NO_ANIMATION; import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT; import static com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary; import static com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived; import static com.android.window.flags.Flags.ensureWallpaperInTransitions; import static com.android.window.flags.Flags.migratePredictiveBackTransition; import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_SHELL_TRANSITIONS; Loading Loading @@ -1252,7 +1252,7 @@ public class Transitions implements RemoteCallable<Transitions>, @Nullable public TransitionHandler getHandlerForTakeover( @NonNull IBinder transition, @NonNull TransitionInfo info) { if (!returnAnimationFrameworkLibrary()) { if (!returnAnimationFrameworkLongLived()) { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "Trying to get a handler for takeover but the flag is disabled"); return null; Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -557,7 +557,7 @@ public class ShellTransitionTests extends ShellTestCase { mMainExecutor.flushAll(); // Takeover shouldn't happen when the flag is disabled. setFlagsRule.disableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY); setFlagsRule.disableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED); IBinder transitToken = new Binder(); transitions.requestStartTransition(transitToken, new TransitionRequestInfo(TRANSIT_OPEN, null /* trigger */, null /* remote */)); Loading @@ -572,7 +572,7 @@ public class ShellTransitionTests extends ShellTestCase { verify(mOrganizer, times(1)).finishTransition(eq(transitToken), any()); // Takeover should happen when the flag is enabled. setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY); setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED); transitions.requestStartTransition(transitToken, new TransitionRequestInfo(TRANSIT_OPEN, null /* trigger */, null /* remote */)); info = new TransitionInfoBuilder(TRANSIT_OPEN) Loading packages/SystemUI/animation/src/com/android/systemui/animation/ActivityTransitionAnimator.kt +3 −2 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import com.android.systemui.Flags.activityTransitionUseLargestWindow import com.android.systemui.Flags.translucentOccludingActivityFix import com.android.systemui.animation.TransitionAnimator.Companion.toTransitionState import com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary import com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived import com.android.wm.shell.shared.IShellTransitions import com.android.wm.shell.shared.ShellTransitions import java.util.concurrent.Executor Loading Loading @@ -607,8 +608,8 @@ constructor( * this registration. */ fun register(controller: Controller) { check(returnAnimationFrameworkLibrary()) { "Long-lived registrations cannot be used when the returnAnimationFrameworkLibrary " + check(returnAnimationFrameworkLongLived()) { "Long-lived registrations cannot be used when the returnAnimationFrameworkLongLived " + "flag is disabled" } Loading packages/SystemUI/tests/src/com/android/systemui/animation/ActivityTransitionAnimatorTest.kt +23 −16 Original line number Diff line number Diff line Loading @@ -8,7 +8,8 @@ import android.content.pm.ApplicationInfo import android.graphics.Point import android.graphics.Rect import android.os.Looper import android.platform.test.flag.junit.SetFlagsRule import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.testing.TestableLooper.RunWithLooper import android.view.IRemoteAnimationFinishedCallback import android.view.RemoteAnimationAdapter Loading Loading @@ -63,7 +64,6 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { private lateinit var activityTransitionAnimator: ActivityTransitionAnimator @get:Rule val rule = MockitoJUnit.rule() @get:Rule val setFlagsRule = SetFlagsRule() @Before fun setup() { Loading @@ -90,7 +90,7 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { animator: ActivityTransitionAnimator = this.activityTransitionAnimator, controller: ActivityTransitionAnimator.Controller? = this.controller, animate: Boolean = true, intentStarter: (RemoteAnimationAdapter?) -> Int intentStarter: (RemoteAnimationAdapter?) -> Int, ) { // We start in a new thread so that we can ensure that the callbacks are called in the main // thread. Loading @@ -98,7 +98,7 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { animator.startIntentWithAnimation( controller = controller, animate = animate, intentStarter = intentStarter intentStarter = intentStarter, ) } .join() Loading Loading @@ -175,9 +175,9 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { assertFalse(willAnimateCaptor.value) } @EnableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) @Test fun registersReturnIffCookieIsPresent() { setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) `when`(callback.isOnKeyguard()).thenReturn(false) startIntentWithAnimation(activityTransitionAnimator, controller) { _ -> Loading @@ -203,10 +203,12 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { assertTrue(testShellTransitions.remotesForTakeover.isEmpty()) } @EnableFlags( Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED, ) @Test fun registersLongLivedTransition() { setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) activityTransitionAnimator.register( object : DelegateTransitionAnimatorController(controller) { override val transitionCookie = Loading @@ -226,10 +228,12 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { assertEquals(4, testShellTransitions.remotes.size) } @EnableFlags( Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED, ) @Test fun registersLongLivedTransitionOverridingPreviousRegistration() { setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) val cookie = ActivityTransitionAnimator.TransitionCookie("test_cookie") activityTransitionAnimator.register( object : DelegateTransitionAnimatorController(controller) { Loading @@ -251,9 +255,9 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { } } @DisableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED) @Test fun doesNotRegisterLongLivedTransitionIfFlagIsDisabled() { setFlagsRule.disableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) val controller = object : DelegateTransitionAnimatorController(controller) { Loading @@ -266,9 +270,9 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { } } @EnableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED) @Test fun doesNotRegisterLongLivedTransitionIfMissingRequiredProperties() { setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) // No TransitionCookie val controllerWithoutCookie = Loading Loading @@ -310,9 +314,12 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { } } @EnableFlags( Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED, ) @Test fun unregistersLongLivedTransition() { setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) val cookies = arrayOfNulls<ActivityTransitionAnimator.TransitionCookie>(3) Loading Loading @@ -411,7 +418,7 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { SurfaceControl(), Rect(), taskInfo, false false, ) } } Loading @@ -430,7 +437,7 @@ private class FakeShellTransitions : ShellTransitions { override fun registerRemoteForTakeover( filter: TransitionFilter, remoteTransition: RemoteTransition remoteTransition: RemoteTransition, ) { remotesForTakeover[filter] = remoteTransition } Loading Loading @@ -460,7 +467,7 @@ private class TestTransitionAnimatorController(override var transitionContainer: left = 300, right = 400, topCornerRadius = 10f, bottomCornerRadius = 20f bottomCornerRadius = 20f, ) private fun assertOnMainThread() { Loading @@ -480,7 +487,7 @@ private class TestTransitionAnimatorController(override var transitionContainer: override fun onTransitionAnimationProgress( state: TransitionAnimator.State, progress: Float, linearProgress: Float linearProgress: Float, ) { assertOnMainThread() } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/RemoteTransitionHandler.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.wm.shell.transition; import static com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary; import static com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived; import android.annotation.NonNull; import android.annotation.Nullable; Loading Loading @@ -257,7 +257,7 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler { @Override public Transitions.TransitionHandler getHandlerForTakeover( @NonNull IBinder transition, @NonNull TransitionInfo info) { if (!returnAnimationFrameworkLibrary()) { if (!returnAnimationFrameworkLongLived()) { return null; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +2 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ import static android.window.TransitionInfo.FLAG_IS_WALLPAPER; import static android.window.TransitionInfo.FLAG_NO_ANIMATION; import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT; import static com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary; import static com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived; import static com.android.window.flags.Flags.ensureWallpaperInTransitions; import static com.android.window.flags.Flags.migratePredictiveBackTransition; import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_SHELL_TRANSITIONS; Loading Loading @@ -1252,7 +1252,7 @@ public class Transitions implements RemoteCallable<Transitions>, @Nullable public TransitionHandler getHandlerForTakeover( @NonNull IBinder transition, @NonNull TransitionInfo info) { if (!returnAnimationFrameworkLibrary()) { if (!returnAnimationFrameworkLongLived()) { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "Trying to get a handler for takeover but the flag is disabled"); return null; Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -557,7 +557,7 @@ public class ShellTransitionTests extends ShellTestCase { mMainExecutor.flushAll(); // Takeover shouldn't happen when the flag is disabled. setFlagsRule.disableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY); setFlagsRule.disableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED); IBinder transitToken = new Binder(); transitions.requestStartTransition(transitToken, new TransitionRequestInfo(TRANSIT_OPEN, null /* trigger */, null /* remote */)); Loading @@ -572,7 +572,7 @@ public class ShellTransitionTests extends ShellTestCase { verify(mOrganizer, times(1)).finishTransition(eq(transitToken), any()); // Takeover should happen when the flag is enabled. setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY); setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED); transitions.requestStartTransition(transitToken, new TransitionRequestInfo(TRANSIT_OPEN, null /* trigger */, null /* remote */)); info = new TransitionInfoBuilder(TRANSIT_OPEN) Loading
packages/SystemUI/animation/src/com/android/systemui/animation/ActivityTransitionAnimator.kt +3 −2 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import com.android.systemui.Flags.activityTransitionUseLargestWindow import com.android.systemui.Flags.translucentOccludingActivityFix import com.android.systemui.animation.TransitionAnimator.Companion.toTransitionState import com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary import com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived import com.android.wm.shell.shared.IShellTransitions import com.android.wm.shell.shared.ShellTransitions import java.util.concurrent.Executor Loading Loading @@ -607,8 +608,8 @@ constructor( * this registration. */ fun register(controller: Controller) { check(returnAnimationFrameworkLibrary()) { "Long-lived registrations cannot be used when the returnAnimationFrameworkLibrary " + check(returnAnimationFrameworkLongLived()) { "Long-lived registrations cannot be used when the returnAnimationFrameworkLongLived " + "flag is disabled" } Loading
packages/SystemUI/tests/src/com/android/systemui/animation/ActivityTransitionAnimatorTest.kt +23 −16 Original line number Diff line number Diff line Loading @@ -8,7 +8,8 @@ import android.content.pm.ApplicationInfo import android.graphics.Point import android.graphics.Rect import android.os.Looper import android.platform.test.flag.junit.SetFlagsRule import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.testing.TestableLooper.RunWithLooper import android.view.IRemoteAnimationFinishedCallback import android.view.RemoteAnimationAdapter Loading Loading @@ -63,7 +64,6 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { private lateinit var activityTransitionAnimator: ActivityTransitionAnimator @get:Rule val rule = MockitoJUnit.rule() @get:Rule val setFlagsRule = SetFlagsRule() @Before fun setup() { Loading @@ -90,7 +90,7 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { animator: ActivityTransitionAnimator = this.activityTransitionAnimator, controller: ActivityTransitionAnimator.Controller? = this.controller, animate: Boolean = true, intentStarter: (RemoteAnimationAdapter?) -> Int intentStarter: (RemoteAnimationAdapter?) -> Int, ) { // We start in a new thread so that we can ensure that the callbacks are called in the main // thread. Loading @@ -98,7 +98,7 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { animator.startIntentWithAnimation( controller = controller, animate = animate, intentStarter = intentStarter intentStarter = intentStarter, ) } .join() Loading Loading @@ -175,9 +175,9 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { assertFalse(willAnimateCaptor.value) } @EnableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) @Test fun registersReturnIffCookieIsPresent() { setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) `when`(callback.isOnKeyguard()).thenReturn(false) startIntentWithAnimation(activityTransitionAnimator, controller) { _ -> Loading @@ -203,10 +203,12 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { assertTrue(testShellTransitions.remotesForTakeover.isEmpty()) } @EnableFlags( Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED, ) @Test fun registersLongLivedTransition() { setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) activityTransitionAnimator.register( object : DelegateTransitionAnimatorController(controller) { override val transitionCookie = Loading @@ -226,10 +228,12 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { assertEquals(4, testShellTransitions.remotes.size) } @EnableFlags( Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED, ) @Test fun registersLongLivedTransitionOverridingPreviousRegistration() { setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) val cookie = ActivityTransitionAnimator.TransitionCookie("test_cookie") activityTransitionAnimator.register( object : DelegateTransitionAnimatorController(controller) { Loading @@ -251,9 +255,9 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { } } @DisableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED) @Test fun doesNotRegisterLongLivedTransitionIfFlagIsDisabled() { setFlagsRule.disableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) val controller = object : DelegateTransitionAnimatorController(controller) { Loading @@ -266,9 +270,9 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { } } @EnableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED) @Test fun doesNotRegisterLongLivedTransitionIfMissingRequiredProperties() { setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) // No TransitionCookie val controllerWithoutCookie = Loading Loading @@ -310,9 +314,12 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { } } @EnableFlags( Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED, ) @Test fun unregistersLongLivedTransition() { setFlagsRule.enableFlags(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY) val cookies = arrayOfNulls<ActivityTransitionAnimator.TransitionCookie>(3) Loading Loading @@ -411,7 +418,7 @@ class ActivityTransitionAnimatorTest : SysuiTestCase() { SurfaceControl(), Rect(), taskInfo, false false, ) } } Loading @@ -430,7 +437,7 @@ private class FakeShellTransitions : ShellTransitions { override fun registerRemoteForTakeover( filter: TransitionFilter, remoteTransition: RemoteTransition remoteTransition: RemoteTransition, ) { remotesForTakeover[filter] = remoteTransition } Loading Loading @@ -460,7 +467,7 @@ private class TestTransitionAnimatorController(override var transitionContainer: left = 300, right = 400, topCornerRadius = 10f, bottomCornerRadius = 20f bottomCornerRadius = 20f, ) private fun assertOnMainThread() { Loading @@ -480,7 +487,7 @@ private class TestTransitionAnimatorController(override var transitionContainer: override fun onTransitionAnimationProgress( state: TransitionAnimator.State, progress: Float, linearProgress: Float linearProgress: Float, ) { assertOnMainThread() } Loading