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

Commit 8f52087d authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Remove detached wallpaper animations

Wasn't really supported anymore. Let's remove it from the API.

Bug: 112628612
Change-Id: I1276375cc204887a8da37a7f09ae2046216ca448
parent 35d328ae
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -50243,7 +50243,7 @@ package android.view.animation {
    method public long computeDurationHint();
    method protected void ensureInterpolator();
    method public int getBackgroundColor();
    method public boolean getDetachWallpaper();
    method public deprecated boolean getDetachWallpaper();
    method public long getDuration();
    method public boolean getFillAfter();
    method public boolean getFillBefore();
@@ -50267,7 +50267,7 @@ package android.view.animation {
    method public void scaleCurrentDuration(float);
    method public void setAnimationListener(android.view.animation.Animation.AnimationListener);
    method public void setBackgroundColor(int);
    method public void setDetachWallpaper(boolean);
    method public deprecated void setDetachWallpaper(boolean);
    method public void setDuration(long);
    method public void setFillAfter(boolean);
    method public void setFillBefore(boolean);
+5 −7
Original line number Diff line number Diff line
@@ -203,11 +203,6 @@ public abstract class Animation implements Cloneable {
     */
    private float mScaleFactor = 1f;

    /**
     * Don't animate the wallpaper.
     */
    private boolean mDetachWallpaper = false;

    private boolean mShowWallpaper;

    private boolean mMore = true;
@@ -667,9 +662,10 @@ public abstract class Animation implements Cloneable {
     *
     * @param detachWallpaper true if the wallpaper should be detached from the animation
     * @attr ref android.R.styleable#Animation_detachWallpaper
     *
     * @deprecated All window animations are running with detached wallpaper.
     */
    public void setDetachWallpaper(boolean detachWallpaper) {
        mDetachWallpaper = detachWallpaper;
    }

    /**
@@ -793,9 +789,11 @@ public abstract class Animation implements Cloneable {
    /**
     * Return value of {@link #setDetachWallpaper(boolean)}.
     * @attr ref android.R.styleable#Animation_detachWallpaper
     *
     * @deprecated All window animations are running with detached wallpaper.
     */
    public boolean getDetachWallpaper() {
        return mDetachWallpaper;
        return false;
    }

    /**
+0 −6
Original line number Diff line number Diff line
@@ -34,12 +34,6 @@ interface AnimationAdapter {

    long STATUS_BAR_TRANSITION_DURATION = 120L;

    /**
     * @return Whether we should detach the wallpaper during the animation.
     * @see Animation#setDetachWallpaper
     */
    boolean getDetachWallpaper();

    /**
     * @return Whether we should show the wallpaper during the animation.
     * @see Animation#getShowWallpaper()
+11 −45
Original line number Diff line number Diff line
@@ -439,16 +439,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            return;
        }

        final int flags = w.mAttrs.flags;

        // If this window is animating, make a note that we have an animating window and take
        // care of a request to run a detached wallpaper animation.
        if (w.isAnimating()) {
            final AnimationAdapter anim = w.getAnimation();
        // 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) {
                if ((flags & FLAG_SHOW_WALLPAPER) != 0 && anim.getDetachWallpaper()) {
                    mTmpWindow = w;
                }
            final int color = anim.getBackgroundColor();
            if (color != 0) {
                final TaskStack stack = w.getStack();
@@ -457,25 +452,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                }
            }
        }
        }

        // If this window's app token is running a detached wallpaper animation, make a note so
        // we can ensure the wallpaper is displayed behind it.
        final AppWindowToken atoken = winAnimator.mWin.mAppToken;
        final AnimationAdapter animation = atoken != null ? atoken.getAnimation() : null;
        if (animation != null) {
            if ((flags & FLAG_SHOW_WALLPAPER) != 0 && animation.getDetachWallpaper()) {
                mTmpWindow = w;
            }

            final int color = animation.getBackgroundColor();
            if (color != 0) {
                final TaskStack stack = w.getStack();
                if (stack != null) {
                    stack.setAnimationBackground(winAnimator, color);
                }
            }
        }
    };

    private final Consumer<WindowState> mScheduleToastTimeout = w -> {
@@ -2904,26 +2880,16 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        return false;
    }

    void updateWindowsForAnimator(WindowAnimator animator) {
        mTmpWindowAnimator = animator;
    void updateWindowsForAnimator() {
        forAllWindows(mUpdateWindowsForAnimator, true /* traverseTopToBottom */);
    }

    void updateWallpaperForAnimator(WindowAnimator animator) {
    /**
     * Updates the {@link TaskStack#setAnimationBackground} for all windows.
     */
    void updateBackgroundForAnimator() {
        resetAnimationBackgroundAnimator();

        // Used to indicate a detached wallpaper.
        mTmpWindow = null;
        mTmpWindowAnimator = animator;

        forAllWindows(mUpdateWallpaperForAnimator, true /* traverseTopToBottom */);

        if (animator.mWindowDetachedWallpaper != mTmpWindow) {
            if (DEBUG_WALLPAPER) Slog.v(TAG, "Detached wallpaper changed from "
                    + animator.mWindowDetachedWallpaper + " to " + mTmpWindow);
            animator.mWindowDetachedWallpaper = mTmpWindow;
            animator.mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE;
        }
    }

    boolean isInputMethodClientFocus(int uid, int pid) {
+0 −12
Original line number Diff line number Diff line
@@ -43,11 +43,6 @@ class LocalAnimationAdapter implements AnimationAdapter {
        mAnimator = animator;
    }

    @Override
    public boolean getDetachWallpaper() {
        return mSpec.getDetachWallpaper();
    }

    @Override
    public boolean getShowWallpaper() {
        return mSpec.getShowWallpaper();
@@ -97,13 +92,6 @@ class LocalAnimationAdapter implements AnimationAdapter {
     */
    interface AnimationSpec {

        /**
         * @see AnimationAdapter#getDetachWallpaper
         */
        default boolean getDetachWallpaper() {
            return false;
        }

        /**
         * @see AnimationAdapter#getShowWallpaper
         */
Loading