Skip to content
Commit ed592f8b authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Destroy activity if task is removed directly

Otherwise the activity is unreachable from hierarchy but
WindowProcessController still references to the activity.

- Task#removeImmediately will go super.removeImmediately so
  its children's removeImmediately will also be called. That
  is the place to destroy activity.
- Avoid reentrant of Task#removeImmediately because it is
  confusing to see multiple wm_task_removed with different
  reasons, e.g. [deleteRootTask, setTaskOrganizer] and
  [removeTask, cleanUpResourcesForDestroy]. And it also
  eliminates duplicated invocation of super.removeImmediately.
- Add validation for setLaunchRoot.

Bug: 177633638
Test: ActivityRecordTests#testRemoveImmediately

Change-Id: I762f0a720d1709bb72deaacd857d5e79ce48d1b2
parent 839c1cd5
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