• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.window;
18 
19 import android.annotation.IntDef;
20 
21 /**
22  * Holds constants related to task managements but not suitable in {@code TaskOrganizer}.
23  * @hide
24  */
25 public class TaskConstants {
26 
27     /**
28      * Sizes of a z-order region assigned to child layers of task layers. Components are allowed to
29      * use all values in [assigned value, assigned value + region size).
30      * @hide
31      */
32     public static final int TASK_CHILD_LAYER_REGION_SIZE = 10000;
33 
34     /**
35      * Indicates system responding to task drag resizing while app content isn't updated.
36      * @hide
37      */
38     public static final int TASK_CHILD_LAYER_TASK_BACKGROUND = -3 * TASK_CHILD_LAYER_REGION_SIZE;
39 
40     /**
41      * Provides solid color letterbox background or blur effect and dimming for the wallpaper
42      * letterbox background. It also listens to touches for double tap gesture for repositioning
43      * letterbox.
44      * @hide
45      */
46     public static final int TASK_CHILD_LAYER_LETTERBOX_BACKGROUND =
47             -2 * TASK_CHILD_LAYER_REGION_SIZE;
48 
49     /**
50      * When a unresizable app is moved in the different configuration, a restart button appears
51      * allowing to adapt (~resize) app to the new configuration mocks.
52      * @hide
53      */
54     public static final int TASK_CHILD_LAYER_SIZE_COMPAT_RESTART_BUTTON =
55             TASK_CHILD_LAYER_REGION_SIZE;
56 
57     /**
58      * Shown the first time an app is opened in size compat mode in landscape.
59      * @hide
60      */
61     public static final int TASK_CHILD_LAYER_LETTERBOX_EDUCATION = 2 * TASK_CHILD_LAYER_REGION_SIZE;
62 
63     /**
64      * Captions, window frames and resize handlers around task windows.
65      * @hide
66      */
67     public static final int TASK_CHILD_LAYER_WINDOW_DECORATIONS = 3 * TASK_CHILD_LAYER_REGION_SIZE;
68 
69     /**
70      * Overlays the task when going into PIP w/ gesture navigation.
71      * @hide
72      */
73     public static final int TASK_CHILD_LAYER_RECENTS_ANIMATION_PIP_OVERLAY =
74             4 * TASK_CHILD_LAYER_REGION_SIZE;
75 
76     /**
77      * Allows other apps to add overlays on the task (i.e. game dashboard)
78      * @hide
79      */
80     public static final int TASK_CHILD_LAYER_TASK_OVERLAY = 5 * TASK_CHILD_LAYER_REGION_SIZE;
81 
82     /**
83      * Legacy machanism to force an activity to the top of the task (i.e. for work profile
84      * comfirmation).
85      * @hide
86      */
87     public static final int TASK_CHILD_LAYER_TASK_OVERLAY_ACTIVITIES =
88             6 * TASK_CHILD_LAYER_REGION_SIZE;
89 
90     /**
91      * Z-orders of task child layers other than activities, task fragments and layers interleaved
92      * with them, e.g. IME windows. [-10000, 10000) is reserved for these layers.
93      * @hide
94      */
95     @IntDef({
96             TASK_CHILD_LAYER_TASK_BACKGROUND,
97             TASK_CHILD_LAYER_LETTERBOX_BACKGROUND,
98             TASK_CHILD_LAYER_SIZE_COMPAT_RESTART_BUTTON,
99             TASK_CHILD_LAYER_LETTERBOX_EDUCATION,
100             TASK_CHILD_LAYER_WINDOW_DECORATIONS,
101             TASK_CHILD_LAYER_RECENTS_ANIMATION_PIP_OVERLAY,
102             TASK_CHILD_LAYER_TASK_OVERLAY,
103             TASK_CHILD_LAYER_TASK_OVERLAY_ACTIVITIES
104     })
105     public @interface TaskChildLayer {}
106 }
107