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

Commit e7a1ac48 authored by Yunfan Chen's avatar Yunfan Chen Committed by Android (Google) Code Review
Browse files

Merge "Remove animation background color"

parents 571854ea 93d52249
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -52673,7 +52673,7 @@ package android.view.animation {
    method protected android.view.animation.Animation clone() throws java.lang.CloneNotSupportedException;
    method public long computeDurationHint();
    method protected void ensureInterpolator();
    method @ColorInt public int getBackgroundColor();
    method @Deprecated @ColorInt public int getBackgroundColor();
    method @Deprecated public boolean getDetachWallpaper();
    method public long getDuration();
    method public boolean getFillAfter();
@@ -52697,7 +52697,7 @@ package android.view.animation {
    method public void restrictDuration(long);
    method public void scaleCurrentDuration(float);
    method public void setAnimationListener(android.view.animation.Animation.AnimationListener);
    method public void setBackgroundColor(@ColorInt int);
    method @Deprecated public void setBackgroundColor(@ColorInt int);
    method @Deprecated public void setDetachWallpaper(boolean);
    method public void setDuration(long);
    method public void setFillAfter(boolean);
+10 −2
Original line number Diff line number Diff line
@@ -636,9 +636,12 @@ public abstract class Animation implements Cloneable {
     *
     * @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.
    }

    /**
@@ -665,6 +668,7 @@ public abstract class Animation implements Cloneable {
     *
     * @deprecated All window animations are running with detached wallpaper.
     */
    @Deprecated
    public void setDetachWallpaper(boolean detachWallpaper) {
    }

@@ -793,10 +797,13 @@ public abstract class Animation implements Cloneable {

    /**
     * Returns the background color behind the animation.
     *
     * @deprecated None of window animations are running with background color.
     */
    @Deprecated
    @ColorInt
    public int getBackgroundColor() {
        return mBackgroundColor;
        return 0;
    }

    /**
@@ -805,6 +812,7 @@ public abstract class Animation implements Cloneable {
     *
     * @deprecated All window animations are running with detached wallpaper.
     */
    @Deprecated
    public boolean getDetachWallpaper() {
        return true;
    }
+1 −1
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ message StackProto {
    repeated TaskProto tasks = 3;
    optional bool fills_parent = 4;
    optional .android.graphics.RectProto bounds = 5;
    optional bool animation_background_surface_is_dimming = 6;
    optional bool animation_background_surface_is_dimming = 6 [deprecated=true];
    optional bool defer_removal = 7;
    optional float minimize_amount = 8;
    optional bool adjusted_for_ime = 9;
+0 −6
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;
@@ -40,11 +39,6 @@ interface AnimationAdapter {
     */
    boolean getShowWallpaper();

    /**
     * @return The background color behind the animation.
     */
    @ColorInt int getBackgroundColor();

    /**
     * Requests to start the animation.
     *
+0 −35
Original line number Diff line number Diff line
@@ -583,27 +583,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        }
    };

    private final Consumer<WindowState> mUpdateWallpaperForAnimator = w -> {
        final WindowStateAnimator winAnimator = w.mWinAnimator;
        if (winAnimator.mSurfaceController == null || !winAnimator.hasSurface()) {
            return;
        }

        // If this window is animating, ensure the animation background is set.
        final AnimationAdapter anim = w.mAppToken != null
                ? w.mAppToken.getAnimation()
                : w.getAnimation();
        if (anim != null) {
            final int color = anim.getBackgroundColor();
            if (color != 0) {
                final TaskStack stack = w.getStack();
                if (stack != null) {
                    stack.setAnimationBackground(winAnimator, color);
                }
            }
        }
    };

    private final Consumer<WindowState> mScheduleToastTimeout = w -> {
        final int lostFocusUid = mTmpWindow.mOwnerUid;
        final Handler handler = mWmService.mH;
@@ -2383,12 +2362,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        mDisplayPolicy.switchUser();
    }

    private void resetAnimationBackgroundAnimator() {
        for (int stackNdx = mTaskStackContainers.getChildCount() - 1; stackNdx >= 0; --stackNdx) {
            mTaskStackContainers.getChildAt(stackNdx).resetAnimationBackgroundAnimator();
        }
    }

    @Override
    void removeIfPossible() {
        if (isAnimating()) {
@@ -3422,14 +3395,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        forAllWindows(mUpdateWindowsForAnimator, true /* traverseTopToBottom */);
    }

    /**
     * Updates the {@link TaskStack#setAnimationBackground} for all windows.
     */
    void updateBackgroundForAnimator() {
        resetAnimationBackgroundAnimator();
        forAllWindows(mUpdateWallpaperForAnimator, true /* traverseTopToBottom */);
    }

    boolean isInputMethodClientFocus(int uid, int pid) {
        final WindowState imFocus = computeImeTarget(false /* updateImeTarget */);
        if (imFocus == null) {
Loading