Merge "Workaround for slow -1 drawing when swiping home" into tm-qpr-dev am: 2a6ddead6a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20033709

Change-Id: I4f135601a724c43f6de33d6aec5e076e9ab6f995
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Winson Chung
2022-09-27 16:47:23 +00:00
committed by Automerger Merge Worker
2 changed files with 22 additions and 2 deletions

View File

@@ -116,7 +116,7 @@ public class RecentsAnimationController implements DeathRecipient {
private boolean mWillFinishToHome = false; private boolean mWillFinishToHome = false;
private final Runnable mFailsafeRunnable = this::onFailsafe; private final Runnable mFailsafeRunnable = this::onFailsafe;
// The recents component app token that is shown behind the visibile tasks // The recents component app token that is shown behind the visible tasks
private ActivityRecord mTargetActivityRecord; private ActivityRecord mTargetActivityRecord;
private DisplayContent mDisplayContent; private DisplayContent mDisplayContent;
private int mTargetActivityType; private int mTargetActivityType;
@@ -457,6 +457,22 @@ public class RecentsAnimationController implements DeathRecipient {
} }
} }
/**
* Return whether the given window should still be considered interesting for the all-drawn
* state. This is only interesting for the target app, which may have child windows that are
* not actually visible and should not be considered interesting and waited upon.
*/
protected boolean isInterestingForAllDrawn(WindowState window) {
if (isTargetApp(window.getActivityRecord())) {
if (window.getWindowType() != TYPE_BASE_APPLICATION
&& window.getAttrs().alpha == 0f) {
// If there is a cihld window that is alpha 0, then ignore that window
return false;
}
}
// By default all windows are still interesting for all drawn purposes
return true;
}
/** /**
* Whether a task should be filtered from the recents animation. This can be true for tasks * Whether a task should be filtered from the recents animation. This can be true for tasks

View File

@@ -2043,9 +2043,13 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
* it must be drawn before allDrawn can become true. * it must be drawn before allDrawn can become true.
*/ */
boolean isInteresting() { boolean isInteresting() {
final RecentsAnimationController recentsAnimationController =
mWmService.getRecentsAnimationController();
return mActivityRecord != null && !mAppDied return mActivityRecord != null && !mAppDied
&& (!mActivityRecord.isFreezingScreen() || !mAppFreezing) && (!mActivityRecord.isFreezingScreen() || !mAppFreezing)
&& mViewVisibility == View.VISIBLE; && mViewVisibility == View.VISIBLE
&& (recentsAnimationController == null
|| recentsAnimationController.isInterestingForAllDrawn(this));
} }
/** /**