• 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.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      * This flag is now deprecated and should not be used.
61      */
62     DEPRECATED_PREVENT_SPLITTING = 1 << 4,
63 
64     /**
65      * Indicates that this window shows the wallpaper behind it, so all touch events
66      * that it receives should also be sent to the wallpaper.
67      */
68     DUPLICATE_TOUCH_TO_WALLPAPER = 1 << 5,
69 
70     /** Indicates that this the wallpaper's input window. */
71     IS_WALLPAPER                 = 1 << 6,
72 
73     /**
74      * Indicates that input events should not be dispatched to this window. When set,
75      * input events directed towards this window will simply be dropped, and will not
76      * be dispatched to windows behind it.
77      */
78     PAUSE_DISPATCHING            = 1 << 7,
79 
80     /**
81      * This flag is set when the window is of a trusted type that is allowed to silently
82      * overlay other windows for the purpose of implementing the secure views feature.
83      * Trusted overlays, such as IME windows, can partly obscure other windows without causing
84      * motion events to be delivered to them with AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED.
85      */
86     TRUSTED_OVERLAY              = 1 << 8,
87 
88     /**
89      * Indicates that this window wants to listen for when there is a touch DOWN event
90      * that occurs outside its touchable bounds. When such an event occurs, this window
91      * will receive a MotionEvent with ACTION_OUTSIDE.
92      */
93     WATCH_OUTSIDE_TOUCH          = 1 << 9,
94 
95     /**
96      * When set, this flag allows touches to leave the current window whenever the finger
97      * moves above another window. When this happens, the window that touch has just left
98      * (the current window) will receive ACTION_CANCEL, and the window that touch has entered
99      * will receive ACTION_DOWN, and the remainder of the touch gesture will only go to the
100      * new window. Without this flag, the entire gesture is sent to the current window, even
101      * if the touch leaves the window's bounds.
102      */
103     SLIPPERY                     = 1 << 10,
104 
105     /**
106      * When this window has focus, does not call user activity for all input events so
107      * the application will have to do it itself.
108      */
109     DISABLE_USER_ACTIVITY        = 1 << 11,
110 
111     /**
112      * Internal flag used to indicate that input should be dropped on this window.
113      */
114     DROP_INPUT                   = 1 << 12,
115 
116     /**
117      * Internal flag used to indicate that input should be dropped on this window if this window
118      * is obscured.
119      */
120     DROP_INPUT_IF_OBSCURED       = 1 << 13,
121 
122     /**
123      * An input spy window. This window will receive all pointer events within its touchable
124      * area, but will not stop events from being sent to other windows below it in z-order.
125      * An input event will be dispatched to all spy windows above the top non-spy window at the
126      * event's coordinates.
127      */
128     SPY                          = 1 << 14,
129 
130     /**
131      * When used with {@link #NOT_TOUCHABLE}, this window will continue to receive events from
132      * a stylus device within its touchable region. All other pointer events, such as from a
133      * mouse or touchscreen, will be dispatched to the windows behind it.
134      *
135      * This configuration has no effect when the config {@link #NOT_TOUCHABLE} is not set.
136      *
137      * It is not valid to set this configuration if {@link #TRUSTED_OVERLAY} is not set.
138      */
139     INTERCEPTS_STYLUS            = 1 << 15,
140 
141     /**
142      * The window is a clone of another window. This may be treated differently since there's
143      * likely a duplicate window with the same client token, but different bounds.
144      */
145     CLONE                        = 1 << 16,
146 
147     /**
148      * If the stylus is currently down *anywhere* on the screen, new touches will not be delivered
149      * to the window with this flag. This helps prevent unexpected clicks on some system windows,
150      * like StatusBar and TaskBar.
151      */
152     GLOBAL_STYLUS_BLOCKS_TOUCH   = 1 << 17,
153 
154     /**
155      * InputConfig used to indicate that this window is privacy sensitive. This may be used to
156      * redact input interactions from tracing or screen mirroring.
157      *
158      * This must be set on windows that use {@link WindowManager.LayoutParams#FLAG_SECURE},
159      * but it may also be set without setting FLAG_SECURE. The tracing configuration will
160      * determine how these sensitive events are eventually traced.
161      */
162      SENSITIVE_FOR_PRIVACY       = 1 << 18,
163 }
164