Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -556,8 +556,7 @@ public class BackAnimationControllerTest extends ShellTestCase { verify(mAnimatorCallback, never()).onBackInvoked(); verify(mAnimatorCallback, never()).onBackInvoked(); } } @EnableFlags({com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, @EnableFlags({com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED}) com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED}) @Test @Test public void appCallback_receivesTakeoverHandler_whenAvailable() throws RemoteException { public void appCallback_receivesTakeoverHandler_whenAvailable() throws RemoteException { registerAnimation(BackNavigationInfo.TYPE_CROSS_TASK); registerAnimation(BackNavigationInfo.TYPE_CROSS_TASK); Loading packages/SystemUI/animation/src/com/android/systemui/animation/ActivityTransitionAnimator.kt +22 −36 Original line number Original line Diff line number Diff line Loading @@ -66,9 +66,7 @@ import com.android.systemui.Flags.animationLibraryShellMigration import com.android.systemui.Flags.instantHideShade import com.android.systemui.Flags.instantHideShade import com.android.systemui.Flags.moveTransitionAnimationLayer import com.android.systemui.Flags.moveTransitionAnimationLayer import com.android.systemui.animation.TransitionAnimator.Companion.assertLongLivedReturnAnimations import com.android.systemui.animation.TransitionAnimator.Companion.assertLongLivedReturnAnimations import com.android.systemui.animation.TransitionAnimator.Companion.assertReturnAnimations import com.android.systemui.animation.TransitionAnimator.Companion.longLivedReturnAnimationsEnabled import com.android.systemui.animation.TransitionAnimator.Companion.longLivedReturnAnimationsEnabled import com.android.systemui.animation.TransitionAnimator.Companion.returnAnimationsEnabled import com.android.systemui.animation.TransitionAnimator.Companion.toTransitionState import com.android.systemui.animation.TransitionAnimator.Companion.toTransitionState import com.android.wm.shell.shared.IShellTransitions import com.android.wm.shell.shared.IShellTransitions import com.android.wm.shell.shared.ShellTransitions import com.android.wm.shell.shared.ShellTransitions Loading Loading @@ -714,8 +712,6 @@ constructor( launchController: Controller, launchController: Controller, transitionRegister: TransitionRegister?, transitionRegister: TransitionRegister?, ) { ) { if (!returnAnimationsEnabled()) return var cleanUpRunnable: Runnable? = null var cleanUpRunnable: Runnable? = null val returnRunner = val returnRunner = createEphemeralRunner( createEphemeralRunner( Loading Loading @@ -1811,7 +1807,6 @@ constructor( for ((index, it) in info.changes.withIndex()) { for ((index, it) in info.changes.withIndex()) { if (targetModes.contains(it.mode)) { if (targetModes.contains(it.mode)) { if (returnAnimationsEnabled()) { // If the controller contains a cookie, _only_ match if either the candidate // If the controller contains a cookie, _only_ match if either the candidate // contains the matching cookie, or a component is also defined and is a // contains the matching cookie, or a component is also defined and is a // match. // match. Loading @@ -1824,7 +1819,6 @@ constructor( ) { ) { continue continue } } } if (candidate == null) { if (candidate == null) { candidate = it candidate = it Loading Loading @@ -1948,7 +1942,6 @@ constructor( for ((index, it) in apps.withIndex()) { for ((index, it) in apps.withIndex()) { if (it.mode == targetMode) { if (it.mode == targetMode) { if (returnAnimationsEnabled()) { // If the controller contains a cookie, _only_ match if either the // If the controller contains a cookie, _only_ match if either the // candidate contains the matching cookie, or a component is also // candidate contains the matching cookie, or a component is also // defined and is a match. // defined and is a match. Loading @@ -1961,7 +1954,6 @@ constructor( ) { ) { continue continue } } } if ( if ( candidate == null || !it.hasAnimatingParent && candidate.hasAnimatingParent candidate == null || !it.hasAnimatingParent && candidate.hasAnimatingParent Loading Loading @@ -2116,12 +2108,6 @@ constructor( ) ) } } init { // We do this check here to cover all entry points, including Launcher which doesn't // call startIntentWithAnimation() if (!controller.isLaunching) assertReturnAnimations() } @UiThread @UiThread fun postTimeouts() { fun postTimeouts() { if (timeoutHandler != null) { if (timeoutHandler != null) { Loading packages/SystemUI/animation/src/com/android/systemui/animation/GhostedViewTransitionAnimatorController.kt +2 −6 Original line number Original line Diff line number Diff line Loading @@ -213,15 +213,11 @@ constructor( background = findBackground(ghostedView) background = findBackground(ghostedView) if (TransitionAnimator.returnAnimationsEnabled() && isEphemeral) { if (isEphemeral) ghostedView.addOnAttachStateChangeListener(detachListener) ghostedView.addOnAttachStateChangeListener(detachListener) } } } override fun onDispose() { override fun onDispose() { if (TransitionAnimator.returnAnimationsEnabled()) { ghostedView.removeOnAttachStateChangeListener(detachListener) ghostedView.removeOnAttachStateChangeListener(detachListener) } transitionToken?.let { token -> transitionRegistry?.unregister(token) } transitionToken?.let { token -> transitionRegistry?.unregister(token) } } } Loading packages/SystemUI/animation/src/com/android/systemui/animation/TransitionAnimator.kt +1 −13 Original line number Original line Diff line number Diff line Loading @@ -41,7 +41,6 @@ import com.android.internal.dynamicanimation.animation.SpringAnimation import com.android.internal.dynamicanimation.animation.SpringForce import com.android.internal.dynamicanimation.animation.SpringForce import com.android.systemui.Flags import com.android.systemui.Flags import com.android.systemui.Flags.moveTransitionAnimationLayer import com.android.systemui.Flags.moveTransitionAnimationLayer import com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary import com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived import com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived import java.util.concurrent.Executor import java.util.concurrent.Executor import kotlin.math.abs import kotlin.math.abs Loading Loading @@ -118,15 +117,6 @@ class TransitionAnimator( ) ) } } fun assertReturnAnimations() { check(returnAnimationsEnabled()) { "isLaunching cannot be false when the returnAnimationFrameworkLibrary flag " + "is disabled" } } fun returnAnimationsEnabled() = returnAnimationFrameworkLibrary() fun assertLongLivedReturnAnimations() { fun assertLongLivedReturnAnimations() { check(longLivedReturnAnimationsEnabled()) { check(longLivedReturnAnimationsEnabled()) { "Long-lived registrations cannot be used when the " + "Long-lived registrations cannot be used when the " + Loading @@ -135,8 +125,7 @@ class TransitionAnimator( } } } } fun longLivedReturnAnimationsEnabled() = fun longLivedReturnAnimationsEnabled() = returnAnimationFrameworkLongLived() returnAnimationFrameworkLibrary() && returnAnimationFrameworkLongLived() internal fun WindowAnimationState.toTransitionState() = internal fun WindowAnimationState.toTransitionState() = State().also { State().also { Loading Loading @@ -527,7 +516,6 @@ class TransitionAnimator( startVelocity: PointF? = null, startVelocity: PointF? = null, startFrameTime: Long = -1, startFrameTime: Long = -1, ): Animation { ): Animation { if (!controller.isLaunching) assertReturnAnimations() if (startVelocity != null) assertLongLivedReturnAnimations() if (startVelocity != null) assertLongLivedReturnAnimations() // We add an extra layer with the same color as the dialog/app splash screen background // We add an extra layer with the same color as the dialog/app splash screen background Loading packages/SystemUI/compose/core/src/com/android/compose/animation/ExpandableController.kt +2 −4 Original line number Original line Diff line number Diff line Loading @@ -132,11 +132,9 @@ fun rememberExpandableController( DisposableEffect(Unit) { DisposableEffect(Unit) { onDispose { onDispose { isComposed = false isComposed = false if (TransitionAnimator.returnAnimationsEnabled()) { controller.onDispose() controller.onDispose() } } } } } return controller return controller } } Loading Loading @@ -192,7 +190,7 @@ internal class ExpandableControllerImpl( } } val controller = activityController(launchCujType, cookie, component, returnCujType) val controller = activityController(launchCujType, cookie, component, returnCujType) if (TransitionAnimator.returnAnimationsEnabled() && isEphemeral) { if (isEphemeral) { activityControllerForDisposal?.onDispose() activityControllerForDisposal?.onDispose() activityControllerForDisposal = controller activityControllerForDisposal = controller } } Loading Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -556,8 +556,7 @@ public class BackAnimationControllerTest extends ShellTestCase { verify(mAnimatorCallback, never()).onBackInvoked(); verify(mAnimatorCallback, never()).onBackInvoked(); } } @EnableFlags({com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, @EnableFlags({com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED}) com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED}) @Test @Test public void appCallback_receivesTakeoverHandler_whenAvailable() throws RemoteException { public void appCallback_receivesTakeoverHandler_whenAvailable() throws RemoteException { registerAnimation(BackNavigationInfo.TYPE_CROSS_TASK); registerAnimation(BackNavigationInfo.TYPE_CROSS_TASK); Loading
packages/SystemUI/animation/src/com/android/systemui/animation/ActivityTransitionAnimator.kt +22 −36 Original line number Original line Diff line number Diff line Loading @@ -66,9 +66,7 @@ import com.android.systemui.Flags.animationLibraryShellMigration import com.android.systemui.Flags.instantHideShade import com.android.systemui.Flags.instantHideShade import com.android.systemui.Flags.moveTransitionAnimationLayer import com.android.systemui.Flags.moveTransitionAnimationLayer import com.android.systemui.animation.TransitionAnimator.Companion.assertLongLivedReturnAnimations import com.android.systemui.animation.TransitionAnimator.Companion.assertLongLivedReturnAnimations import com.android.systemui.animation.TransitionAnimator.Companion.assertReturnAnimations import com.android.systemui.animation.TransitionAnimator.Companion.longLivedReturnAnimationsEnabled import com.android.systemui.animation.TransitionAnimator.Companion.longLivedReturnAnimationsEnabled import com.android.systemui.animation.TransitionAnimator.Companion.returnAnimationsEnabled import com.android.systemui.animation.TransitionAnimator.Companion.toTransitionState import com.android.systemui.animation.TransitionAnimator.Companion.toTransitionState import com.android.wm.shell.shared.IShellTransitions import com.android.wm.shell.shared.IShellTransitions import com.android.wm.shell.shared.ShellTransitions import com.android.wm.shell.shared.ShellTransitions Loading Loading @@ -714,8 +712,6 @@ constructor( launchController: Controller, launchController: Controller, transitionRegister: TransitionRegister?, transitionRegister: TransitionRegister?, ) { ) { if (!returnAnimationsEnabled()) return var cleanUpRunnable: Runnable? = null var cleanUpRunnable: Runnable? = null val returnRunner = val returnRunner = createEphemeralRunner( createEphemeralRunner( Loading Loading @@ -1811,7 +1807,6 @@ constructor( for ((index, it) in info.changes.withIndex()) { for ((index, it) in info.changes.withIndex()) { if (targetModes.contains(it.mode)) { if (targetModes.contains(it.mode)) { if (returnAnimationsEnabled()) { // If the controller contains a cookie, _only_ match if either the candidate // If the controller contains a cookie, _only_ match if either the candidate // contains the matching cookie, or a component is also defined and is a // contains the matching cookie, or a component is also defined and is a // match. // match. Loading @@ -1824,7 +1819,6 @@ constructor( ) { ) { continue continue } } } if (candidate == null) { if (candidate == null) { candidate = it candidate = it Loading Loading @@ -1948,7 +1942,6 @@ constructor( for ((index, it) in apps.withIndex()) { for ((index, it) in apps.withIndex()) { if (it.mode == targetMode) { if (it.mode == targetMode) { if (returnAnimationsEnabled()) { // If the controller contains a cookie, _only_ match if either the // If the controller contains a cookie, _only_ match if either the // candidate contains the matching cookie, or a component is also // candidate contains the matching cookie, or a component is also // defined and is a match. // defined and is a match. Loading @@ -1961,7 +1954,6 @@ constructor( ) { ) { continue continue } } } if ( if ( candidate == null || !it.hasAnimatingParent && candidate.hasAnimatingParent candidate == null || !it.hasAnimatingParent && candidate.hasAnimatingParent Loading Loading @@ -2116,12 +2108,6 @@ constructor( ) ) } } init { // We do this check here to cover all entry points, including Launcher which doesn't // call startIntentWithAnimation() if (!controller.isLaunching) assertReturnAnimations() } @UiThread @UiThread fun postTimeouts() { fun postTimeouts() { if (timeoutHandler != null) { if (timeoutHandler != null) { Loading
packages/SystemUI/animation/src/com/android/systemui/animation/GhostedViewTransitionAnimatorController.kt +2 −6 Original line number Original line Diff line number Diff line Loading @@ -213,15 +213,11 @@ constructor( background = findBackground(ghostedView) background = findBackground(ghostedView) if (TransitionAnimator.returnAnimationsEnabled() && isEphemeral) { if (isEphemeral) ghostedView.addOnAttachStateChangeListener(detachListener) ghostedView.addOnAttachStateChangeListener(detachListener) } } } override fun onDispose() { override fun onDispose() { if (TransitionAnimator.returnAnimationsEnabled()) { ghostedView.removeOnAttachStateChangeListener(detachListener) ghostedView.removeOnAttachStateChangeListener(detachListener) } transitionToken?.let { token -> transitionRegistry?.unregister(token) } transitionToken?.let { token -> transitionRegistry?.unregister(token) } } } Loading
packages/SystemUI/animation/src/com/android/systemui/animation/TransitionAnimator.kt +1 −13 Original line number Original line Diff line number Diff line Loading @@ -41,7 +41,6 @@ import com.android.internal.dynamicanimation.animation.SpringAnimation import com.android.internal.dynamicanimation.animation.SpringForce import com.android.internal.dynamicanimation.animation.SpringForce import com.android.systemui.Flags import com.android.systemui.Flags import com.android.systemui.Flags.moveTransitionAnimationLayer import com.android.systemui.Flags.moveTransitionAnimationLayer import com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary import com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived import com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived import java.util.concurrent.Executor import java.util.concurrent.Executor import kotlin.math.abs import kotlin.math.abs Loading Loading @@ -118,15 +117,6 @@ class TransitionAnimator( ) ) } } fun assertReturnAnimations() { check(returnAnimationsEnabled()) { "isLaunching cannot be false when the returnAnimationFrameworkLibrary flag " + "is disabled" } } fun returnAnimationsEnabled() = returnAnimationFrameworkLibrary() fun assertLongLivedReturnAnimations() { fun assertLongLivedReturnAnimations() { check(longLivedReturnAnimationsEnabled()) { check(longLivedReturnAnimationsEnabled()) { "Long-lived registrations cannot be used when the " + "Long-lived registrations cannot be used when the " + Loading @@ -135,8 +125,7 @@ class TransitionAnimator( } } } } fun longLivedReturnAnimationsEnabled() = fun longLivedReturnAnimationsEnabled() = returnAnimationFrameworkLongLived() returnAnimationFrameworkLibrary() && returnAnimationFrameworkLongLived() internal fun WindowAnimationState.toTransitionState() = internal fun WindowAnimationState.toTransitionState() = State().also { State().also { Loading Loading @@ -527,7 +516,6 @@ class TransitionAnimator( startVelocity: PointF? = null, startVelocity: PointF? = null, startFrameTime: Long = -1, startFrameTime: Long = -1, ): Animation { ): Animation { if (!controller.isLaunching) assertReturnAnimations() if (startVelocity != null) assertLongLivedReturnAnimations() if (startVelocity != null) assertLongLivedReturnAnimations() // We add an extra layer with the same color as the dialog/app splash screen background // We add an extra layer with the same color as the dialog/app splash screen background Loading
packages/SystemUI/compose/core/src/com/android/compose/animation/ExpandableController.kt +2 −4 Original line number Original line Diff line number Diff line Loading @@ -132,11 +132,9 @@ fun rememberExpandableController( DisposableEffect(Unit) { DisposableEffect(Unit) { onDispose { onDispose { isComposed = false isComposed = false if (TransitionAnimator.returnAnimationsEnabled()) { controller.onDispose() controller.onDispose() } } } } } return controller return controller } } Loading Loading @@ -192,7 +190,7 @@ internal class ExpandableControllerImpl( } } val controller = activityController(launchCujType, cookie, component, returnCujType) val controller = activityController(launchCujType, cookie, component, returnCujType) if (TransitionAnimator.returnAnimationsEnabled() && isEphemeral) { if (isEphemeral) { activityControllerForDisposal?.onDispose() activityControllerForDisposal?.onDispose() activityControllerForDisposal = controller activityControllerForDisposal = controller } } Loading