summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jorge Gil <jorgegil@google.com> 2021-04-02 00:33:15 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-04-02 00:33:15 +0000
commitdfef1c17d6e7b2e66f9a609ec009c6be91823335 (patch)
tree5b81b7d067d3e6beb1a235db182007d86c73512f
parent84747c0e770faf1d58b273c21f7b3e091c24a907 (diff)
parent04b163370ba700652ecf93abe3fc877c37808b1f (diff)
Merge "Remove redundant posting of the crossfade to the main executor" into sc-dev
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java38
1 files changed, 18 insertions, 20 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
index 99ec10049340..d2d7200d88e3 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
@@ -968,28 +968,26 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
destinationBounds.height());
mSurfaceTransactionHelper.scale(t, snapshotSurface, snapshotSrc, snapshotDest);
- mMainExecutor.execute(() -> {
- // Start animation to fade out the snapshot.
- final ValueAnimator animator = ValueAnimator.ofFloat(1.0f, 0.0f);
- animator.setDuration(mEnterAnimationDuration);
- animator.addUpdateListener(animation -> {
- final float alpha = (float) animation.getAnimatedValue();
- final SurfaceControl.Transaction transaction =
+ // Start animation to fade out the snapshot.
+ final ValueAnimator animator = ValueAnimator.ofFloat(1.0f, 0.0f);
+ animator.setDuration(mEnterAnimationDuration);
+ animator.addUpdateListener(animation -> {
+ final float alpha = (float) animation.getAnimatedValue();
+ final SurfaceControl.Transaction transaction =
+ mSurfaceControlTransactionFactory.getTransaction();
+ transaction.setAlpha(snapshotSurface, alpha);
+ transaction.apply();
+ });
+ animator.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ final SurfaceControl.Transaction tx =
mSurfaceControlTransactionFactory.getTransaction();
- transaction.setAlpha(snapshotSurface, alpha);
- transaction.apply();
- });
- animator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- final SurfaceControl.Transaction tx =
- mSurfaceControlTransactionFactory.getTransaction();
- tx.remove(snapshotSurface);
- tx.apply();
- }
- });
- animator.start();
+ tx.remove(snapshotSurface);
+ tx.apply();
+ }
});
+ animator.start();
});
} else {
applyFinishBoundsResize(wct, direction);