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

Commit 0719dd5a authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Find pending AppearedActivity first" into main am: 82578104

parents faf1c6ff 82578104
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -323,8 +323,16 @@ class TaskContainer {

    @Nullable
    TaskFragmentContainer getContainerWithActivity(@NonNull IBinder activityToken) {
        return getContainer(container -> container.hasAppearedActivity(activityToken)
                || container.hasPendingAppearedActivity(activityToken));
        // When the new activity is launched to the topmost TF because the source activity
        // was in that TF, and the source activity is finished before resolving the new activity,
        // we will try to see if the new activity match a rule with the split activities below.
        // If matched, it can be reparented.
        final TaskFragmentContainer taskFragmentContainer
                = getContainer(container -> container.hasPendingAppearedActivity(activityToken));
        if (taskFragmentContainer != null) {
            return taskFragmentContainer;
        }
        return getContainer(container -> container.hasAppearedActivity(activityToken));
    }

    @Nullable
+2 −1
Original line number Diff line number Diff line
@@ -535,7 +535,8 @@ public class TaskFragmentContainerTest {
        // container1.
        container2.setInfo(mTransaction, mInfo);

        assertTrue(container2.hasActivity(mActivity.getActivityToken()));
        assertTrue(container1.hasActivity(mActivity.getActivityToken()));
        assertFalse(container2.hasActivity(mActivity.getActivityToken()));
        // When the pending appeared record is removed from container1, we respect the appeared
        // record in container2.
        container1.removePendingAppearedActivity(mActivity.getActivityToken());