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

Commit 8f25ff0e authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas Committed by Android (Google) Code Review
Browse files

Merge "Replace compat UI related z values with constants in TaskConstants" into udc-dev

parents cf116363 e84bed21
Loading
Loading
Loading
Loading
+7 −14
Original line number Diff line number Diff line
@@ -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
+2 −6
Original line number Diff line number Diff line
@@ -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
+2 −7
Original line number Diff line number Diff line
@@ -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<LetterboxEduDialogLayout> 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
+2 −6
Original line number Diff line number Diff line
@@ -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
+2 −7
Original line number Diff line number Diff line
@@ -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<RestartDialogLayout> 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
Loading