blob: bfd92948cad7550476fd4671edfeb81c14d8b45e [file] [log] [blame]
Siarhei Vishniakou70622952020-07-30 11:17:23 -05001/**
2 * Copyright (c) 2020, 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
17package android.os;
18
19
20/** @hide */
21interface IInputConstants
22{
Peter Collingbourneb04b9b82021-02-08 12:09:47 -080023 // This should be multiplied by the value of the system property ro.hw_timeout_multiplier before
24 // use. A pre-multiplied constant is available in Java in
25 // android.os.InputConstants.DEFAULT_DISPATCHING_TIMEOUT_MILLIS.
26 const int UNMULTIPLIED_DEFAULT_DISPATCHING_TIMEOUT_MILLIS = 5000; // 5 seconds
Siarhei Vishniakou2508b872020-12-03 16:33:53 -100027
28 // Compatibility changes.
29 /**
30 * TODO(b/157929241): remove this before closing the bug. This is needed temporarily
31 * to identify apps that are using this flag.
32 */
33 const long BLOCK_FLAG_SLIPPERY = 157929241;
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -100034
35 // Indicate invalid battery capacity
36 const int INVALID_BATTERY_CAPACITY = -1;
37
38 /**
39 * Every input event has an id. This constant value is used when a valid input event id is not
40 * available.
41 */
42 const int INVALID_INPUT_EVENT_ID = 0;
Siarhei Vishniakou5d552c42021-05-21 05:02:22 +000043
44 /**
Siarhei Vishniakouf00a4ec2021-06-16 03:55:32 +000045 * The input event was injected from accessibility. Used in policyFlags for input event
46 * injection.
Siarhei Vishniakou5d552c42021-05-21 05:02:22 +000047 */
48 const int POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000;
Siarhei Vishniakouf00a4ec2021-06-16 03:55:32 +000049
50 /**
51 * The input event was generated or modified by accessibility service.
52 * Shared by both KeyEvent and MotionEvent flags, so this value should not overlap with either
53 * set of flags, including in input/Input.h and in android/input.h.
54 */
55 const int INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800;
Prabir Pradhande788502021-12-22 00:26:07 -080056
57 @Backing(type="int")
58 enum InputFeature {
59 /**
60 * When this window has focus, disable touch pad pointer gesture processing.
61 * The window will receive raw position updates from the touch pad instead
62 * of pointer movements and synthetic touch events.
63 */
64 DISABLE_POINTER_GESTURES = 0x00000001,
65
66 /**
67 * Does not construct an input channel for this window. The channel will therefore
68 * be incapable of receiving input.
69 */
70 NO_INPUT_CHANNEL = 0x00000002,
71
72 /**
73 * When this window has focus, does not call user activity for all input events so
74 * the application will have to do it itself. Should only be used by
75 * the keyguard and phone app.
76 *
77 * Should only be used by the keyguard and phone app.
78 */
79 DISABLE_USER_ACTIVITY = 0x00000004,
80
81 /**
82 * Internal flag used to indicate that input should be dropped on this window.
83 */
84 DROP_INPUT = 0x00000008,
85
86 /**
87 * Internal flag used to indicate that input should be dropped on this window if this window
88 * is obscured.
89 */
90 DROP_INPUT_IF_OBSCURED = 0x00000010,
91
92 /**
93 * An input spy window. This window will receive all pointer events within its touchable
94 * area, but will will not stop events from being sent to other windows below it in z-order.
95 * An input event will be dispatched to all spy windows above the top non-spy window at the
96 * event's coordinates.
97 */
98 SPY = 0x00000020,
99
100 /**
101 * When used with the window flag {@link #FLAG_NOT_TOUCHABLE}, this window will continue
102 * to receive events from a stylus device within its touchable region. All other pointer
103 * events, such as from a mouse or touchscreen, will be dispatched to the windows behind it.
104 *
105 * This input feature has no effect when the window flag {@link #FLAG_NOT_TOUCHABLE} is
106 * not set.
107 *
108 * The window must be a trusted overlay to use this input feature.
109 */
110 INTERCEPTS_STYLUS = 0x00000040,
111 }
Siarhei Vishniakou70622952020-07-30 11:17:23 -0500112}