Merge "Allow PipTouchHandler to re-enable the touches" into tm-qpr-dev am: 247ad78eaf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22211152 Change-Id: Ib22cea25da2999344ccf43cdf938fcaae04fcfc6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -210,7 +210,7 @@ public class PipAnimationController {
|
|||||||
/**
|
/**
|
||||||
* Quietly cancel the animator by removing the listeners first.
|
* 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.removeAllUpdateListeners();
|
||||||
animator.removeAllListeners();
|
animator.removeAllListeners();
|
||||||
animator.cancel();
|
animator.cancel();
|
||||||
|
|||||||
@@ -147,10 +147,12 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
|
|||||||
// These callbacks are called on the update thread
|
// These callbacks are called on the update thread
|
||||||
private final PipAnimationController.PipAnimationCallback mPipAnimationCallback =
|
private final PipAnimationController.PipAnimationCallback mPipAnimationCallback =
|
||||||
new PipAnimationController.PipAnimationCallback() {
|
new PipAnimationController.PipAnimationCallback() {
|
||||||
|
private boolean mIsCancelled;
|
||||||
@Override
|
@Override
|
||||||
public void onPipAnimationStart(TaskInfo taskInfo,
|
public void onPipAnimationStart(TaskInfo taskInfo,
|
||||||
PipAnimationController.PipTransitionAnimator animator) {
|
PipAnimationController.PipTransitionAnimator animator) {
|
||||||
final int direction = animator.getTransitionDirection();
|
final int direction = animator.getTransitionDirection();
|
||||||
|
mIsCancelled = false;
|
||||||
sendOnPipTransitionStarted(direction);
|
sendOnPipTransitionStarted(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,6 +160,10 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
|
|||||||
public void onPipAnimationEnd(TaskInfo taskInfo, SurfaceControl.Transaction tx,
|
public void onPipAnimationEnd(TaskInfo taskInfo, SurfaceControl.Transaction tx,
|
||||||
PipAnimationController.PipTransitionAnimator animator) {
|
PipAnimationController.PipTransitionAnimator animator) {
|
||||||
final int direction = animator.getTransitionDirection();
|
final int direction = animator.getTransitionDirection();
|
||||||
|
if (mIsCancelled) {
|
||||||
|
sendOnPipTransitionFinished(direction);
|
||||||
|
return;
|
||||||
|
}
|
||||||
final int animationType = animator.getAnimationType();
|
final int animationType = animator.getAnimationType();
|
||||||
final Rect destinationBounds = animator.getDestinationBounds();
|
final Rect destinationBounds = animator.getDestinationBounds();
|
||||||
if (isInPipDirection(direction) && animator.getContentOverlayLeash() != null) {
|
if (isInPipDirection(direction) && animator.getContentOverlayLeash() != null) {
|
||||||
@@ -196,6 +202,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
|
|||||||
public void onPipAnimationCancel(TaskInfo taskInfo,
|
public void onPipAnimationCancel(TaskInfo taskInfo,
|
||||||
PipAnimationController.PipTransitionAnimator animator) {
|
PipAnimationController.PipTransitionAnimator animator) {
|
||||||
final int direction = animator.getTransitionDirection();
|
final int direction = animator.getTransitionDirection();
|
||||||
|
mIsCancelled = true;
|
||||||
if (isInPipDirection(direction) && animator.getContentOverlayLeash() != null) {
|
if (isInPipDirection(direction) && animator.getContentOverlayLeash() != null) {
|
||||||
fadeOutAndRemoveOverlay(animator.getContentOverlayLeash(),
|
fadeOutAndRemoveOverlay(animator.getContentOverlayLeash(),
|
||||||
animator::clearContentOverlay, true /* withStartDelay */);
|
animator::clearContentOverlay, true /* withStartDelay */);
|
||||||
|
|||||||
@@ -779,7 +779,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb
|
|||||||
mPipAnimationController.getCurrentAnimator();
|
mPipAnimationController.getCurrentAnimator();
|
||||||
if (animator != null && animator.isRunning()) {
|
if (animator != null && animator.isRunning()) {
|
||||||
// cancel any running animator, as it is using stale display layout information
|
// cancel any running animator, as it is using stale display layout information
|
||||||
PipAnimationController.quietCancel(animator);
|
animator.cancel();
|
||||||
}
|
}
|
||||||
onDisplayChangedUncheck(layout, saveRestoreSnapFraction);
|
onDisplayChangedUncheck(layout, saveRestoreSnapFraction);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user