summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIkram Gabiyev <gabiyev@google.com>2024-01-02 16:49:45 -0800
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-01-11 01:37:23 +0000
commitf4838e8af277b0978b87ca50e0a0cb57d7c468d4 (patch)
tree645cd512cff6890e558cb9d26d7778c39c7ea2fa
parent909305e98dba226853595655a12f2adb6b765571 (diff)
downloadLauncher3-f4838e8af277b0978b87ca50e0a0cb57d7c468d4.tar.gz
Send app bounds to Shell via stopSwipePipToHome
Send app bounds used for content overlay by launcher to Shell's PiP component. This is used by Shell to reset overlay scale and offset properly after the enter animation but before the overlay fades out to avoid icon shifts. We observed that app bounds can be different depending on whether we are at 90 deg or 270 deg before fixed rotation. Moreover, the presence of the taskbar can also alter the app bounds. So supplying the app bounds we take from task view simulator to Shell should solve the issue in general. Flag: NONE Bug: 316993346 Test: manually enter PiP w/ fixed rotation in 90 or 270 deg (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:221457f00bb6e323aa57957392aafc549207653d) Merged-In: I0a26b0c69020dae399d6794d36a9f3bc8425f40b Change-Id: I0a26b0c69020dae399d6794d36a9f3bc8425f40b
-rw-r--r--quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java3
-rw-r--r--quickstep/src/com/android/quickstep/SystemUiProxy.java5
-rw-r--r--quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java4
3 files changed, 9 insertions, 3 deletions
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index d7ff59e2eb..0f931ca418 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -1574,7 +1574,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
mSwipePipToHomeAnimator.getTaskId(),
mSwipePipToHomeAnimator.getComponentName(),
mSwipePipToHomeAnimator.getDestinationBounds(),
- mSwipePipToHomeAnimator.getContentOverlay());
+ mSwipePipToHomeAnimator.getContentOverlay(),
+ mSwipePipToHomeAnimator.getAppBounds());
windowAnim = mSwipePipToHomeAnimators;
} else {
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 94ed5b9cb0..a8c680958f 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -630,10 +630,11 @@ public class SystemUiProxy implements ISystemUiProxy {
* should be responsible for cleaning up the overlay.
*/
public void stopSwipePipToHome(int taskId, ComponentName componentName, Rect destinationBounds,
- SurfaceControl overlay) {
+ SurfaceControl overlay, Rect appBounds) {
if (mPip != null) {
try {
- mPip.stopSwipePipToHome(taskId, componentName, destinationBounds, overlay);
+ mPip.stopSwipePipToHome(taskId, componentName, destinationBounds, overlay,
+ appBounds);
} catch (RemoteException e) {
Log.w(TAG, "Failed call stopSwipePipToHome");
}
diff --git a/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java b/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java
index fe6ce46072..f3ae4b1acd 100644
--- a/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java
+++ b/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java
@@ -265,6 +265,10 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim {
return mDestinationBounds;
}
+ public Rect getAppBounds() {
+ return mAppBounds;
+ }
+
@Nullable
public SurfaceControl getContentOverlay() {
return mPipContentOverlay == null ? null : mPipContentOverlay.getLeash();