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

Commit 4a6fe52b authored by Chris Li's avatar Chris Li Committed by Automerger Merge Worker
Browse files

Merge "Not show size compat UI when task is not visible" into sc-dev am: 927c644b am: 2d8b0319

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15225378

Change-Id: I7ca2c507dc934c52b638261c1707238e80f6e6dd
parents 758c2079 2d8b0319
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -367,7 +367,8 @@ public class TaskInfo {
                && (!topActivityInSizeCompat || configuration.windowConfiguration.getBounds()
                && (!topActivityInSizeCompat || configuration.windowConfiguration.getBounds()
                    .equals(that.configuration.windowConfiguration.getBounds()))
                    .equals(that.configuration.windowConfiguration.getBounds()))
                && (!topActivityInSizeCompat || configuration.getLayoutDirection()
                && (!topActivityInSizeCompat || configuration.getLayoutDirection()
                    == that.configuration.getLayoutDirection());
                    == that.configuration.getLayoutDirection())
                && (!topActivityInSizeCompat || isVisible == that.isVisible);
    }
    }


    /**
    /**
+1 −1
Original line number Original line Diff line number Diff line
@@ -512,7 +512,7 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
        // The task is vanished or doesn't support size compat UI, notify to remove size compat UI
        // The task is vanished or doesn't support size compat UI, notify to remove size compat UI
        // on this Task if there is any.
        // on this Task if there is any.
        if (taskListener == null || !taskListener.supportSizeCompatUI()
        if (taskListener == null || !taskListener.supportSizeCompatUI()
                || !taskInfo.topActivityInSizeCompat) {
                || !taskInfo.topActivityInSizeCompat || !taskInfo.isVisible) {
            mSizeCompatUI.onSizeCompatInfoChanged(taskInfo.displayId, taskInfo.taskId,
            mSizeCompatUI.onSizeCompatInfoChanged(taskInfo.displayId, taskInfo.taskId,
                    null /* taskConfig */, null /* taskListener */);
                    null /* taskConfig */, null /* taskListener */);
            return;
            return;
+13 −0
Original line number Original line Diff line number Diff line
@@ -305,10 +305,23 @@ public class ShellTaskOrganizerTests {
                createTaskInfo(taskInfo1.taskId, taskInfo1.getWindowingMode());
                createTaskInfo(taskInfo1.taskId, taskInfo1.getWindowingMode());
        taskInfo2.displayId = taskInfo1.displayId;
        taskInfo2.displayId = taskInfo1.displayId;
        taskInfo2.topActivityInSizeCompat = true;
        taskInfo2.topActivityInSizeCompat = true;
        taskInfo2.isVisible = true;
        mOrganizer.onTaskInfoChanged(taskInfo2);
        mOrganizer.onTaskInfoChanged(taskInfo2);
        verify(mSizeCompatUI).onSizeCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
        verify(mSizeCompatUI).onSizeCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
                taskInfo1.configuration, taskListener);
                taskInfo1.configuration, taskListener);


        // Not show size compat UI if task is not visible.
        clearInvocations(mSizeCompatUI);
        final RunningTaskInfo taskInfo3 =
                createTaskInfo(taskInfo1.taskId, taskInfo1.getWindowingMode());
        taskInfo3.displayId = taskInfo1.displayId;
        taskInfo3.topActivityToken = taskInfo1.topActivityToken;
        taskInfo3.topActivityInSizeCompat = true;
        taskInfo3.isVisible = false;
        mOrganizer.onTaskInfoChanged(taskInfo3);
        verify(mSizeCompatUI).onSizeCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
                null /* taskConfig */, null /* sizeCompatActivity*/, null /* taskListener */);

        clearInvocations(mSizeCompatUI);
        clearInvocations(mSizeCompatUI);
        mOrganizer.onTaskVanished(taskInfo1);
        mOrganizer.onTaskVanished(taskInfo1);
        verify(mSizeCompatUI).onSizeCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
        verify(mSizeCompatUI).onSizeCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,