Merge "Update recent tasks order when the last resumed activity changed" into tm-qpr-dev am: d7f0da6718 am: aad1a8a0e4

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

Change-Id: Icfed2b8138655cd98d4858f7a6775e2b0e9c969c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jerry Chang
2023-01-18 04:35:33 +00:00
committed by Automerger Merge Worker
2 changed files with 14 additions and 0 deletions

View File

@@ -4756,6 +4756,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
mTaskChangeNotificationController.notifyTaskFocusChanged(prevTask.mTaskId, false);
}
mTaskChangeNotificationController.notifyTaskFocusChanged(task.mTaskId, true);
mTaskSupervisor.mRecentTasks.add(task);
}
applyUpdateLockStateLocked(r);

View File

@@ -248,6 +248,19 @@ public class ActivityTaskSupervisorTests extends WindowTestsBase {
eq(true) /* focused */);
}
/**
* Ensures it updates recent tasks order when the last resumed activity changed.
*/
@Test
public void testUpdateRecentTasksForTopResumed() {
spyOn(mSupervisor.mRecentTasks);
final ActivityRecord activity = new ActivityBuilder(mAtm).setCreateTask(true).build();
final Task task = activity.getTask();
mAtm.setLastResumedActivityUncheckLocked(activity, "test");
verify(mSupervisor.mRecentTasks).add(eq(task));
}
/**
* Ensures that a trusted display can launch arbitrary activity and an untrusted display can't.
*/