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

Commit 7a248913 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clean up move_animation_options_to_change" into main

parents 78b9ad54 6b295343
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.view.WindowManager;

import com.android.window.flags.Flags;

/**
 * A parcelable filter that can be used for rerouting transitions to a remote. This is a local
 * representation so that the transition system doesn't need to make blocking queries over
@@ -261,9 +259,7 @@ public final class TransitionFilter implements Parcelable {
                        // only applies to activity/task
                        && (change.getTaskInfo() != null
                                || change.getActivityComponent() != null)) {
                    final TransitionInfo.AnimationOptions opts =
                            Flags.moveAnimationOptionsToChange() ? change.getAnimationOptions()
                                    : info.getAnimationOptions();
                    final TransitionInfo.AnimationOptions opts = change.getAnimationOptions();
                    if (opts != null) {
                        boolean canActuallyOverride = change.getTaskInfo() == null
                                || opts.getOverrideTaskTransition();
+0 −38
Original line number Diff line number Diff line
@@ -57,8 +57,6 @@ import android.view.Surface;
import android.view.SurfaceControl;
import android.view.WindowManager;

import com.android.window.flags.Flags;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -220,10 +218,6 @@ public final class TransitionInfo implements Parcelable {
    private final ArrayList<Change> mChanges = new ArrayList<>();
    private final ArrayList<Root> mRoots = new ArrayList<>();

    // TODO(b/327332488): Clean-up usages after the flag is fully enabled.
    @Deprecated
    private AnimationOptions mOptions;

    /** This is only a BEST-EFFORT id used for log correlation. DO NOT USE for any real work! */
    private int mDebugId = -1;

@@ -238,7 +232,6 @@ public final class TransitionInfo implements Parcelable {
        mFlags = in.readInt();
        in.readTypedList(mChanges, Change.CREATOR);
        in.readTypedList(mRoots, Root.CREATOR);
        mOptions = in.readTypedObject(AnimationOptions.CREATOR);
        mDebugId = in.readInt();
        mTrack = in.readInt();
    }
@@ -250,7 +243,6 @@ public final class TransitionInfo implements Parcelable {
        dest.writeInt(mFlags);
        dest.writeTypedList(mChanges);
        dest.writeTypedList(mRoots, flags);
        dest.writeTypedObject(mOptions, flags);
        dest.writeInt(mDebugId);
        dest.writeInt(mTrack);
    }
@@ -286,18 +278,6 @@ public final class TransitionInfo implements Parcelable {
        mRoots.add(other);
    }

    /**
     * @deprecated Set {@link AnimationOptions} to change. This method is only used if
     * {@link Flags#FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE} is disabled.
     */
    @Deprecated
    public void setAnimationOptions(@Nullable AnimationOptions options) {
        if (Flags.moveAnimationOptionsToChange()) {
            return;
        }
        mOptions = options;
    }

    public @TransitionType int getType() {
        return mType;
    }
@@ -359,16 +339,6 @@ public final class TransitionInfo implements Parcelable {
        return mRoots.get(0).mLeash;
    }

    /**
     * @deprecated Use {@link Change#getAnimationOptions()} instead. This method is called only
     * if {@link Flags#FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE} is disabled.
     */
    @Deprecated
    @Nullable
    public AnimationOptions getAnimationOptions() {
        return mOptions;
    }

    /**
     * @return the list of {@link Change}s in this transition. The list is sorted top-to-bottom
     *         in Z (meaning index 0 is the top-most container).
@@ -455,9 +425,6 @@ public final class TransitionInfo implements Parcelable {
        StringBuilder sb = new StringBuilder();
        sb.append("{id=").append(mDebugId).append(" t=").append(transitTypeToString(mType))
                .append(" f=0x").append(Integer.toHexString(mFlags)).append(" trk=").append(mTrack);
        if (mOptions != null) {
            sb.append(" opt=").append(mOptions);
        }
        sb.append(" r=[");
        for (int i = 0; i < mRoots.size(); ++i) {
            if (i > 0) {
@@ -656,8 +623,6 @@ public final class TransitionInfo implements Parcelable {
        for (int i = 0; i < mRoots.size(); ++i) {
            out.mRoots.add(mRoots.get(i).localRemoteCopy());
        }
        // Doesn't have any native stuff, so no need for actual copy
        out.mOptions = mOptions;
        return out;
    }

@@ -860,9 +825,6 @@ public final class TransitionInfo implements Parcelable {
         * Sets {@link AnimationOptions} to override animation.
         */
        public void setAnimationOptions(@Nullable AnimationOptions options) {
            if (!Flags.moveAnimationOptionsToChange()) {
                return;
            }
            mAnimationOptions = options;
        }

