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

Commit e1841dc5 authored by Pablo Gamito's avatar Pablo Gamito Committed by Android (Google) Code Review
Browse files

Merge changes Ibd9f22af,Id42f5276 into sc-qpr1-dev

* changes:
  Revert "Add API to specify background color for animations"
  Stop relying on background color attribute to set task transition background
parents 16517d73 66d4318c
Loading
Loading
Loading
Loading
+7 −14
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package android.view.animation;
import android.annotation.AnimRes;
import android.annotation.ColorInt;
import android.annotation.InterpolatorRes;
import android.app.ActivityThread;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.res.TypedArray;
@@ -259,6 +258,8 @@ public abstract class Animation implements Cloneable {

        setZAdjustment(a.getInt(com.android.internal.R.styleable.Animation_zAdjustment, ZORDER_NORMAL));

        setBackgroundColor(a.getInt(com.android.internal.R.styleable.Animation_background, 0));

        setDetachWallpaper(
                a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false));
        setShowWallpaper(
@@ -270,15 +271,6 @@ public abstract class Animation implements Cloneable {

        a.recycle();

        Context uiContext = ActivityThread.currentActivityThread().getSystemUiContext();
        TypedArray uiStyledAttrs = uiContext
                .obtainStyledAttributes(attrs, com.android.internal.R.styleable.Animation);

        setBackgroundColor(
                uiStyledAttrs.getColor(com.android.internal.R.styleable.Animation_background, 0));

        uiStyledAttrs.recycle();

        if (resID > 0) {
            setInterpolator(context, resID);
        }
@@ -640,15 +632,16 @@ public abstract class Animation implements Cloneable {
    }

    /**
     * Set background behind an animation.
     * Set background behind animation.
     *
     * @param bg The background color. If 0, no background.
     * @param bg The background color.  If 0, no background.  Currently must
     * be black, with any desired alpha level.
     *
     * @deprecated None of window animations are running with background color.
     */
    @Deprecated
    public void setBackgroundColor(@ColorInt int bg) {
        mBackgroundColor = bg;
        // The background color is not needed any more, do nothing.
    }

    /**
@@ -810,7 +803,7 @@ public abstract class Animation implements Cloneable {
    @Deprecated
    @ColorInt
    public int getBackgroundColor() {
        return mBackgroundColor;
        return 0;
    }

    /**
+4 −3
Original line number Diff line number Diff line
@@ -6822,8 +6822,9 @@
                 content for the duration of the animation. -->
            <enum name="bottom" value="-1" />
        </attr>
        <!-- Special background behind animation. Only for use with task animations.
             If 0, the default, there is no background. -->
        <!-- Special background behind animation.  Only for use with window
             animations.  Can only be a color, and only black.  If 0, the
             default, there is no background. -->
        <attr name="background" />
        <!-- Special option for window animations: if this window is on top
             of a wallpaper, don't animate the wallpaper with it. -->
+0 −11
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.server.wm;

import android.annotation.ColorInt;
import android.util.proto.ProtoOutputStream;
import android.view.SurfaceControl;
import android.view.SurfaceControl.Transaction;
@@ -107,14 +106,4 @@ interface AnimationAdapter {
    default boolean shouldDeferAnimationFinish(Runnable endDeferFinishCallback) {
        return false;
    }

    /**
     * Gets the background color to show behind an animation.
     *
     * @return The background color to show behind an animation (0 for no background color).
     */
    @ColorInt
    default int getBackgroundColor() {
        return 0;
    }
}
+0 −11
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.server.wm;
import static com.android.server.wm.AnimationAdapterProto.LOCAL;
import static com.android.server.wm.LocalAnimationAdapterProto.ANIMATION_SPEC;

import android.annotation.ColorInt;
import android.os.SystemClock;
import android.util.proto.ProtoOutputStream;
import android.view.SurfaceControl;
@@ -72,12 +71,6 @@ class LocalAnimationAdapter implements AnimationAdapter {
        return mSpec.calculateStatusBarTransitionStartTime();
    }

    @Override
    @ColorInt
    public int getBackgroundColor() {
        return mSpec.getBackgroundColor();
    }

    @Override
    public void dump(PrintWriter pw, String prefix) {
        mSpec.dump(pw, prefix);
@@ -156,9 +149,5 @@ class LocalAnimationAdapter implements AnimationAdapter {
        }

        void dumpDebugInner(ProtoOutputStream proto);

        default int getBackgroundColor() {
            return 0;
        }
    }
}
+0 −7
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static com.android.server.wm.AnimationSpecProto.WINDOW;
import static com.android.server.wm.WindowAnimationSpecProto.ANIMATION;
import static com.android.server.wm.WindowStateAnimator.ROOT_TASK_CLIP_NONE;

import android.annotation.ColorInt;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.SystemClock;
@@ -85,12 +84,6 @@ public class WindowAnimationSpec implements AnimationSpec {
        return mAnimation.computeDurationHint();
    }

    @Override
    @ColorInt
    public int getBackgroundColor() {
        return mAnimation.getBackgroundColor();
    }

    @Override
    public void apply(Transaction t, SurfaceControl leash, long currentPlayTime) {
        final TmpValues tmp = mThreadLocalTmps.get();
Loading