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

Commit b5338d50 authored by Hongwei Wang's avatar Hongwei Wang Committed by Automerger Merge Worker
Browse files

Merge "Allow PipTouchHandler to re-enable the touches" into tm-qpr-dev am:...

Merge "Allow PipTouchHandler to re-enable the touches" into tm-qpr-dev am: 247ad78e am: d3f39b4e am: 225ffe7f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22211152



Change-Id: I601d8229420b0478558fde02fae6c4ea85f98617
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2e546ae4 225ffe7f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ public class PipAnimationController {
    /**
     * Quietly cancel the animator by removing the listeners first.
     */
    public static void quietCancel(@NonNull ValueAnimator animator) {
    static void quietCancel(@NonNull ValueAnimator animator) {
        animator.removeAllUpdateListeners();
        animator.removeAllListeners();
        animator.cancel();
+7 −0
Original line number Diff line number Diff line
@@ -145,10 +145,12 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
    // These callbacks are called on the update thread
    private final PipAnimationController.PipAnimationCallback mPipAnimationCallback =
            new PipAnimationController.PipAnimationCallback() {
        private boolean mIsCancelled;
        @Override
        public void onPipAnimationStart(TaskInfo taskInfo,
                PipAnimationController.PipTransitionAnimator animator) {
            final int direction = animator.getTransitionDirection();
            mIsCancelled = false;
            sendOnPipTransitionStarted(direction);
        }

@@ -156,6 +158,10 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
        public void onPipAnimationEnd(TaskInfo taskInfo, SurfaceControl.Transaction tx,
                PipAnimationController.PipTransitionAnimator animator) {
            final int direction = animator.getTransitionDirection();
            if (mIsCancelled) {
                sendOnPipTransitionFinished(direction);
                return;
            }
            final int animationType = animator.getAnimationType();
            final Rect destinationBounds = animator.getDestinationBounds();
            if (isInPipDirection(direction) && animator.getContentOverlayLeash() != null) {
@@ -194,6 +200,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
        public void onPipAnimationCancel(TaskInfo taskInfo,
                PipAnimationController.PipTransitionAnimator animator) {
            final int direction = animator.getTransitionDirection();
            mIsCancelled = true;
            if (isInPipDirection(direction) && animator.getContentOverlayLeash() != null) {
                fadeOutAndRemoveOverlay(animator.getContentOverlayLeash(),
                        animator::clearContentOverlay, true /* withStartDelay */);
+1 −1
Original line number Diff line number Diff line
@@ -783,7 +783,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb
                    mPipAnimationController.getCurrentAnimator();
            if (animator != null && animator.isRunning()) {
                // cancel any running animator, as it is using stale display layout information
                PipAnimationController.quietCancel(animator);
                animator.cancel();
            }
            onDisplayChangedUncheck(layout, saveRestoreSnapFraction);
        }