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

Commit ee5cb88d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Update WM Extensions aar for animation background color" into tm-qpr-dev am: fb909777

parents a2845793 fb909777
Loading
Loading
Loading
Loading
+10 −2
Original line number Original line Diff line number Diff line
@@ -33,6 +33,13 @@ public final class TaskFragmentAnimationParams implements Parcelable {
    public static final TaskFragmentAnimationParams DEFAULT =
    public static final TaskFragmentAnimationParams DEFAULT =
            new TaskFragmentAnimationParams.Builder().build();
            new TaskFragmentAnimationParams.Builder().build();


    /**
     * The default value for animation background color, which means to use the theme window
     * background color.
     */
    @ColorInt
    public static final int DEFAULT_ANIMATION_BACKGROUND_COLOR = 0;

    @ColorInt
    @ColorInt
    private final int mAnimationBackgroundColor;
    private final int mAnimationBackgroundColor;


@@ -104,12 +111,13 @@ public final class TaskFragmentAnimationParams implements Parcelable {
    public static final class Builder {
    public static final class Builder {


        @ColorInt
        @ColorInt
        private int mAnimationBackgroundColor = 0;
        private int mAnimationBackgroundColor = DEFAULT_ANIMATION_BACKGROUND_COLOR;


        /**
        /**
         * Sets the {@link ColorInt} to use for the background during the animation with this
         * Sets the {@link ColorInt} to use for the background during the animation with this
         * TaskFragment if the animation requires a background. The default value is
         * TaskFragment if the animation requires a background. The default value is
         * {@code 0}, which is to use the theme window background.
         * {@link #DEFAULT_ANIMATION_BACKGROUND_COLOR}, which is to use the theme window background
         * color.
         *
         *
         * @param color a packed color int, {@code AARRGGBB}, for the animation background color.
         * @param color a packed color int, {@code AARRGGBB}, for the animation background color.
         * @return this {@link Builder}.
         * @return this {@link Builder}.
+6 −4
Original line number Original line Diff line number Diff line
@@ -45,6 +45,7 @@ import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.view.WindowManager.TransitionFlags;
import static android.view.WindowManager.TransitionFlags;
import static android.view.WindowManager.TransitionType;
import static android.view.WindowManager.TransitionType;
import static android.view.WindowManager.transitTypeToString;
import static android.view.WindowManager.transitTypeToString;
import static android.window.TaskFragmentAnimationParams.DEFAULT_ANIMATION_BACKGROUND_COLOR;
import static android.window.TransitionInfo.FLAG_DISPLAY_HAS_ALERT_WINDOWS;
import static android.window.TransitionInfo.FLAG_DISPLAY_HAS_ALERT_WINDOWS;
import static android.window.TransitionInfo.FLAG_FILLS_TASK;
import static android.window.TransitionInfo.FLAG_FILLS_TASK;
import static android.window.TransitionInfo.FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY;
import static android.window.TransitionInfo.FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY;
@@ -1736,7 +1737,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
                        ? activityRecord.getOrganizedTaskFragment()
                        ? activityRecord.getOrganizedTaskFragment()
                        : taskFragment.getOrganizedTaskFragment();
                        : taskFragment.getOrganizedTaskFragment();
                if (organizedTf != null && organizedTf.getAnimationParams()
                if (organizedTf != null && organizedTf.getAnimationParams()
                        .getAnimationBackgroundColor() != 0) {
                        .getAnimationBackgroundColor() != DEFAULT_ANIMATION_BACKGROUND_COLOR) {
                    // This window is embedded and has an animation background color set on the
                    // This window is embedded and has an animation background color set on the
                    // TaskFragment. Pass this color with this window, so the handler can use it as
                    // TaskFragment. Pass this color with this window, so the handler can use it as
                    // the animation background color if needed,
                    // the animation background color if needed,
@@ -1748,10 +1749,11 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
                    final Task parentTask = activityRecord != null
                    final Task parentTask = activityRecord != null
                            ? activityRecord.getTask()
                            ? activityRecord.getTask()
                            : taskFragment.getTask();
                            : taskFragment.getTask();
                    backgroundColor = ColorUtils.setAlphaComponent(
                    backgroundColor = parentTask.getTaskDescription().getBackgroundColor();
                            parentTask.getTaskDescription().getBackgroundColor(), 255);
                }
                }
                change.setBackgroundColor(backgroundColor);
                // Set to opaque for animation background to prevent it from exposing the blank
                // background or content below.
                change.setBackgroundColor(ColorUtils.setAlphaComponent(backgroundColor, 255));
            }
            }


            change.setRotation(info.mRotation, endRotation);
            change.setRotation(info.mRotation, endRotation);
+8 −4
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@ import static android.os.UserHandle.USER_NULL;
import static android.view.SurfaceControl.Transaction;
import static android.view.SurfaceControl.Transaction;
import static android.view.WindowManager.LayoutParams.INVALID_WINDOW_TYPE;
import static android.view.WindowManager.LayoutParams.INVALID_WINDOW_TYPE;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.window.TaskFragmentAnimationParams.DEFAULT_ANIMATION_BACKGROUND_COLOR;


import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ANIM;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ANIM;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
@@ -3168,7 +3169,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
                            ? activityRecord.getOrganizedTaskFragment()
                            ? activityRecord.getOrganizedTaskFragment()
                            : taskFragment.getOrganizedTaskFragment();
                            : taskFragment.getOrganizedTaskFragment();
                    if (organizedTf != null && organizedTf.getAnimationParams()
                    if (organizedTf != null && organizedTf.getAnimationParams()
                            .getAnimationBackgroundColor() != 0) {
                            .getAnimationBackgroundColor() != DEFAULT_ANIMATION_BACKGROUND_COLOR) {
                        // This window is embedded and has an animation background color set on the
                        // This window is embedded and has an animation background color set on the
                        // TaskFragment. Pass this color with this window, so the handler can use it
                        // TaskFragment. Pass this color with this window, so the handler can use it
                        // as the animation background color if needed,
                        // as the animation background color if needed,
@@ -3181,11 +3182,14 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
                        final Task parentTask = activityRecord != null
                        final Task parentTask = activityRecord != null
                                ? activityRecord.getTask()
                                ? activityRecord.getTask()
                                : taskFragment.getTask();
                                : taskFragment.getTask();
                        backgroundColorForTransition = ColorUtils.setAlphaComponent(
                        backgroundColorForTransition = parentTask.getTaskDescription()
                                parentTask.getTaskDescription().getBackgroundColor(), 255);
                                .getBackgroundColor();
                    }
                    }
                }
                }
                animationRunnerBuilder.setTaskBackgroundColor(backgroundColorForTransition);
                // Set to opaque for animation background to prevent it from exposing the blank
                // background or content below.
                animationRunnerBuilder.setTaskBackgroundColor(ColorUtils.setAlphaComponent(
                        backgroundColorForTransition, 255));
            }
            }


            animationRunnerBuilder.build()
            animationRunnerBuilder.build()