Adding source bounds hint to support better PiP transition.
Bug: 35396882
Test: Start a transition with source bounds hint.
Change-Id: I4897242af84744bc05a093111a15ea52e49815e8
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 5c49dfd..9c19c2b 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2794,7 +2794,7 @@
}
}
- boolean moveTopStackActivityToPinnedStackLocked(int stackId, Rect bounds) {
+ boolean moveTopStackActivityToPinnedStackLocked(int stackId, Rect destBounds) {
final ActivityStack stack = getStack(stackId, !CREATE_IF_NEEDED, !ON_TOP);
if (stack == null) {
throw new IllegalArgumentException(
@@ -2815,13 +2815,14 @@
return false;
}
- moveActivityToPinnedStackLocked(r, "moveTopActivityToPinnedStack", bounds,
- true /* moveHomeStackToFront */);
+ moveActivityToPinnedStackLocked(r, null /* sourceBounds */, destBounds,
+ true /* moveHomeStackToFront */, "moveTopActivityToPinnedStack");
return true;
}
- void moveActivityToPinnedStackLocked(ActivityRecord r, String reason, Rect bounds,
- boolean moveHomeStackToFront) {
+ void moveActivityToPinnedStackLocked(ActivityRecord r, Rect sourceBounds, Rect destBounds,
+ boolean moveHomeStackToFront, String reason) {
+
mWindowManager.deferSurfaceLayout();
// Need to make sure the pinned stack exist so we can resize it below...
@@ -2889,7 +2890,7 @@
ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
resumeFocusedStackTopActivityLocked();
- stack.animateResizePinnedStack(bounds, -1 /* animationDuration */);
+ stack.animateResizePinnedStack(sourceBounds, destBounds, -1 /* animationDuration */);
mService.mTaskChangeNotificationController.notifyActivityPinned(r.packageName);
}