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

Commit f76b4a0d authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Excluding pip Task while trying to move Activity on Top" into main

parents fd427f3d aeb30c14
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3390,7 +3390,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (currentFocusedApp != null && currentFocusedApp.task == task
                && topFocusedDisplayId == mDisplayContent.getDisplayId()) {
            final Task topFocusableTask = mDisplayContent.getTask(
                    (t) -> t.isLeafTask() && t.isFocusable(), true /*  traverseTopToBottom */);
                    (t) -> t.isLeafTask() && t.isFocusable() && !t.inPinnedWindowingMode(),
                    true /*  traverseTopToBottom */);
            if (task == topFocusableTask) {
                if (currentFocusedApp == this) {
                    ProtoLog.d(WM_DEBUG_FOCUS, "moveFocusableActivityToTop: already on top "
+18 −0
Original line number Diff line number Diff line
@@ -3727,6 +3727,24 @@ public class ActivityRecordTests extends WindowTestsBase {
        verify(task).moveTaskToBack(any());
    }

    /**
     * Verifies the {@link ActivityRecord#moveFocusableActivityToTop} returns {@code false} if
     * there's a PIP task on top.
     */
    @Test
    public void testMoveFocusableActivityToTop() {
        // Create a Task
        final Task task = createTask(mDisplayContent);
        final ActivityRecord ar = createActivityRecord(task);

        // Create a PIP Task on top
        final Task pipTask = createTask(mDisplayContent);
        doReturn(true).when(pipTask).inPinnedWindowingMode();

        // Verifies that the Task is not moving-to-top.
        assertFalse(ar.moveFocusableActivityToTop("test"));
    }

    private ICompatCameraControlCallback getCompatCameraControlCallback() {
        return new ICompatCameraControlCallback.Stub() {
            @Override