Fix stack reference is not updated when task organizer is dead.

The Task Organizer controller handles the binder dead when SystemUI
crashed. mTaskOrganizer was assigned to null first and then removes
the related child. But the stack reference is not updated if
taskOrgainzer is null. The invalid home task is referenced when we
start the launcher.

This CL updates the condition to make sure the stack references are
updated.

Bug: 158756447
Test: 1. Setup the split-screen.
       2. Press power key to show Lock-screen
       3. Kill the systemUI process
       4. Unlock and resume to the launcher.
Change-Id: I5c3f03c4d7fecab6e812dfba6823d79d844d6a26
This commit is contained in:
Jeff Chang
2020-07-03 20:14:02 +08:00
parent fb87c72c66
commit 1cfcdf7bc9

View File

@@ -1423,7 +1423,7 @@ class Task extends WindowContainer<WindowContainer> {
void removeChild(WindowContainer r, String reason) {
// A rootable child task that is now being removed from an organized task. Making sure
// the stack references is keep updated.
if (mTaskOrganizer != null && mCreatedByOrganizer && r.asTask() != null) {
if (mCreatedByOrganizer && r.asTask() != null) {
getDisplayArea().removeStackReferenceIfNeeded((ActivityStack) r);
}
if (!mChildren.contains(r)) {