Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bda2323 authored by Louis Chang's avatar Louis Chang
Browse files

Clean up resources before detaching the task from hierarchy

Bug: 145780344
Test: atest DisplayTests#testNonDefaultDisplayResourcesConfiguration

Change-Id: Ida82f8f6db94b50ac71fe0dea55edc730c5886c8
parent c00acc6f
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -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());