• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 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
17syntax = "proto2";
18
19package android.os.statsd.desktopmode;
20option java_package = "com.android.os.desktopmode";
21
22import "frameworks/proto_logging/stats/atoms.proto";
23import "frameworks/proto_logging/stats/atom_field_options.proto";
24
25extend Atom {
26  optional DesktopModeUIChanged desktop_mode_ui_changed = 818 [(module) = "framework"];
27  optional DesktopModeSessionTaskUpdate desktop_mode_session_task_update = 819 [(module) = "framework"];
28  optional DesktopModeTaskSizeUpdated desktop_mode_task_size_updated = 935 [(module) = "framework"];
29}
30
31/**
32* Logged when there is a change to the Desktop mode UI
33*
34* Logged from
35* frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt
36*/
37message DesktopModeUIChanged {
38  // User interactions with desktopmode
39  enum  Event {
40    UNKNOWN_EVENT = 0;
41    ENTER = 1;
42    EXIT = 2;
43  }
44
45  // The reason for entering desktopmode
46  enum  EnterReason {
47    UNKNOWN_ENTER = 0;
48    OVERVIEW = 1;
49    APP_HANDLE_DRAG = 2;
50    APP_HANDLE_MENU_BUTTON = 3;
51    APP_FREEFORM_INTENT = 4; // This covers intent based starts from app-shortcut, taskbar, keyboard shortcuts where we don't use any custom transition
52    KEYBOARD_SHORTCUT_ENTER = 5;
53    SCREEN_ON = 6; // desktop mode visible after screen turned on
54    APP_FROM_OVERVIEW = 7;
55  }
56
57  // The reason for exiting desktopmode
58  enum  ExitReason {
59    UNKNOWN_EXIT = 0;
60    DRAG_TO_EXIT = 1;
61    APP_HANDLE_MENU_BUTTON_EXIT = 2;
62    KEYBOARD_SHORTCUT_EXIT = 3;
63    RETURN_HOME_OR_OVERVIEW = 4; // user swiped up to go to overview, or home screen
64    TASK_FINISHED = 5; // the task finished or dismissed
65    SCREEN_OFF = 6;
66    TASK_MINIMIZED = 7; // the task gets minimized
67    TASK_MOVED_TO_BACK = 8; // The task moved to back due to back gesture or button.
68  }
69
70  optional Event event = 1;
71  // What triggered desktopmode (if the event is ENTER)
72  optional EnterReason enter_reason = 2;
73  // What triggered leaving desktopmode (if the event is EXIT)
74  optional ExitReason exit_reason = 3;
75  // An id used to identify a desktop mode instance
76  optional int32 session_id = 4;
77}
78
79/**
80* Logged when there is a task update in the desktop mode session
81*
82* Logged from
83* frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt
84*/
85message DesktopModeSessionTaskUpdate {
86  // The kind of the app event
87  enum TaskEvent {
88    UNKNOWN_TASK_EVENT = 0;
89    TASK_ADDED = 1;
90    TASK_REMOVED = 2;
91    TASK_INFO_CHANGED = 3; // covers both size and position changes of the app
92    TASK_INIT_STATSD = 4;  // Used to initialise state field in statsd
93  }
94
95  // The reason a task was minimized
96  enum MinimizeReason {
97    // Unset means the task did not get minimized
98    UNSET_MINIMIZE = 0;
99    MINIMIZE_TASK_LIMIT = 1;
100    MINIMIZE_BUTTON = 2;
101    MINIMIZE_KEY_GESTURE = 3;
102  }
103
104  // The reason a task was unminimized
105  enum UnminimizeReason {
106    // Unset means the task did not get minimized
107    UNSET_UNMINIMIZE = 0;
108    // Unknown means we don't know what caused the unminimize action
109    UNMINIMIZE_UNKNOWN = 1;
110    UNMINIMIZE_TASKBAR_TAP = 2;
111    UNMINIMIZE_ALT_TAB = 3;
112    UNMINIMIZE_TASK_LAUNCH = 4;
113    UNMINIMIZE_APP_HANDLE_MENU_BUTTON = 5;
114    UNMINIMIZE_TASKBAR_MANAGE_WINDOW = 6;
115  }
116
117  // The reason a task was focused
118  enum FocusReason {
119    // Unset means there is no focus reason (the task did not get focused)
120    UNSET_FOCUS = 0;
121    // Unknown means we don't know what caused the focus change
122    FOCUS_UNKNOWN = 1;
123  }
124
125  // The event associated with this app update
126  optional TaskEvent task_event = 1;
127  // The instance_id of this task
128  optional int32 instance_id = 2;
129  // The uid of the app associated with this task
130  optional int32 uid = 3 [(is_uid) = true];
131  // The height of this task in px
132  optional int32 task_height = 4;
133  // The width of this task in px
134  optional int32 task_width = 5;
135  // the x-coordinate of the top-left corner
136  optional int32 task_x = 6;
137  // the y-coordinate of the top-right corner
138  optional int32 task_y = 7;
139  // An id used to identify a desktop mode instance
140  optional int32 session_id = 8;
141  // The reason the task was minimized
142  optional MinimizeReason minimize_reason = 9;
143  // The reason the task was unminimized
144  optional UnminimizeReason unminimize_reason = 10;
145  // The number of visible tasks
146  optional int32 visible_task_count = 11 [
147    (state_field_option).exclusive_state = true,
148    (state_field_option).nested = false
149  ];
150  // The reason this task was focused
151  optional FocusReason focus_reason = 12;
152}
153
154/**
155* Logged when a task size is updated (resizing, snapping or maximizing to
156* stable bounds) during a desktop mode session.
157*
158* Logged from
159* frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt
160*/
161message DesktopModeTaskSizeUpdated {
162  // The trigger for task resize
163  enum ResizeTrigger {
164    UNKNOWN_RESIZE_TRIGGER = 0;
165    // Resize task from its corner bounds
166    CORNER_RESIZE_TRIGGER = 1;
167    // Resize task from its edges
168    EDGE_RESIZE_TRIGGER = 2;
169    // Resize two tiled apps simultaneously using the divider
170    TILING_DIVIDER_RESIZE_TRIGGER = 3;
171    // Resize task to fit the stable bounds by clicking on the maximize button
172    // on the app header
173    MAXIMIZE_BUTTON_RESIZE_TRIGGER = 4;
174    // Resize task to fit the stable bounds by double tapping the app header
175    DOUBLE_TAP_APP_HEADER_RESIZE_TRIGGER = 5;
176    // Snap a resizable task to the left half of the screen by dragging the task
177    // to the left
178    DRAG_LEFT_RESIZE_TRIGGER = 6;
179    // Snap a resizable task to the right half of the screen by dragging the
180    // task to the right
181    DRAG_RIGHT_RESIZE_TRIGGER = 7;
182    // Snap a resizable task to the left half of the screen by clicking on the
183    // snap left menu on the app header
184    SNAP_LEFT_MENU_RESIZE_TRIGGER = 8;
185    // Snap a resizable task to the right half of the screen by clicking on the
186    // snap right menu on the app header
187    SNAP_RIGHT_MENU_RESIZE_TRIGGER = 9;
188    // Resize task to fit stable bounds by clicking on the maximize menu that
189    // appears when the app header button is long pressed or hovered over
190    MAXIMIZE_MENU_RESIZE_TRIGGER = 10;
191    // Resize task to fit the stable bounds by dragging the task to the top of the
192    // screen
193    DRAG_TO_TOP_RESIZE_TRIGGER = 11;
194  }
195
196  // The stage at which a task is being resized
197  enum ResizingStage {
198    UNKNOWN_RESIZING_STAGE = 0;
199    // Stage before the task was resized
200    START_RESIZING_STAGE = 1;
201    // Stage when task resize is complete
202    END_RESIZING_STAGE = 2;
203  }
204
205  // The input method for resizing the task
206  enum InputMethod {
207    UNKNOWN_INPUT_METHOD = 0;
208    TOUCH_INPUT_METHOD = 1;
209    STYLUS_INPUT_METHOD = 2;
210    MOUSE_INPUT_METHOD = 3;
211    TOUCHPAD_INPUT_METHOD = 4;
212    // Only tiling and maximizing window actions have keyboard shortcuts
213    KEYBOARD_INPUT_METHOD = 5;
214  }
215
216  // How this task was resized
217  optional ResizeTrigger resize_trigger = 1;
218  // The stage of resizing this task
219  optional ResizingStage resizing_stage = 2;
220  // The input method for resizing this task
221  optional InputMethod input_method = 3;
222  // ID used to identify the Desktop mode session
223  optional int32 desktop_mode_session_id = 4;
224  // The instance_id of this task
225  optional int32 instance_id = 5;
226  // The UID of the app associated with this task
227  optional int32 uid = 6 [(is_uid) = true];
228  // The height of this task in dp
229  optional int32 task_height = 7;
230  // The width of this task in dp
231  optional int32 task_width = 8;
232  // The display area of the device in dp^2
233  optional int32 display_area = 9;
234}
235