+0 −10
Original line number Diff line number Diff line
@@ -60,16 +60,6 @@ flag {
    bug: "293658614"
}

flag {
    namespace: "windowing_sdk"
     name: "move_animation_options_to_change"
     description: "Move AnimationOptions from TransitionInfo to each Change"
     bug: "327332488"
     metadata {
         purpose: PURPOSE_BUGFIX
     }
}

flag {
    namespace: "windowing_sdk"
    name: "rear_display_disable_force_desktop_system_decorations"
+1 −2
Original line number Diff line number Diff line
@@ -705,8 +705,7 @@ class SplitPresenter extends JetpackTaskFragmentOrganizer {
    }

    private static boolean isOverlayTransitionSupported() {
        return Flags.moveAnimationOptionsToChange()
                && Flags.activityEmbeddingOverlayPresentationFlag();
        return Flags.activityEmbeddingOverlayPresentationFlag();
    }

    @NonNull
+6 −8
Original line number Diff line number Diff line
@@ -364,7 +364,7 @@ class ActivityEmbeddingAnimationRunner {
            @NonNull SurfaceControl.Transaction finishTransaction,
            @NonNull List<ActivityEmbeddingAnimationAdapter> adapters) {
        for (ActivityEmbeddingAnimationAdapter adapter : adapters) {
            final int backgroundColor = getTransitionBackgroundColorIfSet(info, adapter.mChange,
            final int backgroundColor = getTransitionBackgroundColorIfSet(adapter.mChange,
                    adapter.mAnimation, 0 /* defaultColor */);
            if (backgroundColor != 0) {
                // We only need to show one color.
@@ -436,8 +436,8 @@ class ActivityEmbeddingAnimationRunner {
            final TransitionInfo.AnimationOptions options = boundsAnimationChange
                    .getAnimationOptions();
            if (options != null) {
                final Animation overrideAnimation = mAnimationSpec.loadCustomAnimationFromOptions(
                        options, TRANSIT_CHANGE);
                final Animation overrideAnimation =
                        mAnimationSpec.loadCustomAnimation(options, TRANSIT_CHANGE);
                if (overrideAnimation != null) {
                    overrideShowBackdrop = overrideAnimation.getShowBackdrop();
                }
@@ -447,7 +447,7 @@ class ActivityEmbeddingAnimationRunner {
            // There are two animations in the array. The first one is for the start leash
            // (snapshot), and the second one is for the end leash (TaskFragment).
            final Animation[] animations =
                    mAnimationSpec.createChangeBoundsChangeAnimations(info, change, parentBounds);
                    mAnimationSpec.createChangeBoundsChangeAnimations(change, parentBounds);
            // Jump cut if either animation has zero for duration.
            for (Animation animation : animations) {
                if (shouldUseJumpCutForAnimation(animation)) {
@@ -500,12 +500,10 @@ class ActivityEmbeddingAnimationRunner {
                // window without bounds change.
                animation = ActivityEmbeddingAnimationSpec.createNoopAnimation(change);
            } else if (TransitionUtil.isClosingType(change.getMode())) {
                animation =
                        mAnimationSpec.createChangeBoundsCloseAnimation(info, change, parentBounds);
                animation = mAnimationSpec.createChangeBoundsCloseAnimation(change, parentBounds);
                shouldShowBackgroundColor = false;
            } else {
                animation =
                        mAnimationSpec.createChangeBoundsOpenAnimation(info, change, parentBounds);
                animation = mAnimationSpec.createChangeBoundsOpenAnimation(change, parentBounds);
                shouldShowBackgroundColor = false;
            }
            if (shouldUseJumpCutForAnimation(animation)) {
Loading