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

Commit 0c893536 authored by Chilun Huang's avatar Chilun Huang
Browse files

Destroy the last embedded activity immediately

When a back gesture on the last embedded activity, it is added to the
stopping list and waits for an idle event to be finished. But, the
next activity, on the other splitted side, is already visible and
won't trigger the idle event. Eventually cause the split-screen cannot
be dismissed.

The embedded activity doesn't need the animation because it is the last
one. Destroy it immediately so split-screen can be dismissed.

Bug: 230588790
Test: atest RecentsAnimationControllerTest
Change-Id: I4c230cfe902531db7d80b3bbe00e89c30ced99aa
parent 56043e3d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3532,7 +3532,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        final ActivityRecord next = getDisplayArea().topRunningActivity(
                true /* considerKeyguardState */);

        // If the finishing activity is the last activity of a organized TaskFragment and has an
        // If the finishing activity is the last activity of an organized TaskFragment and has an
        // adjacent TaskFragment, check if the activity removal should be delayed.
        boolean delayRemoval = false;
        final TaskFragment taskFragment = getTaskFragment();
@@ -3540,7 +3540,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            final TaskFragment organized = taskFragment.getOrganizedTaskFragment();
            final TaskFragment adjacent =
                    organized != null ? organized.getAdjacentTaskFragment() : null;
            if (adjacent != null && organized.topRunningActivity() == null) {
            if (adjacent != null && next.isDescendantOf(adjacent)
                    && organized.topRunningActivity() == null) {
                delayRemoval = organized.isDelayLastActivityRemoval();
            }
        }