Merge "Notify WMShell on aborting auto-enter-pip" into udc-dev am: 0c66b151e3 am: 2ef78aa7d7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23321279
Change-Id: I65f500cbd7280ec09b7feeef096c74b7372c7454
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 92536f1..f3689a9 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -2050,8 +2050,9 @@
if (!hasTargets() || mRecentsAnimationController == null) {
// If there are no targets or the animation not started, then there is nothing to finish
mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED);
+ maybeAbortSwipePipToHome();
} else {
- maybeFinishSwipeToHome();
+ maybeFinishSwipePipToHome();
finishRecentsControllerToHome(
() -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED));
}
@@ -2063,11 +2064,24 @@
}
/**
+ * Notifies SysUI that transition is aborted if applicable and also pass leash transactions
+ * from Launcher to WM.
+ */
+ private void maybeAbortSwipePipToHome() {
+ if (mIsSwipingPipToHome && mSwipePipToHomeAnimators[0] != null) {
+ SystemUiProxy.INSTANCE.get(mContext).abortSwipePipToHome(
+ mSwipePipToHomeAnimator.getTaskId(),
+ mSwipePipToHomeAnimator.getComponentName());
+ mIsSwipingPipToHome = false;
+ }
+ }
+
+ /**
* Notifies SysUI that transition is finished if applicable and also pass leash transactions
* from Launcher to WM.
* This should happen before {@link #finishRecentsControllerToHome(Runnable)}.
*/
- private void maybeFinishSwipeToHome() {
+ private void maybeFinishSwipePipToHome() {
if (mIsSwipingPipToHome && mSwipePipToHomeAnimators[0] != null) {
SystemUiProxy.INSTANCE.get(mContext).stopSwipePipToHome(
mSwipePipToHomeAnimator.getTaskId(),
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 0577aee..380aa69 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -568,6 +568,20 @@
}
/**
+ * Notifies WM Shell that launcher has aborted all the animation for swipe to home. WM Shell
+ * can use this callback to clean up its internal states.
+ */
+ public void abortSwipePipToHome(int taskId, ComponentName componentName) {
+ if (mPip != null) {
+ try {
+ mPip.abortSwipePipToHome(taskId, componentName);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call abortSwipePipToHome");
+ }
+ }
+ }
+
+ /**
* Sets the next pip animation type to be the alpha animation.
*/
public void setPipAnimationTypeToAlpha() {