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

Commit 658d6761 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: I1d909c77fa616535e2b507de5e3bd60d87942fcb
parents b556760d 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.