Skip to content
Commit 7900beee authored by Winson Chung's avatar Winson Chung
Browse files

Fixing issue with TaskRecord lookup.



- In ag/1721556, we switched from looking up the task in WM to looking
  up the task in AM (and using the window container controller). However,
  AM's call, anyTaskForIdLocked(), will return tasks in the recent tasks
  list along with the current stacks.  The naming of the parameter
  restoreFromRecents is partly to blame as it does not prevent lookup in
  the recent tasks and only prevents that task from being restored into
  the provided stack.

  As a result, when we removed a task from a stack, we also remove the
  associated window container controller, but when we query for the task
  to make a WCC call to it, it finds the one in the recent tasks list
  and happily uses that one (which crashes because we've the WCC).

  Instead, we break up the call to explicitly search for tasks in the
  stacks only, in stacks or recents, and in stacks or recents with restore.
  All existing calls to anyTaskForIdLocked() that are actually looking up
  a task for a WCC call (like those in ag/1721556) can use STACK_ONLY,
  while existing calls will match recents tasks and restore as required.

Bug: 35960163
Test: Open up settings > display > brightness dialog, quick switch to
      another task using overview

Change-Id: I835116fa80d47450da8c4de41fe0d54fc70cb43b
Signed-off-by: default avatarWinson Chung <winsonc@google.com>
parent 1f1416e5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment