blob: 7497543bd49c54745236dc7945bb18206dcf3498 [file] [log] [blame]
Siarhei Vishniakou18cbdb82024-01-31 17:58:13 -08001/*
2 * Copyright 2024 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#pragma once
18
19#include <ftl/flags.h>
20
21namespace android::inputdispatcher {
22
23enum class InputTargetFlags : uint32_t {
24 /* This flag indicates that the event is being delivered to a foreground application. */
25 FOREGROUND = 1 << 0,
26
27 /* This flag indicates that the MotionEvent falls within the area of the target
28 * obscured by another visible window above it. The motion event should be
29 * delivered with flag AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED. */
30 WINDOW_IS_OBSCURED = 1 << 1,
31
32 /* This flag indicates that a motion event is being split across multiple windows. */
33 SPLIT = 1 << 2,
34
35 /* This flag indicates that the pointer coordinates dispatched to the application
36 * will be zeroed out to avoid revealing information to an application. This is
37 * used in conjunction with FLAG_DISPATCH_AS_OUTSIDE to prevent apps not sharing
38 * the same UID from watching all touches. */
39 ZERO_COORDS = 1 << 3,
40
41 /* This flag indicates that the target of a MotionEvent is partly or wholly
42 * obscured by another visible window above it. The motion event should be
43 * delivered with flag AMOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED. */
44 WINDOW_IS_PARTIALLY_OBSCURED = 1 << 14,
45};
46
47} // namespace android::inputdispatcher