From 053f11b4d3339783ec884fc3edbbe6e659a5fa9f Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Thu, 1 Jul 2021 02:49:32 -0700 Subject: [PATCH] Fix the round corner and crop issue after auto-enter-pip When auto-enter-pip from a Task with multiple activities, the leash of the task will be animated before the top activity being reparented to the pinned root task, we perform the cleanup on original task in Task#clearLastRecentsAnimationTransaction. What's fixed in this CL - reset also the corner radius - reset the window crop to be null Test cases, auto-enter-pip by navigating to test Activity in ApiDemos - from portrait, w/ source rect hint - from portrait, w/o source rect hint - from landscape, w/ source rect hint - from landscape, w/o source rect hint after entering PiP, exit to original task > hit back again and verify that both corner radius and window crop are fine Video: http://recall/-/aaaaaabFQoRHlzixHdtY/b8kkFJNjqw1Kj6yj8vfy36 Bug: 192564925 Test: manual, see description and video Change-Id: I5363e310ec53c9ec1531e7b0aaf08ba488f55d96 --- services/core/java/com/android/server/wm/Task.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 325f10f65af24..136a5a16fa7d1 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -7653,9 +7653,9 @@ class Task extends WindowContainer { mLastRecentsAnimationTransaction = null; mLastRecentsAnimationOverlay = null; // reset also the crop and transform introduced by mLastRecentsAnimationTransaction - Rect bounds = getBounds(); getPendingTransaction().setMatrix(mSurfaceControl, Matrix.IDENTITY_MATRIX, new float[9]) - .setWindowCrop(mSurfaceControl, bounds.width(), bounds.height()); + .setWindowCrop(mSurfaceControl, null) + .setCornerRadius(mSurfaceControl, 0); } void maybeApplyLastRecentsAnimationTransaction() {