Siarhei Vishniakou | 7062295 | 2020-07-30 11:17:23 -0500 | [diff] [blame] | 1 | /** |
| 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 | |
| 17 | package android.os; |
| 18 | |
| 19 | |
| 20 | /** @hide */ |
| 21 | interface IInputConstants |
| 22 | { |
Peter Collingbourne | b04b9b8 | 2021-02-08 12:09:47 -0800 | [diff] [blame] | 23 | // 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 Vishniakou | 2508b87 | 2020-12-03 16:33:53 -1000 | [diff] [blame] | 27 | |
Siarhei Vishniakou | fc434ac | 2021-01-13 10:28:00 -1000 | [diff] [blame] | 28 | // Indicate invalid battery capacity |
| 29 | const int INVALID_BATTERY_CAPACITY = -1; |
| 30 | |
| 31 | /** |
| 32 | * Every input event has an id. This constant value is used when a valid input event id is not |
| 33 | * available. |
| 34 | */ |
| 35 | const int INVALID_INPUT_EVENT_ID = 0; |
Siarhei Vishniakou | 5d552c4 | 2021-05-21 05:02:22 +0000 | [diff] [blame] | 36 | |
| 37 | /** |
Siarhei Vishniakou | f00a4ec | 2021-06-16 03:55:32 +0000 | [diff] [blame] | 38 | * The input event was injected from accessibility. Used in policyFlags for input event |
| 39 | * injection. |
Siarhei Vishniakou | 5d552c4 | 2021-05-21 05:02:22 +0000 | [diff] [blame] | 40 | */ |
| 41 | const int POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000; |
Siarhei Vishniakou | f00a4ec | 2021-06-16 03:55:32 +0000 | [diff] [blame] | 42 | |
| 43 | /** |
| 44 | * The input event was generated or modified by accessibility service. |
| 45 | * Shared by both KeyEvent and MotionEvent flags, so this value should not overlap with either |
| 46 | * set of flags, including in input/Input.h and in android/input.h. |
| 47 | */ |
| 48 | const int INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800; |
Prabir Pradhan | de78850 | 2021-12-22 00:26:07 -0800 | [diff] [blame] | 49 | |
| 50 | @Backing(type="int") |
| 51 | enum InputFeature { |
| 52 | /** |
Prabir Pradhan | de78850 | 2021-12-22 00:26:07 -0800 | [diff] [blame] | 53 | * Does not construct an input channel for this window. The channel will therefore |
| 54 | * be incapable of receiving input. |
| 55 | */ |
| 56 | NO_INPUT_CHANNEL = 0x00000002, |
| 57 | |
| 58 | /** |
| 59 | * When this window has focus, does not call user activity for all input events so |
| 60 | * the application will have to do it itself. Should only be used by |
| 61 | * the keyguard and phone app. |
| 62 | * |
| 63 | * Should only be used by the keyguard and phone app. |
| 64 | */ |
| 65 | DISABLE_USER_ACTIVITY = 0x00000004, |
| 66 | |
| 67 | /** |
| 68 | * Internal flag used to indicate that input should be dropped on this window. |
| 69 | */ |
| 70 | DROP_INPUT = 0x00000008, |
| 71 | |
| 72 | /** |
| 73 | * Internal flag used to indicate that input should be dropped on this window if this window |
| 74 | * is obscured. |
| 75 | */ |
| 76 | DROP_INPUT_IF_OBSCURED = 0x00000010, |
| 77 | |
| 78 | /** |
| 79 | * An input spy window. This window will receive all pointer events within its touchable |
| 80 | * area, but will will not stop events from being sent to other windows below it in z-order. |
| 81 | * An input event will be dispatched to all spy windows above the top non-spy window at the |
| 82 | * event's coordinates. |
| 83 | */ |
| 84 | SPY = 0x00000020, |
| 85 | |
| 86 | /** |
| 87 | * When used with the window flag {@link #FLAG_NOT_TOUCHABLE}, this window will continue |
| 88 | * to receive events from a stylus device within its touchable region. All other pointer |
| 89 | * events, such as from a mouse or touchscreen, will be dispatched to the windows behind it. |
| 90 | * |
| 91 | * This input feature has no effect when the window flag {@link #FLAG_NOT_TOUCHABLE} is |
| 92 | * not set. |
| 93 | * |
| 94 | * The window must be a trusted overlay to use this input feature. |
| 95 | */ |
| 96 | INTERCEPTS_STYLUS = 0x00000040, |
| 97 | } |
Christine Franks | 46d8a1e | 2022-01-05 16:11:48 -0800 | [diff] [blame^] | 98 | |
| 99 | /* The default pointer acceleration value. */ |
| 100 | const int DEFAULT_POINTER_ACCELERATION = 3; |
Siarhei Vishniakou | 7062295 | 2020-07-30 11:17:23 -0500 | [diff] [blame] | 101 | } |