diff --git a/core/java/android/window/TaskConstants.java b/core/java/android/window/TaskConstants.java index 3a04198a3addb..e18fd50dc38e8 100644 --- a/core/java/android/window/TaskConstants.java +++ b/core/java/android/window/TaskConstants.java @@ -47,37 +47,31 @@ public class TaskConstants { -2 * TASK_CHILD_LAYER_REGION_SIZE; /** - * When a unresizable app is moved in the different configuration, a restart button appears - * allowing to adapt (~resize) app to the new configuration mocks. + * Compat UI components: reachability education, size compat restart + * button, letterbox education, restart dialog. * @hide */ - public static final int TASK_CHILD_LAYER_SIZE_COMPAT_RESTART_BUTTON = - TASK_CHILD_LAYER_REGION_SIZE; + public static final int TASK_CHILD_LAYER_COMPAT_UI = TASK_CHILD_LAYER_REGION_SIZE; - /** - * Shown the first time an app is opened in size compat mode in landscape. - * @hide - */ - public static final int TASK_CHILD_LAYER_LETTERBOX_EDUCATION = 2 * TASK_CHILD_LAYER_REGION_SIZE; /** * Captions, window frames and resize handlers around task windows. * @hide */ - public static final int TASK_CHILD_LAYER_WINDOW_DECORATIONS = 3 * TASK_CHILD_LAYER_REGION_SIZE; + public static final int TASK_CHILD_LAYER_WINDOW_DECORATIONS = 2 * TASK_CHILD_LAYER_REGION_SIZE; /** * Overlays the task when going into PIP w/ gesture navigation. * @hide */ public static final int TASK_CHILD_LAYER_RECENTS_ANIMATION_PIP_OVERLAY = - 4 * TASK_CHILD_LAYER_REGION_SIZE; + 3 * TASK_CHILD_LAYER_REGION_SIZE; /** * Allows other apps to add overlays on the task (i.e. game dashboard) * @hide */ - public static final int TASK_CHILD_LAYER_TASK_OVERLAY = 5 * TASK_CHILD_LAYER_REGION_SIZE; + public static final int TASK_CHILD_LAYER_TASK_OVERLAY = 4 * TASK_CHILD_LAYER_REGION_SIZE; /** * Z-orders of task child layers other than activities, task fragments and layers interleaved @@ -87,8 +81,7 @@ public class TaskConstants { @IntDef({ TASK_CHILD_LAYER_TASK_BACKGROUND, TASK_CHILD_LAYER_LETTERBOX_BACKGROUND, - TASK_CHILD_LAYER_SIZE_COMPAT_RESTART_BUTTON, - TASK_CHILD_LAYER_LETTERBOX_EDUCATION, + TASK_CHILD_LAYER_COMPAT_UI, TASK_CHILD_LAYER_WINDOW_DECORATIONS, TASK_CHILD_LAYER_RECENTS_ANIMATION_PIP_OVERLAY, TASK_CHILD_LAYER_TASK_OVERLAY diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManager.java index 170c0ee91b408..659229228a571 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManager.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManager.java @@ -20,6 +20,7 @@ import static android.app.TaskInfo.CAMERA_COMPAT_CONTROL_DISMISSED; import static android.app.TaskInfo.CAMERA_COMPAT_CONTROL_HIDDEN; import static android.app.TaskInfo.CAMERA_COMPAT_CONTROL_TREATMENT_APPLIED; import static android.app.TaskInfo.CAMERA_COMPAT_CONTROL_TREATMENT_SUGGESTED; +import static android.window.TaskConstants.TASK_CHILD_LAYER_COMPAT_UI; import android.annotation.NonNull; import android.annotation.Nullable; @@ -46,11 +47,6 @@ import java.util.function.Consumer; */ class CompatUIWindowManager extends CompatUIWindowManagerAbstract { - /** - * The Compat UI should be below the Letterbox Education. - */ - private static final int Z_ORDER = LetterboxEduWindowManager.Z_ORDER - 1; - private final CompatUICallback mCallback; private final CompatUIConfiguration mCompatUIConfiguration; @@ -92,7 +88,7 @@ class CompatUIWindowManager extends CompatUIWindowManagerAbstract { @Override protected int getZOrder() { - return Z_ORDER; + return TASK_CHILD_LAYER_COMPAT_UI + 1; } @Override diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/LetterboxEduWindowManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/LetterboxEduWindowManager.java index 0c21c8ccd6868..959c50d5c6400 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/LetterboxEduWindowManager.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/LetterboxEduWindowManager.java @@ -17,6 +17,7 @@ package com.android.wm.shell.compatui; import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING; +import static android.window.TaskConstants.TASK_CHILD_LAYER_COMPAT_UI; import android.annotation.NonNull; import android.annotation.Nullable; @@ -46,12 +47,6 @@ import java.util.function.Consumer; */ class LetterboxEduWindowManager extends CompatUIWindowManagerAbstract { - /** - * The Letterbox Education should be the topmost child of the Task in case there can be more - * than one child. - */ - public static final int Z_ORDER = Integer.MAX_VALUE; - private final DialogAnimationController mAnimationController; private final Transitions mTransitions; @@ -118,7 +113,7 @@ class LetterboxEduWindowManager extends CompatUIWindowManagerAbstract { @Override protected int getZOrder() { - return Z_ORDER; + return TASK_CHILD_LAYER_COMPAT_UI + 2; } @Override diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/ReachabilityEduWindowManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/ReachabilityEduWindowManager.java index b6e396d125124..a18ab9154e01f 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/ReachabilityEduWindowManager.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/ReachabilityEduWindowManager.java @@ -18,6 +18,7 @@ package com.android.wm.shell.compatui; import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; +import static android.window.TaskConstants.TASK_CHILD_LAYER_COMPAT_UI; import android.annotation.NonNull; import android.annotation.Nullable; @@ -41,11 +42,6 @@ import com.android.wm.shell.common.SyncTransactionQueue; */ class ReachabilityEduWindowManager extends CompatUIWindowManagerAbstract { - /** - * The Compat UI should be below the Letterbox Education. - */ - private static final int Z_ORDER = LetterboxEduWindowManager.Z_ORDER - 1; - // The time to wait before hiding the education private static final long DISAPPEAR_DELAY_MS = 4000L; @@ -102,7 +98,7 @@ class ReachabilityEduWindowManager extends CompatUIWindowManagerAbstract { @Override protected int getZOrder() { - return Z_ORDER; + return TASK_CHILD_LAYER_COMPAT_UI + 1; } @Override diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/RestartDialogWindowManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/RestartDialogWindowManager.java index aab123a843ea3..5133dd6b759cf 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/RestartDialogWindowManager.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/RestartDialogWindowManager.java @@ -17,6 +17,7 @@ package com.android.wm.shell.compatui; import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING; +import static android.window.TaskConstants.TASK_CHILD_LAYER_COMPAT_UI; import android.annotation.NonNull; import android.annotation.Nullable; @@ -47,12 +48,6 @@ import java.util.function.Consumer; */ class RestartDialogWindowManager extends CompatUIWindowManagerAbstract { - /** - * The restart dialog should be the topmost child of the Task in case there can be more - * than one child. - */ - private static final int Z_ORDER = Integer.MAX_VALUE; - private final DialogAnimationController mAnimationController; private final Transitions mTransitions; @@ -112,7 +107,7 @@ class RestartDialogWindowManager extends CompatUIWindowManagerAbstract { @Override protected int getZOrder() { - return Z_ORDER; + return TASK_CHILD_LAYER_COMPAT_UI + 2; } @Override diff --git a/services/core/java/com/android/server/wm/Letterbox.java b/services/core/java/com/android/server/wm/Letterbox.java index 3d006868c79c4..35513707ebc51 100644 --- a/services/core/java/com/android/server/wm/Letterbox.java +++ b/services/core/java/com/android/server/wm/Letterbox.java @@ -18,6 +18,7 @@ package com.android.server.wm; import static android.os.InputConstants.DEFAULT_DISPATCHING_TIMEOUT_MILLIS; import static android.view.SurfaceControl.HIDDEN; +import static android.window.TaskConstants.TASK_CHILD_LAYER_LETTERBOX_BACKGROUND; import android.content.Context; import android.graphics.Color; @@ -361,7 +362,8 @@ public class Letterbox { .setCallsite("LetterboxSurface.createSurface") .build(); - t.setLayer(mSurface, -1).setColorSpaceAgnostic(mSurface, true); + t.setLayer(mSurface, TASK_CHILD_LAYER_LETTERBOX_BACKGROUND) + .setColorSpaceAgnostic(mSurface, true); } void attachInput(WindowState win) {