1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
/**
* Copyright 2024, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.os;
import android.os.IInputConstants;
/**
* Flag definitions for MotionEvents.
* @hide
*/
@Backing(type="int")
enum MotionEventFlag {
/**
* This flag indicates that the window that received this motion event is partly
* or wholly obscured by another visible window above it and the event directly passed through
* the obscured area.
*
* A security sensitive application can check this flag to identify situations in which
* a malicious application may have covered up part of its content for the purpose
* of misleading the user or hijacking touches. An appropriate response might be
* to drop the suspect touches or to take additional precautions to confirm the user's
* actual intent.
*/
WINDOW_IS_OBSCURED = 0x1,
/**
* This flag indicates that the window that received this motion event is partly
* or wholly obscured by another visible window above it and the event did not directly pass
* through the obscured area.
*
* A security sensitive application can check this flag to identify situations in which
* a malicious application may have covered up part of its content for the purpose
* of misleading the user or hijacking touches. An appropriate response might be
* to drop the suspect touches or to take additional precautions to confirm the user's
* actual intent.
*
* Unlike FLAG_WINDOW_IS_OBSCURED, this is only true if the window that received this event is
* obstructed in areas other than the touched location.
*/
WINDOW_IS_PARTIALLY_OBSCURED = 0x2,
/**
* This private flag is only set on {@link #ACTION_HOVER_MOVE} events and indicates that
* this event will be immediately followed by a {@link #ACTION_HOVER_EXIT}. It is used to
* prevent generating redundant {@link #ACTION_HOVER_ENTER} events.
* @hide
*/
HOVER_EXIT_PENDING = 0x4,
/**
* This flag indicates that the event has been generated by a gesture generator. It
* provides a hint to the GestureDetector to not apply any touch slop.
*
* @hide
*/
IS_GENERATED_GESTURE = 0x8,
/**
* This flag is only set for events with {@link #ACTION_POINTER_UP} and {@link #ACTION_CANCEL}.
* It indicates that the pointer going up was an unintentional user touch. When FLAG_CANCELED
* is set, the typical actions that occur in response for a pointer going up (such as click
* handlers, end of drawing) should be aborted. This flag is typically set when the user was
* accidentally touching the screen, such as by gripping the device, or placing the palm on the
* screen.
*
* @see #ACTION_POINTER_UP
* @see #ACTION_CANCEL
*/
CANCELED = IInputConstants.INPUT_EVENT_FLAG_CANCELED,
/**
* This flag indicates that the event will not cause a focus change if it is directed to an
* unfocused window, even if it an {@link #ACTION_DOWN}. This is typically used with pointer
* gestures to allow the user to direct gestures to an unfocused window without bringing the
* window into focus.
* @hide
*/
NO_FOCUS_CHANGE = 0x40,
/**
* This flag indicates that the event has a valid value for AXIS_ORIENTATION.
*
* This is a private flag that is not used in Java.
* @hide
*/
PRIVATE_FLAG_SUPPORTS_ORIENTATION = 0x80,
/**
* This flag indicates that the pointers' AXIS_ORIENTATION can be used to precisely determine
* the direction in which the tool is pointing. The value of the orientation axis will be in
* the range [-pi, pi], which represents a full circle. This is usually supported by devices
* like styluses.
*
* Conversely, AXIS_ORIENTATION cannot be used to tell which direction the tool is pointing
* when this flag is not set. In this case, the axis value will have a range of [-pi/2, pi/2],
* which represents half a circle. This is usually the case for devices like touchscreens and
* touchpads, for which it is difficult to tell which direction along the major axis of the
* touch ellipse the finger is pointing.
*
* This is a private flag that is not used in Java.
* @hide
*/
PRIVATE_FLAG_SUPPORTS_DIRECTIONAL_ORIENTATION = 0x100,
/**
* The input event was injected from some AccessibilityService, which may be either an
* Accessibility Tool OR a service using that API for purposes other than assisting users with
* disabilities. Shared by both KeyEvent and MotionEvent flags, so this value should not
* overlap with either set of flags, including in input/Input.h and in android/input.h.
*/
IS_ACCESSIBILITY_EVENT = IInputConstants.INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT,
/**
* The input event was injected from an AccessibilityService with the
* AccessibilityServiceInfo#isAccessibilityTool property set to true. These services (known as
* "Accessibility Tools") are used to assist users with disabilities, so events from these
* services should be able to reach all Views including Views which set
* View#isAccessibilityDataSensitive to true. Only used by MotionEvent flags.
*/
INJECTED_FROM_ACCESSIBILITY_TOOL =
IInputConstants.INPUT_EVENT_FLAG_INJECTED_FROM_ACCESSIBILITY_TOOL,
/**
* Private flag that indicates when the system has detected that this motion event
* may be inconsistent with respect to the sequence of previously delivered motion events,
* such as when a pointer move event is sent but the pointer is not down.
*
* @hide
* @see #isTainted
* @see #setTainted
*/
TAINTED = IInputConstants.INPUT_EVENT_FLAG_TAINTED,
/**
* Private flag indicating that this event was synthesized by the system and should be delivered
* to the accessibility focused view first. When being dispatched such an event is not handled
* by predecessors of the accessibility focused view and after the event reaches that view the
* flag is cleared and normal event dispatch is performed. This ensures that the platform can
* click on any view that has accessibility focus which is semantically equivalent to asking the
* view to perform a click accessibility action but more generic as views not implementing click
* action correctly can still be activated.
*
* @hide
* @see #isTargetAccessibilityFocus()
* @see #setTargetAccessibilityFocus(boolean)
*/
TARGET_ACCESSIBILITY_FOCUS = 0x40000000,
}
|