Skip entering PIP when dismissing auto-enter pip task
- Revert some changes from ag/14827090, we don't actually need to
screenshot when dismissing, but we do need to prevent pip
Bug: 190751761
Test: Swiping up from YT -> PIP
Swiping up from YT to Overview to home -> PIP
Swiping up from YT to Overview
Change-Id: I2057467d5146be6edc382d3745a1e5269cd76a6b
diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java
index 6852642..0e85ec3 100644
--- a/quickstep/src/com/android/quickstep/RecentsActivity.java
+++ b/quickstep/src/com/android/quickstep/RecentsActivity.java
@@ -353,7 +353,8 @@
public void startHome() {
if (LIVE_TILE.get()) {
RecentsView recentsView = getOverviewPanel();
- recentsView.switchToScreenshotAndFinishAnimationToRecents(this::startHomeInternal);
+ recentsView.switchToScreenshot(() -> recentsView.finishRecentsAnimation(true,
+ this::startHomeInternal));
} else {
startHomeInternal();
}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 2cfaa4d..45bcc87 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -2409,7 +2409,8 @@
public void accept(Boolean success) {
if (LIVE_TILE.get() && mEnableDrawingLiveTile && dismissedTaskView.isRunningTask()
&& success) {
- finishRecentsAnimation(true /* toHome */, () -> onEnd(success));
+ finishRecentsAnimation(true /* toRecents */, false /* shouldPip */,
+ () -> onEnd(success));
} else {
onEnd(success);
}
@@ -2420,7 +2421,8 @@
if (success) {
if (shouldRemoveTask) {
if (dismissedTaskView.getTask() != null) {
- switchToScreenshotAndFinishAnimationToRecents(() -> {
+ finishRecentsAnimation(true /* toRecents */, false /* shouldPip */,
+ () -> {
UI_HELPER_EXECUTOR.getHandler().postDelayed(() ->
ActivityManagerWrapper.getInstance().removeTask(
dismissedTaskId), REMOVE_TASK_WAIT_FOR_APP_STOP_MS);
@@ -2530,7 +2532,7 @@
mPendingAnimation.addEndListener(isSuccess -> {
if (isSuccess) {
// Remove all the task views now
- switchToScreenshotAndFinishAnimationToRecents(() -> {
+ finishRecentsAnimation(true /* toRecents */, false /* shouldPip */, () -> {
UI_HELPER_EXECUTOR.getHandler().postDelayed(
ActivityManagerWrapper.getInstance()::removeAllRecentTasks,
REMOVE_TASK_WAIT_FOR_APP_STOP_MS);
@@ -2691,7 +2693,9 @@
protected void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (LIVE_TILE.get() && mEnableDrawingLiveTile && newConfig.orientation != mOrientation) {
- switchToScreenshotAndFinishAnimationToRecents(this::updateRecentsRotation);
+ switchToScreenshot(
+ () -> finishRecentsAnimation(true /* toRecents */, false /* showPip */,
+ this::updateRecentsRotation));
mEnableDrawingLiveTile = false;
} else {
updateRecentsRotation();
@@ -3701,10 +3705,6 @@
}
}
- public void switchToScreenshotAndFinishAnimationToRecents(Runnable onFinishRunnable) {
- switchToScreenshot(() -> finishRecentsAnimation(true /* toRecents */, onFinishRunnable));
- }
-
/**
* Switch the current running task view to static snapshot mode,
* capturing the snapshot at the same time.