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

Commit aef1832b authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Find only non-finishing top activity when TDA#onLeafTaskMoved" into main

parents 9f1cf060 65a56053
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -4324,10 +4324,12 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                task = mRootWindowContainer.getDefaultTaskDisplayArea().getRootTask(
                        t -> t.isActivityTypeStandard());
            }
            if (task != null && task.getTopMostActivity() != null
                    && !task.getTopMostActivity().isState(FINISHING, DESTROYING, DESTROYED)) {
            final ActivityRecord topActivity = task != null
                    ? task.getTopMostActivity()
                    : null;
            if (topActivity != null && !topActivity.isState(FINISHING, DESTROYING, DESTROYED)) {
                mWindowManager.mAtmService.mActivityClientController
                        .onPictureInPictureUiStateChanged(task.getTopMostActivity(), pipState);
                        .onPictureInPictureUiStateChanged(topActivity, pipState);
            }
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {

                // If the previous front-most task is moved to the back, then notify of the new
                // front-most task.
                final ActivityRecord topMost = getTopMostActivity();
                final ActivityRecord topMost = getTopNonFinishingActivity();
                if (topMost != null) {
                    mAtmService.getTaskChangeNotificationController().notifyTaskMovedToFront(
                            topMost.getTask().getTaskInfo());
+1 −0
Original line number Diff line number Diff line
@@ -1224,6 +1224,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
                false /* ignoringKeyguard */, true /* ignoringInvisibleActivity */);
    }

    @Override
    ActivityRecord getTopNonFinishingActivity() {
        return getTopNonFinishingActivity(
                true /* includeOverlays */, true /* includeLaunchedFromBubble */);
+4 −0
Original line number Diff line number Diff line
@@ -2079,6 +2079,10 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        return getActivity(alwaysTruePredicate(), true /* traverseTopToBottom */);
    }

    ActivityRecord getTopNonFinishingActivity() {
        return getActivity(r -> !r.finishing, true /* traverseTopToBottom */);
    }

    ActivityRecord getTopActivity(boolean includeFinishing, boolean includeOverlays) {
        // Break down into 4 calls to avoid object creation due to capturing input params.
        if (includeFinishing) {