Initialize launchCookie in fillTaskInfo.

- This can cause that some tasks are routed to the wrong TaskListener.
- The TaskInfo can be reused if the previous TaskOrganizerController
  .dispatchTaskInfoChanged() exits in the middle:
    http://shortn/_I3HhUmbKPh

Bug: 177490846
Test: Check if CarLauncher with TaskView starts properly
Change-Id: I76f45c68bf7f9db34259bb6c2651d253505cdc6b
This commit is contained in:
Yuncheol Heo
2021-01-13 21:56:00 -08:00
parent 41c074582d
commit 2e4f47dc28
2 changed files with 2 additions and 0 deletions

View File

@@ -4085,6 +4085,7 @@ class Task extends WindowContainer<WindowContainer> {
info.topActivityInfo = mReuseActivitiesReport.top != null
? mReuseActivitiesReport.top.info
: null;
info.launchCookies.clear();
info.addLaunchCookie(mLaunchCookie);
forAllActivities(r -> {
info.addLaunchCookie(r.mLaunchCookie);

View File

@@ -555,6 +555,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
changed = (cfgChanges & REPORT_CONFIGS) != 0;
}
if (!(changed || force)) {
// mTmpTaskInfo will be reused next time.
return;
}
final RunningTaskInfo newInfo = mTmpTaskInfo;