xref: /aosp_15_r20/frameworks/proto_logging/stats/enums/input/enums.proto (revision 64c55175f22a2714b5ba1250098ad9bbc12ec7cd)
1/*
2 * Copyright (C) 2023 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
17syntax = "proto2";
18
19package android.input;
20
21option java_outer_classname = "InputProtoEnums";
22option java_multiple_files = true;
23
24/**
25 * Contains the key events that are pressed from keyboard
26 * Logged in KeyboardSystemsEventReported atom
27 */
28enum KeyboardSystemEvent {
29    UNSPECIFIED = 0;
30    // Go to Homescreen
31    HOME = 1;
32    // Open Overview/Recent apps
33    RECENT_APPS = 2;
34    // Go back
35    BACK = 3;
36    // Toggle recent apps
37    APP_SWITCH = 4;
38    // Launch assistant app
39    LAUNCH_ASSISTANT = 5;
40    // Launch assistant in voice mode
41    LAUNCH_VOICE_ASSISTANT = 6;
42    // Launch settings
43    LAUNCH_SYSTEM_SETTINGS = 7;
44    // Open/close notification panel
45    TOGGLE_NOTIFICATION_PANEL = 8;
46    // Show/hide taskbar
47    TOGGLE_TASKBAR = 9;
48    // Take full screenshot
49    TAKE_SCREENSHOT = 10;
50    // Show system shortcut list
51    OPEN_SHORTCUT_HELPER = 11;
52    // Increase display brightness
53    BRIGHTNESS_UP = 12;
54    // Decrease display brightness
55    BRIGHTNESS_DOWN = 13;
56    // Increase keyboard backlight brightness
57    KEYBOARD_BACKLIGHT_UP = 14;
58    // Decrease keyboard backlight brightness
59    KEYBOARD_BACKLIGHT_DOWN = 15;
60    // Turn keyboard backlight on/off
61    KEYBOARD_BACKLIGHT_TOGGLE = 16;
62    // Increase speaker volume
63    VOLUME_UP = 17;
64    // Decrease speaker volume
65    VOLUME_DOWN = 18;
66    // Mute speaker volume
67    VOLUME_MUTE = 19;
68    // Open app drawer
69    ALL_APPS = 20;
70    // Open default search activity
71    LAUNCH_SEARCH = 21;
72    // Change IME language
73    LANGUAGE_SWITCH = 22;
74    // Launch app drawer in accessibility mode
75    ACCESSIBILITY_ALL_APPS = 23;
76    // Toggle caps lock
77    TOGGLE_CAPS_LOCK = 24;
78    // Mute system microphone
79    SYSTEM_MUTE = 25;
80    // Navigate to/from split screen mode
81    SPLIT_SCREEN_NAVIGATION = 26;
82    // Trigger bug report
83    TRIGGER_BUG_REPORT = 27;
84    // Lock the device
85    LOCK_SCREEN = 28;
86    // Open notes app
87    OPEN_NOTES = 29;
88    // Power button pressed
89    TOGGLE_POWER = 30;
90    // System navigation keys
91    SYSTEM_NAVIGATION = 31;
92    // Sleep button press
93    SLEEP = 32;
94    // Wakeup button pressed
95    WAKEUP = 33;
96    // Media keys like play, pause, next, previous pressed
97    MEDIA_KEY = 34;
98    // Application launch shortcuts
99    LAUNCH_DEFAULT_BROWSER = 35;
100    LAUNCH_DEFAULT_EMAIL = 36;
101    LAUNCH_DEFAULT_CONTACTS = 37;
102    LAUNCH_DEFAULT_CALENDAR = 38;
103    LAUNCH_DEFAULT_CALCULATOR = 39;
104    LAUNCH_DEFAULT_MUSIC = 40;
105    LAUNCH_DEFAULT_MAPS = 41;
106    LAUNCH_DEFAULT_MESSAGING = 42;
107    LAUNCH_DEFAULT_GALLERY = 43;
108    LAUNCH_DEFAULT_FILES = 44;
109    LAUNCH_DEFAULT_WEATHER = 45;
110    LAUNCH_DEFAULT_FITNESS = 46;
111    // Launch application by package name defined by custom overlays for OEM specific shortcuts
112    LAUNCH_APPLICATION_BY_PACKAGE_NAME = 47;
113    // Enter desktop mode
114    DESKTOP_MODE = 48;
115    // Navigate to/from a multiwindow mode
116    MULTI_WINDOW_NAVIGATION = 49;
117    // Change split screen focus
118    CHANGE_SPLITSCREEN_FOCUS = 50;
119    // Move a task into next display
120    MOVE_TO_NEXT_DISPLAY = 51;
121    // Resize a freeform window to fit the left half of the screen in desktop mode
122    SNAP_LEFT_FREEFORM_WINDOW = 52;
123    // Resize a freeform window to fit the right half of the screen in desktop mode
124    SNAP_RIGHT_FREEFORM_WINDOW = 53;
125    // Maximize a freeform window to the stable bounds in desktop mode
126    MAXIMIZE_FREEFORM_WINDOW = 54;
127    // Restore a freeform window size to its previous bounds in desktop mode
128    RESTORE_FREEFORM_WINDOW_SIZE = 55 [deprecated=true];
129    // Toggle between maximizing a freeform window to the stable bounds in
130    // desktop mode and restoring to its previous bounds
131    TOGGLE_MAXIMIZE_FREEFORM_WINDOW = 56;
132    // Minimize a window in desktop mode
133    MINIMIZE_FREEFORM_WINDOW = 57;
134}
135
136/**
137 * Criteria for keyboard layout selection
138 * DEPRECATED: Since Enums should include a default UNSPECIFIED value
139 * as the first value in the declaration
140 */
141enum KeyboardLayoutSelectionCriteria {
142    option deprecated = true;
143    // Manual selection by user
144    USER = 0;
145    // Auto-detection based on device provided language tag and layout type
146    DEVICE = 1;
147    // Auto-detection based on IME provided language tag and layout type
148    VIRTUAL_KEYBOARD = 2;
149    // Default selection
150    DEFAULT = 3;
151}
152
153/**
154 * Criteria for keyboard layout selection
155 */
156enum LayoutSelectionCriteriaKeyboard {
157    // Unspecified
158    LAYOUT_SELECTION_CRITERIA_UNSPECIFIED = 0;
159    // Manual selection by user
160    LAYOUT_SELECTION_CRITERIA_USER = 1;
161    // Auto-detection based on device provided language tag and layout type
162    LAYOUT_SELECTION_CRITERIA_DEVICE = 2;
163    // Auto-detection based on IME provided language tag and layout type
164    LAYOUT_SELECTION_CRITERIA_VIRTUAL_KEYBOARD = 3;
165    // Default selection
166    LAYOUT_SELECTION_CRITERIA_DEFAULT = 4;
167}
168
169/**
170 * Keyboard Layout Type
171 * This enum is for layout types provided both by the physical keyboard
172 * and the  IME
173 */
174enum KeyboardLayoutType {
175    LAYOUT_TYPE_UNDEFINED = 0;
176    LAYOUT_TYPE_QWERTY = 1;
177    LAYOUT_TYPE_QWERTZ = 2;
178    LAYOUT_TYPE_AZERTY = 3;
179    LAYOUT_TYPE_DVORAK = 4;
180    LAYOUT_TYPE_COLEMAK = 5;
181    LAYOUT_TYPE_WORKMAN = 6;
182    LAYOUT_TYPE_TURKISH_F = 7;
183    LAYOUT_TYPE_TURKISH_Q = 8;
184    LAYOUT_TYPE_EXTENDED = 9;
185}
186
187/**
188 * Contains usage type/category definitions.
189 * Logged in InputDeviceUsageReported atom.
190 */
191enum InputDeviceUsageType {
192    UNKNOWN = 0;
193    // Miscellaneous buttons (such as volume, power, stylus buttons, remote controls etc.)
194    // that are not categorized a full keyboards.
195    BUTTONS = 1;
196    // An alphabetical physical keyboard.
197    KEYBOARD = 2;
198    // A D-Pad.
199    DPAD = 3;
200    // Gamepad buttons.
201    GAMEPAD = 4;
202    // A joystick, like one part of a gaming controller.
203    JOYSTICK = 5;
204    // A mouse that controls an on-screen cursor. (Touchpads are not included)
205    MOUSE = 6;
206    // A mouse that is operating under Pointer Capture mode.
207    MOUSE_CAPTURED = 7;
208    // A touchpad (trackpad) that controls an on-screen cursor.
209    TOUCHPAD = 8;
210    // A touchpad that is operating under Pointer Capture mode.
211    TOUCHPAD_CAPTURED = 9;
212    // A rotary encoder.
213    ROTARY_ENCODER = 10;
214    // A stylus, where touches are mapped directly to the display.
215    STYLUS_DIRECT = 11;
216    // A stylus that interacts with a display indirectly, such as by controlling an
217    // on-screen cursor. This includes external drawing tablets that don't have a built-in
218    // display.
219    STYLUS_INDIRECT = 12;
220    // A stylus that reports some information through Bluetooth that is then fused
221    // with touch information from the built-in touchscreen.
222    STYLUS_FUSED = 13;
223    // A touch device that navigates through the UI using gestures.
224    TOUCH_NAVIGATION = 14;
225    // A touchscreen, where touches are mapped directly to the display.
226    TOUCHSCREEN = 15;
227    // A trackball.
228    TRACKBALL = 16;
229};
230
231/**
232 * Contains buses through which an input device can be connected.
233 * Logged in InputDeviceUsageReported atom.
234 */
235enum InputDeviceBus {
236    OTHER = 0;
237    // Universal Serial Bus
238    USB = 1;
239    // Bluetooth or Bluetooth Low Energy (BLE)
240    BLUETOOTH = 2;
241    // Universal Stylus Initiative (USI) protocol (https://universalstylus.org)
242    USI = 3;
243}
244
245/**
246 * Contains input event types we want to record latency values for.
247 * Logged in InputEventLatencyReported atom.
248 */
249enum InputEventType {
250    UNKNOWN_INPUT_EVENT = 0;
251    // Motion events for ACTION_DOWN (when the pointer first goes down)
252    MOTION_ACTION_DOWN = 1;
253    // Motion events for ACTION_MOVE (characterizes scrolling motion)
254    MOTION_ACTION_MOVE = 2;
255    // Motion events for ACTION_UP (when the pointer first goes up)
256    MOTION_ACTION_UP = 3;
257    // Motion events for ACTION_HOVER_MOVE (pointer position on screen changes but pointer is not
258    // down)
259    MOTION_ACTION_HOVER_MOVE = 4;
260    // Motion events for ACTION_SCROLL (moving the mouse wheel)
261    MOTION_ACTION_SCROLL = 5;
262    // Key events for both ACTION_DOWN and ACTION_UP (key press and key release)
263    KEY = 6;
264}
265
266/**
267 * Contains the different stages of the input pipeline defined to capture the latency of input
268   events.
269 * Logged in InputEventLatencyReported atom.
270 */
271enum LatencyStage {
272    UNKNOWN_LATENCY_STAGE = 0;
273    // Start: the input event was created (an interrupt received in the driver)
274    // End: the event was read in userspace (in EventHub)
275    EVENT_TO_READ = 1;
276    // Start: the event was read in EventHub
277    // End: the event was sent to the app via the InputChannel (written to the socket)
278    READ_TO_DELIVER = 2;
279    // Start: the input event was sent to the app
280    // End: the app consumed the input event
281    DELIVER_TO_CONSUME = 3;
282    // Start: the app consumed the event
283    // End: the app's 'finishInputEvent' call was received in inputflinger
284    // The end point can also be called "the app finished processing input event"
285    CONSUME_TO_FINISH = 4;
286    // Start: the app consumed the input event
287    // End: the app produced a buffer
288    CONSUME_TO_GPU_COMPLETE = 5;
289    // Start: the app produced a buffer
290    // End: the frame was shown on the display
291    GPU_COMPLETE_TO_PRESENT = 6;
292    // The end-to-end latency
293    // Start: the input event was created (an interrupt received in the driver)
294    // End: the frame was presented on the display
295    END_TO_END = 7;
296}
297