Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b6a4daf authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Clean up aconfig flag return_animation_framework_library.

Fix: 423925883
Flag: EXEMPT flag cleanup
Test: EXEMPT flag cleanup
Change-Id: I620e1fd5bf5a43137b24fb2e9cd10de95ffc63fc
parent d1033354
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -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);
+22 −36
Original line number Original line Diff line number Diff line
@@ -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
@@ -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(
@@ -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.
@@ -1824,7 +1819,6 @@ constructor(
                    ) {
                    ) {
                        continue
                        continue
                    }
                    }
                    }


                    if (candidate == null) {
                    if (candidate == null) {
                        candidate = it
                        candidate = it
@@ -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.
@@ -1961,7 +1954,6 @@ constructor(
                    ) {
                    ) {
                        continue
                        continue
                    }
                    }
                    }


                    if (
                    if (
                        candidate == null || !it.hasAnimatingParent && candidate.hasAnimatingParent
                        candidate == null || !it.hasAnimatingParent && candidate.hasAnimatingParent
@@ -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) {
+2 −6
Original line number Original line Diff line number Diff line
@@ -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) }
    }
    }


+1 −13
Original line number Original line Diff line number Diff line
@@ -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
@@ -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 " +
@@ -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 {
@@ -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
+2 −4
Original line number Original line Diff line number Diff line
@@ -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
}
}
@@ -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