Remove the explicit callback, not all of them
Test: manual - expand / collapse / switch between bubbles
works fine
Bug: 181896441
Change-Id: Ib724b2195aeb7748ade669964a65394e61f675a5
This commit is contained in:
@@ -151,6 +151,7 @@ public class BubbleStackView extends FrameLayout
|
||||
* starting a new animation.
|
||||
*/
|
||||
private final ShellExecutor mDelayedAnimationExecutor;
|
||||
private Runnable mDelayedAnimation;
|
||||
|
||||
/**
|
||||
* Interface to synchronize {@link View} state and the screen.
|
||||
@@ -1865,7 +1866,7 @@ public class BubbleStackView extends FrameLayout
|
||||
mExpandedBubble.getExpandedView().setAlphaAnimating(true);
|
||||
}
|
||||
|
||||
mDelayedAnimationExecutor.executeDelayed(() -> {
|
||||
mDelayedAnimation = () -> {
|
||||
mExpandedViewAlphaAnimator.start();
|
||||
|
||||
PhysicsAnimator.getInstance(mExpandedViewContainerMatrix).cancel();
|
||||
@@ -1898,7 +1899,8 @@ public class BubbleStackView extends FrameLayout
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}, startDelay);
|
||||
};
|
||||
mDelayedAnimationExecutor.executeDelayed(mDelayedAnimation, startDelay);
|
||||
}
|
||||
|
||||
private void animateCollapse() {
|
||||
@@ -2097,7 +2099,7 @@ public class BubbleStackView extends FrameLayout
|
||||
* animating flags for those animations.
|
||||
*/
|
||||
private void cancelDelayedExpandCollapseSwitchAnimations() {
|
||||
mDelayedAnimationExecutor.removeAllCallbacks();
|
||||
mDelayedAnimationExecutor.removeCallbacks(mDelayedAnimation);
|
||||
|
||||
mIsExpansionAnimating = false;
|
||||
mIsBubbleSwitchAnimating = false;
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.wm.shell.common;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
/** Executor implementation which is backed by a Handler. */
|
||||
public class HandlerExecutor implements ShellExecutor {
|
||||
@@ -46,11 +45,6 @@ public class HandlerExecutor implements ShellExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllCallbacks() {
|
||||
mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCallbacks(@NonNull Runnable r) {
|
||||
mHandler.removeCallbacks(r);
|
||||
|
||||
@@ -16,16 +16,10 @@
|
||||
|
||||
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.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BooleanSupplier;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
@@ -93,11 +87,6 @@ public interface ShellExecutor extends Executor {
|
||||
*/
|
||||
void executeDelayed(Runnable runnable, long delayMillis);
|
||||
|
||||
/**
|
||||
* Removes all pending callbacks.
|
||||
*/
|
||||
void removeAllCallbacks();
|
||||
|
||||
/**
|
||||
* See {@link android.os.Handler#removeCallbacks}.
|
||||
*/
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package com.android.wm.shell;
|
||||
|
||||
import android.os.Looper;
|
||||
|
||||
import com.android.wm.shell.common.ShellExecutor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -39,11 +37,6 @@ public class TestShellExecutor implements ShellExecutor {
|
||||
mRunnables.add(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllCallbacks() {
|
||||
mRunnables.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCallbacks(Runnable r) {
|
||||
mRunnables.remove(r);
|
||||
|
||||
@@ -33,10 +33,6 @@ public class SyncExecutor implements ShellExecutor {
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllCallbacks() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCallbacks(Runnable runnable) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user