xref: /aosp_15_r20/frameworks/native/libs/input/android/os/InputConfig.aidl (revision 38e8c45f13ce32b0dcecb25141ffecaf386fa17f)
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.os;
18 
19 
20 /**
21  * Input configurations flags used to determine the behavior of input windows.
22  * @hide
23  */
24 @Backing(type="int")
25 enum InputConfig {
26 
27     /**
28      * The default InputConfig value with no flags set.
29      */
30     DEFAULT                      = 0,
31 
32     /**
33      * Does not construct an input channel for this window.  The channel will therefore
34      * be incapable of receiving input.
35      */
36     NO_INPUT_CHANNEL             = 1 << 0,
37 
38     /**
39      * Indicates that this input window is not visible, and thus will not be considered as
40      * an input target and will not obscure other windows.
41      */
42     NOT_VISIBLE                  = 1 << 1,
43 
44     /**
45      * Indicates that this input window cannot be a focus target, and this will not
46      * receive any input events that can only be directed for the focused window, such
47      * as key events.
48      */
49     NOT_FOCUSABLE                = 1 << 2,
50 
51     /**
52      * Indicates that this input window cannot receive any events directed at a
53      * specific location on the screen, such as touchscreen, mouse, and stylus events.
54      * The window will not be considered as a touch target, but can still obscure other
55      * windows.
56      */
57     NOT_TOUCHABLE                = 1 << 3,
58 
59     /**
60      * Indicates that this window will not accept a touch event that is split between
61      * more than one window. When set:
62      *  - If this window receives a DOWN event with the first pointer, all successive
63      *    pointers that go down, regardless of their location on the screen, will be
64      *    directed to this window;
65      *  - If the DOWN event lands outside the touchable bounds of this window, no
66      *    successive pointers that go down, regardless of their location on the screen,
67      *    will be directed to this window.
68      */
69     PREVENT_SPLITTING            = 1 << 4,
70 
71     /**
72      * Indicates that this window shows the wallpaper behind it, so all touch events
73      * that it receives should also be sent to the wallpaper.
74      */
75     DUPLICATE_TOUCH_TO_WALLPAPER = 1 << 5,
76 
77     /** Indicates that this the wallpaper's input window. */
78     IS_WALLPAPER                 = 1 << 6,
79 
80     /**
81      * Indicates that input events should not be dispatched to this window. When set,
82      * input events directed towards this window will simply be dropped, and will not
83      * be dispatched to windows behind it.
84      */
85     PAUSE_DISPATCHING            = 1 << 7,
86 
87     /**
88      * This flag is set when the window is of a trusted type that is allowed to silently
89      * overlay other windows for the purpose of implementing the secure views feature.
90      * Trusted overlays, such as IME windows, can partly obscure other windows without causing
91      * motion events to be delivered to them with AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED.
92      */
93     TRUSTED_OVERLAY              = 1 << 8,
94 
95     /**
96      * Indicates that this window wants to listen for when there is a touch DOWN event
97      * that occurs outside its touchable bounds. When such an event occurs, this window
98      * will receive a MotionEvent with ACTION_OUTSIDE.
99      */
100     WATCH_OUTSIDE_TOUCH          = 1 << 9,
101 
102     /**
103      * When set, this flag allows touches to leave the current window whenever the finger
104      * moves above another window. When this happens, the window that touch has just left
105      * (the current window) will receive ACTION_CANCEL, and the window that touch has entered
106      * will receive ACTION_DOWN, and the remainder of the touch gesture will only go to the
107      * new window. Without this flag, the entire gesture is sent to the current window, even
108      * if the touch leaves the window's bounds.
109      */
110     SLIPPERY                     = 1 << 10,
111 
112     /**
113      * When this window has focus, does not call user activity for all input events so
114      * the application will have to do it itself.
115      */
116     DISABLE_USER_ACTIVITY        = 1 << 11,
117 
118     /**
119      * Internal flag used to indicate that input should be dropped on this window.
120      */
121     DROP_INPUT                   = 1 << 12,
122 
123     /**
124      * Internal flag used to indicate that input should be dropped on this window if this window
125      * is obscured.
126      */
127     DROP_INPUT_IF_OBSCURED       = 1 << 13,
128 
129     /**
130      * An input spy window. This window will receive all pointer events within its touchable
131      * area, but will not stop events from being sent to other windows below it in z-order.
132      * An input event will be dispatched to all spy windows above the top non-spy window at the
133      * event's coordinates.
134      */
135     SPY                          = 1 << 14,
136 
137     /**
138      * When used with {@link #NOT_TOUCHABLE}, this window will continue to receive events from
139      * a stylus device within its touchable region. All other pointer events, such as from a
140      * mouse or touchscreen, will be dispatched to the windows behind it.
141      *
142      * This configuration has no effect when the config {@link #NOT_TOUCHABLE} is not set.
143      *
144      * It is not valid to set this configuration if {@link #TRUSTED_OVERLAY} is not set.
145      */
146     INTERCEPTS_STYLUS            = 1 << 15,
147 
148     /**
149      * The window is a clone of another window. This may be treated differently since there's
150      * likely a duplicate window with the same client token, but different bounds.
151      */
152     CLONE                        = 1 << 16,
153 
154     /**
155      * If the stylus is currently down *anywhere* on the screen, new touches will not be delivered
156      * to the window with this flag. This helps prevent unexpected clicks on some system windows,
157      * like StatusBar and TaskBar.
158      */
159     GLOBAL_STYLUS_BLOCKS_TOUCH   = 1 << 17,
160 
161     /**
162      * InputConfig used to indicate that this window is privacy sensitive. This may be used to
163      * redact input interactions from tracing or screen mirroring.
164      *
165      * This must be set on windows that use {@link WindowManager.LayoutParams#FLAG_SECURE},
166      * but it may also be set without setting FLAG_SECURE. The tracing configuration will
167      * determine how these sensitive events are eventually traced.
168      */
169      SENSITIVE_FOR_PRIVACY       = 1 << 18,
170 }
171