Merge "Clean up resources before detaching the task from hierarchy"

This commit is contained in:
TreeHugger Robot
2019-12-06 07:35:42 +00:00
committed by Android (Google) Code Review

View File

@@ -968,6 +968,11 @@ class Task extends WindowContainer<WindowContainer> {
final ActivityStack oldStack = ((ActivityStack) oldParent);
final ActivityStack newStack = ((ActivityStack) newParent);
// Task is going to be removed, clean it up before detaching from hierarchy.
if (oldParent != null && newParent == null) {
cleanUpResourcesForDestroy();
}
mStack = newStack;
super.onParentChanged(newParent, oldParent);
@@ -1012,12 +1017,6 @@ class Task extends WindowContainer<WindowContainer> {
updateOverrideConfigurationFromLaunchBounds();
}
// Task is being removed.
if (oldParent != null && newParent == null) {
cleanUpResourcesForDestroy();
}
// Update task bounds if needed.
adjustBoundsForDisplayChangeIfNeeded(getDisplayContent());