Merge "Prevent having empty task added back into TDA" into sc-dev am: f4690485e1

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

Change-Id: I0ecac8c1c1c9ebdc6247b99a18722d30e8b2d395
This commit is contained in:
Tony Huang
2021-07-16 06:01:08 +00:00
committed by Automerger Merge Worker

View File

@@ -5604,7 +5604,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
@Override
public ActivityTokens getTopActivityForTask(int taskId) {
synchronized (mGlobalLock) {
final Task task = mRootWindowContainer.anyTaskForId(taskId);
final Task task = mRootWindowContainer.anyTaskForId(taskId,
MATCH_ATTACHED_TASK_ONLY);
if (task == null) {
Slog.w(TAG, "getApplicationThreadForTopActivity failed:"
+ " Requested task not found");