From f6995393fb2a653918d2214d780dbc9e36c9b2d9 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Mon, 6 Jan 2025 04:55:40 +0000 Subject: [PATCH] Reduce extra binder call for take task snapshot.(2/2) It is not necessary to take the task snapshot from the Shell because it is usually executed in the SystemUI process. The Launcher can perform the same operation through ActivityManagerWrapper. Which can also help release the memory since it won't referened by 3 processes. Flag: EXEMPT bugfix Bug: 238206323 Test: close task from recents, verify SystemUI won't hold the snapshot memory Change-Id: Ia3ac4487af348f926327bcfe3cbe869b8a96cbcd --- .../src/com/android/quickstep/RecentsAnimationController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationController.java b/quickstep/src/com/android/quickstep/RecentsAnimationController.java index 145773d0c2..865cc47091 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationController.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationController.java @@ -36,6 +36,7 @@ import com.android.launcher3.util.RunnableList; import com.android.quickstep.util.ActiveGestureProtoLogProxy; import com.android.systemui.animation.TransitionAnimator; import com.android.systemui.shared.recents.model.ThumbnailData; +import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import com.android.systemui.shared.system.RecentsAnimationControllerCompat; import com.android.wm.shell.recents.IRecentsAnimationController; @@ -71,7 +72,7 @@ public class RecentsAnimationController { * currently being animated. */ public ThumbnailData screenshotTask(int taskId) { - return mController.screenshotTask(taskId); + return ActivityManagerWrapper.getInstance().takeTaskThumbnail(taskId); } /**