summaryrefslogtreecommitdiff
path: root/libs/WindowManager
diff options
context:
space:
mode:
authorMariia Sandrikova <mariiasand@google.com>2022-01-13 15:21:38 +0000
committerMariia Sandrikova <mariiasand@google.com>2022-01-13 15:21:38 +0000
commit7617679a6197f210fb0ef92f59e589e6d800df4b (patch)
tree2ceaab34bc27ceaffae4e9d99094f9db25fcf4b7 /libs/WindowManager
parentaec26c4f686a7a21d789d2880d1061432507482a (diff)
DO NOT MERGE Revert "[2/n] Camera Compat UI: Add interfaces for client-server..."
Revert submission 16468379 Reason for revert: Feature development is moving to T. Reverted Changes: Id9b9a8930:[3/n] Camera Compat UI: Add a camera compat contro... Id6be4a954:Enable a camera app compat control on Large screen... I083aa6718:[2/n] Camera Compat UI: Add interfaces for client-... Bug: 206602997 Change-Id: I9ad876043fd61f708a8f468fffd1ef371bfa0866
Diffstat (limited to 'libs/WindowManager')
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java4
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java79
2 files changed, 2 insertions, 81 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
index 1bbc9a508233..8b3a35688f11 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
@@ -458,7 +458,7 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
newListener.onTaskInfoChanged(taskInfo);
}
notifyLocusVisibilityIfNeeded(taskInfo);
- if (updated || !taskInfo.equalsForCompatUi(data.getTaskInfo())) {
+ if (updated || !taskInfo.equalsForSizeCompat(data.getTaskInfo())) {
// Notify the compat UI if the listener or task info changed.
notifyCompatUI(taskInfo, newListener);
}
@@ -633,7 +633,7 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
// The task is vanished or doesn't support compat UI, notify to remove compat UI
// on this Task if there is any.
if (taskListener == null || !taskListener.supportCompatUI()
- || !taskInfo.hasCompatUI() || !taskInfo.isVisible) {
+ || !taskInfo.topActivityInSizeCompat || !taskInfo.isVisible) {
mCompatUI.onCompatInfoChanged(taskInfo.displayId, taskInfo.taskId,
null /* taskConfig */, null /* taskListener */);
return;
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
index 7c204e636588..a3b98a8fc880 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
@@ -37,7 +37,6 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import android.app.ActivityManager.RunningTaskInfo;
-import android.app.TaskInfo;
import android.content.Context;
import android.content.LocusId;
import android.content.pm.ParceledListSlice;
@@ -367,84 +366,6 @@ public class ShellTaskOrganizerTests {
}
@Test
- public void testOnCameraCompatActivityChanged() {
- final RunningTaskInfo taskInfo1 = createTaskInfo(1, WINDOWING_MODE_FULLSCREEN);
- taskInfo1.displayId = DEFAULT_DISPLAY;
- taskInfo1.cameraCompatControlState = TaskInfo.CAMERA_COMPAT_CONTROL_HIDDEN;
- final TrackingTaskListener taskListener = new TrackingTaskListener();
- mOrganizer.addListenerForType(taskListener, TASK_LISTENER_TYPE_FULLSCREEN);
- mOrganizer.onTaskAppeared(taskInfo1, null);
-
- // Task listener sent to compat UI is null if top activity doesn't request a camera
- // compat control.
- verify(mCompatUI).onCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
- null /* taskConfig */, null /* taskListener */);
-
- // Task linster is non-null when request a camera compat control for a visible task.
- clearInvocations(mCompatUI);
- final RunningTaskInfo taskInfo2 =
- createTaskInfo(taskInfo1.taskId, taskInfo1.getWindowingMode());
- taskInfo2.displayId = taskInfo1.displayId;
- taskInfo2.cameraCompatControlState = TaskInfo.CAMERA_COMPAT_CONTROL_TREATMENT_SUGGESTED;
- taskInfo2.isVisible = true;
- mOrganizer.onTaskInfoChanged(taskInfo2);
- verify(mCompatUI).onCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
- taskInfo1.configuration, taskListener);
-
- // CompatUIController#onCompatInfoChanged is called when requested state for a camera
- // compat control changes for a visible task.
- clearInvocations(mCompatUI);
- final RunningTaskInfo taskInfo3 =
- createTaskInfo(taskInfo1.taskId, taskInfo1.getWindowingMode());
- taskInfo3.displayId = taskInfo1.displayId;
- taskInfo3.cameraCompatControlState = TaskInfo.CAMERA_COMPAT_CONTROL_TREATMENT_APPLIED;
- taskInfo3.isVisible = true;
- mOrganizer.onTaskInfoChanged(taskInfo3);
- verify(mCompatUI).onCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
- taskInfo1.configuration, taskListener);
-
- // CompatUIController#onCompatInfoChanged is called when a top activity goes in size compat
- // mode for a visible task that has a compat control.
- clearInvocations(mCompatUI);
- final RunningTaskInfo taskInfo4 =
- createTaskInfo(taskInfo1.taskId, taskInfo1.getWindowingMode());
- taskInfo4.displayId = taskInfo1.displayId;
- taskInfo4.topActivityInSizeCompat = true;
- taskInfo4.cameraCompatControlState = TaskInfo.CAMERA_COMPAT_CONTROL_TREATMENT_APPLIED;
- taskInfo4.isVisible = true;
- mOrganizer.onTaskInfoChanged(taskInfo4);
- verify(mCompatUI).onCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
- taskInfo1.configuration, taskListener);
-
- // Task linster is null when a camera compat control is dimissed for a visible task.
- clearInvocations(mCompatUI);
- final RunningTaskInfo taskInfo5 =
- createTaskInfo(taskInfo1.taskId, taskInfo1.getWindowingMode());
- taskInfo5.displayId = taskInfo1.displayId;
- taskInfo5.cameraCompatControlState = TaskInfo.CAMERA_COMPAT_CONTROL_DISMISSED;
- taskInfo5.isVisible = true;
- mOrganizer.onTaskInfoChanged(taskInfo5);
- verify(mCompatUI).onCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
- null /* taskConfig */, null /* taskListener */);
-
- // Task linster is null when request a camera compat control for a invisible task.
- clearInvocations(mCompatUI);
- final RunningTaskInfo taskInfo6 =
- createTaskInfo(taskInfo1.taskId, taskInfo1.getWindowingMode());
- taskInfo6.displayId = taskInfo1.displayId;
- taskInfo6.cameraCompatControlState = TaskInfo.CAMERA_COMPAT_CONTROL_TREATMENT_SUGGESTED;
- taskInfo6.isVisible = false;
- mOrganizer.onTaskInfoChanged(taskInfo6);
- verify(mCompatUI).onCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
- null /* taskConfig */, null /* taskListener */);
-
- clearInvocations(mCompatUI);
- mOrganizer.onTaskVanished(taskInfo1);
- verify(mCompatUI).onCompatInfoChanged(taskInfo1.displayId, taskInfo1.taskId,
- null /* taskConfig */, null /* taskListener */);
- }
-
- @Test
public void testAddLocusListener() {
RunningTaskInfo task1 = createTaskInfo(1, WINDOWING_MODE_MULTI_WINDOW);
task1.isVisible = true;