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

Commit 8a8b1424 authored by Issei Suzuki's avatar Issei Suzuki Committed by Android (Google) Code Review
Browse files

Merge "Disable overriding task transit animation."

parents ec1e785b 99b11551
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -347,6 +347,7 @@ public interface WindowManager extends ViewManager {
            TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHADE,
            TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION,
            TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER,
            TRANSIT_FLAG_KEYGUARD_GOING_AWAY_SUBTLE_ANIMATION
    })
    @Retention(RetentionPolicy.SOURCE)
    @interface TransitionFlags {}
+5 −0
Original line number Diff line number Diff line
@@ -7631,6 +7631,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        return mShowForAllUsers || mWmService.isCurrentProfile(mUserId);
    }

    @Override
    boolean canCustomizeAppTransition() {
        return true;
    }

    @Override
    public String toString() {
        if (stringName != null) {
+19 −10
Original line number Diff line number Diff line
@@ -203,6 +203,7 @@ public class AppTransition implements Dump {
    private static final int NEXT_TRANSIT_TYPE_REMOTE = 10;

    private int mNextAppTransitionType = NEXT_TRANSIT_TYPE_NONE;
    private boolean mNextAppTransitionOverrideRequested;

    // These are the possible states for the enter/exit activities during a thumbnail transition
    private static final int THUMBNAIL_TRANSITION_ENTER_SCALE_UP = 0;
@@ -459,6 +460,7 @@ public class AppTransition implements Dump {

    void clear() {
        mNextAppTransitionType = NEXT_TRANSIT_TYPE_NONE;
        mNextAppTransitionOverrideRequested = false;
        mNextAppTransitionPackage = null;
        mNextAppTransitionAnimationsSpecs.clear();
        mRemoteAnimationController = null;
@@ -1579,6 +1581,7 @@ public class AppTransition implements Dump {
     */
    boolean canSkipFirstFrame() {
        return mNextAppTransitionType != NEXT_TRANSIT_TYPE_CUSTOM
                && !mNextAppTransitionOverrideRequested
                && mNextAppTransitionType != NEXT_TRANSIT_TYPE_CUSTOM_IN_PLACE
                && mNextAppTransitionType != NEXT_TRANSIT_TYPE_CLIP_REVEAL
                && mNextAppTransition != TRANSIT_KEYGUARD_GOING_AWAY;
@@ -1613,6 +1616,11 @@ public class AppTransition implements Dump {
            int orientation, Rect frame, Rect displayFrame, Rect insets,
            @Nullable Rect surfaceInsets, @Nullable Rect stableInsets, boolean isVoiceInteraction,
            boolean freeform, WindowContainer container) {

        if (mNextAppTransitionOverrideRequested && container.canCustomizeAppTransition()) {
            mNextAppTransitionType = NEXT_TRANSIT_TYPE_CUSTOM;
        }

        Animation a;
        if (isKeyguardGoingAwayTransit(transit) && enter) {
            a = loadKeyguardExitAnimation(transit);
@@ -1653,7 +1661,6 @@ public class AppTransition implements Dump {
                    "applyAnimation: anim=%s nextAppTransition=ANIM_CUSTOM transit=%s "
                            + "isEntrance=%b Callers=%s",
                    a, appTransitionToString(transit), enter, Debug.getCallers(3));
            setAppTransitionFinishedCallbackIfNeeded(a);
        } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM_IN_PLACE) {
            a = loadAnimationRes(mNextAppTransitionPackage, mNextAppTransitionInPlace);
            ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
@@ -1780,6 +1787,7 @@ public class AppTransition implements Dump {
                    a, animAttr, appTransitionToString(transit), enter,
                    Debug.getCallers(3));
        }
        setAppTransitionFinishedCallbackIfNeeded(a);
        return a;
    }

@@ -1821,7 +1829,7 @@ public class AppTransition implements Dump {
            IRemoteCallback startedCallback, IRemoteCallback endedCallback) {
        if (canOverridePendingAppTransition()) {
            clear();
            mNextAppTransitionType = NEXT_TRANSIT_TYPE_CUSTOM;
            mNextAppTransitionOverrideRequested = true;
            mNextAppTransitionPackage = packageName;
            mNextAppTransitionEnter = enterAnim;
            mNextAppTransitionExit = exitAnim;
@@ -2139,15 +2147,16 @@ public class AppTransition implements Dump {
            pw.print(prefix); pw.print("mNextAppTransitionType=");
                    pw.println(transitTypeToString());
        }
        switch (mNextAppTransitionType) {
            case NEXT_TRANSIT_TYPE_CUSTOM:
        if (mNextAppTransitionOverrideRequested
                || mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM) {
            pw.print(prefix); pw.print("mNextAppTransitionPackage=");
            pw.println(mNextAppTransitionPackage);
            pw.print(prefix); pw.print("mNextAppTransitionEnter=0x");
            pw.print(Integer.toHexString(mNextAppTransitionEnter));
            pw.print(" mNextAppTransitionExit=0x");
            pw.println(Integer.toHexString(mNextAppTransitionExit));
                break;
        }
        switch (mNextAppTransitionType) {
            case NEXT_TRANSIT_TYPE_CUSTOM_IN_PLACE:
                pw.print(prefix); pw.print("mNextAppTransitionPackage=");
                        pw.println(mNextAppTransitionPackage);
+8 −0
Original line number Diff line number Diff line
@@ -856,6 +856,14 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        }
    }

    /**
     * @return {@code true} when an application can override an app transition animation on this
     * container.
     */
    boolean canCustomizeAppTransition() {
        return !WindowManagerService.sDisableCustomTaskAnimationProperty;
    }

    /**
     * @return {@code true} when this container or its related containers are running an
     * animation, {@code false} otherwise.