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

Commit 651be19f authored by Mady Mellor's avatar Mady Mellor Committed by Android (Google) Code Review
Browse files

Merge "Remove the explicit callback, not all of them" into sc-dev

parents 463ec227 8b7afff3
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -151,6 +151,7 @@ public class BubbleStackView extends FrameLayout
     * starting a new animation.
     * starting a new animation.
     */
     */
    private final ShellExecutor mDelayedAnimationExecutor;
    private final ShellExecutor mDelayedAnimationExecutor;
    private Runnable mDelayedAnimation;


    /**
    /**
     * Interface to synchronize {@link View} state and the screen.
     * Interface to synchronize {@link View} state and the screen.
@@ -1865,7 +1866,7 @@ public class BubbleStackView extends FrameLayout
            mExpandedBubble.getExpandedView().setAlphaAnimating(true);
            mExpandedBubble.getExpandedView().setAlphaAnimating(true);
        }
        }


        mDelayedAnimationExecutor.executeDelayed(() -> {
        mDelayedAnimation = () -> {
            mExpandedViewAlphaAnimator.start();
            mExpandedViewAlphaAnimator.start();


            PhysicsAnimator.getInstance(mExpandedViewContainerMatrix).cancel();
            PhysicsAnimator.getInstance(mExpandedViewContainerMatrix).cancel();
@@ -1898,7 +1899,8 @@ public class BubbleStackView extends FrameLayout
                        }
                        }
                    })
                    })
                    .start();
                    .start();
        }, startDelay);
        };
        mDelayedAnimationExecutor.executeDelayed(mDelayedAnimation, startDelay);
    }
    }


    private void animateCollapse() {
    private void animateCollapse() {
@@ -2097,7 +2099,7 @@ public class BubbleStackView extends FrameLayout
     * animating flags for those animations.
     * animating flags for those animations.
     */
     */
    private void cancelDelayedExpandCollapseSwitchAnimations() {
    private void cancelDelayedExpandCollapseSwitchAnimations() {
        mDelayedAnimationExecutor.removeAllCallbacks();
        mDelayedAnimationExecutor.removeCallbacks(mDelayedAnimation);


        mIsExpansionAnimating = false;
        mIsExpansionAnimating = false;
        mIsBubbleSwitchAnimating = false;
        mIsBubbleSwitchAnimating = false;
+0 −6
Original line number Original line Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.wm.shell.common;


import android.annotation.NonNull;
import android.annotation.NonNull;
import android.os.Handler;
import android.os.Handler;
import android.os.Looper;


/** Executor implementation which is backed by a Handler. */
/** Executor implementation which is backed by a Handler. */
public class HandlerExecutor implements ShellExecutor {
public class HandlerExecutor implements ShellExecutor {
@@ -46,11 +45,6 @@ public class HandlerExecutor implements ShellExecutor {
        }
        }
    }
    }


    @Override
    public void removeAllCallbacks() {
        mHandler.removeCallbacksAndMessages(null);
    }

    @Override
    @Override
    public void removeCallbacks(@NonNull Runnable r) {
    public void removeCallbacks(@NonNull Runnable r) {
        mHandler.removeCallbacks(r);
        mHandler.removeCallbacks(r);
+0 −11
Original line number Original line Diff line number Diff line
@@ -16,16 +16,10 @@


package com.android.wm.shell.common;
package com.android.wm.shell.common;


import android.os.Looper;
import android.os.SystemClock;
import android.os.Trace;

import java.lang.reflect.Array;
import java.lang.reflect.Array;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeUnit;
import java.util.function.BooleanSupplier;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.function.Supplier;


/**
/**
@@ -93,11 +87,6 @@ public interface ShellExecutor extends Executor {
     */
     */
    void executeDelayed(Runnable runnable, long delayMillis);
    void executeDelayed(Runnable runnable, long delayMillis);


    /**
     * Removes all pending callbacks.
     */
    void removeAllCallbacks();

    /**
    /**
     * See {@link android.os.Handler#removeCallbacks}.
     * See {@link android.os.Handler#removeCallbacks}.
     */
     */
+0 −7
Original line number Original line Diff line number Diff line
@@ -16,8 +16,6 @@


package com.android.wm.shell;
package com.android.wm.shell;


import android.os.Looper;

import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.ShellExecutor;


import java.util.ArrayList;
import java.util.ArrayList;
@@ -39,11 +37,6 @@ public class TestShellExecutor implements ShellExecutor {
        mRunnables.add(r);
        mRunnables.add(r);
    }
    }


    @Override
    public void removeAllCallbacks() {
        mRunnables.clear();
    }

    @Override
    @Override
    public void removeCallbacks(Runnable r) {
    public void removeCallbacks(Runnable r) {
        mRunnables.remove(r);
        mRunnables.remove(r);
+0 −4
Original line number Original line Diff line number Diff line
@@ -33,10 +33,6 @@ public class SyncExecutor implements ShellExecutor {
        runnable.run();
        runnable.run();
    }
    }


    @Override
    public void removeAllCallbacks() {
    }

    @Override
    @Override
    public void removeCallbacks(Runnable runnable) {
    public void removeCallbacks(Runnable runnable) {
    }
    }