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

Commit 50f96069 authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Remove the failed-to-launch activity if attached to a parent" into tm-dev am: 7079a988

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17190269

Change-Id: Ie7731708c1a4dc970837a286a7376779460e8c44
parents d4739840 7079a988
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1716,9 +1716,10 @@ class ActivityStarter {
        // If we are not able to proceed, disassociate the activity from the task. Leaving an
        // activity in an incomplete state can lead to issues, such as performing operations
        // without a window container.
        final Task rootTask = mStartActivity.getRootTask();
        if (rootTask != null) {
        if (mStartActivity.getTask() != null) {
            mStartActivity.finishIfPossible("startActivity", true /* oomAdj */);
        } else if (mStartActivity.getParent() != null) {
            mStartActivity.getParent().removeChild(mStartActivity);
        }

        // Root task should also be detached from display and be removed if it's empty.