1/*
2 * Copyright (C) 2016 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 */
16syntax = "proto2";
17
18import "launcher_log_extension.proto";
19
20option java_package = "com.android.launcher3.userevent";
21option java_outer_classname = "LauncherLogProto";
22
23package userevent;
24
25message Target {
26  enum Type {
27    NONE = 0;
28    ITEM = 1;
29    CONTROL = 2;
30    CONTAINER = 3;
31  }
32
33  optional Type type = 1;
34
35  // For container type and item type
36  // Used mainly for ContainerType.FOLDER, ItemType.*
37  optional int32 page_index = 2;
38  optional int32 rank = 3;
39  optional int32 grid_x = 4;
40  optional int32 grid_y = 5;
41
42  // For container types only
43  optional ContainerType container_type = 6;
44  optional int32 cardinality = 7;
45
46  // For control types only
47  optional ControlType control_type = 8;
48
49  // For item types only
50  optional ItemType item_type = 9;
51  optional int32 package_name_hash = 10;
52  optional int32 component_hash = 11;      // Used for ItemType.WIDGET
53  optional int32 intent_hash = 12;         // Used for ItemType.SHORTCUT
54  optional int32 span_x = 13 [default = 1];// Used for ItemType.WIDGET
55  optional int32 span_y = 14 [default = 1];// Used for ItemType.WIDGET
56  optional int32 predictedRank = 15;
57  optional TargetExtension extension = 16;
58  optional TipType tip_type = 17;
59  optional int32 search_query_length = 18;
60  optional bool is_work_app = 19;
61  optional FromFolderLabelState from_folder_label_state = 20;
62  optional ToFolderLabelState to_folder_label_state = 21;
63
64  // Note: proto does not support duplicate enum values, even if they belong to different enum type.
65  // Hence "FROM" and "TO" prefix added.
66  enum FromFolderLabelState {
67    FROM_FOLDER_LABEL_STATE_UNSPECIFIED = 0;
68    FROM_EMPTY = 1;
69    FROM_CUSTOM = 2;
70    FROM_SUGGESTED = 3;
71  }
72
73  enum ToFolderLabelState {
74    TO_FOLDER_LABEL_STATE_UNSPECIFIED = 0;
75    TO_SUGGESTION0_WITH_VALID_PRIMARY = 1;
76    TO_SUGGESTION1_WITH_VALID_PRIMARY = 2;
77    TO_SUGGESTION1_WITH_EMPTY_PRIMARY = 3;
78    TO_SUGGESTION2_WITH_VALID_PRIMARY = 4;
79    TO_SUGGESTION2_WITH_EMPTY_PRIMARY = 5;
80    TO_SUGGESTION3_WITH_VALID_PRIMARY = 6;
81    TO_SUGGESTION3_WITH_EMPTY_PRIMARY = 7;
82    TO_EMPTY_WITH_VALID_SUGGESTIONS = 8 [deprecated = true];
83    TO_EMPTY_WITH_VALID_PRIMARY = 15;
84    TO_EMPTY_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 16;
85    TO_EMPTY_WITH_EMPTY_SUGGESTIONS = 9;
86    TO_EMPTY_WITH_SUGGESTIONS_DISABLED = 10;
87    TO_CUSTOM_WITH_VALID_SUGGESTIONS = 11 [deprecated = true];
88    TO_CUSTOM_WITH_VALID_PRIMARY = 17;
89    TO_CUSTOM_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 18;
90    TO_CUSTOM_WITH_EMPTY_SUGGESTIONS = 12;
91    TO_CUSTOM_WITH_SUGGESTIONS_DISABLED = 13;
92    UNCHANGED = 14;
93  }
94}
95
96// Used to define what type of item a Target would represent.
97enum ItemType {
98  DEFAULT_ITEMTYPE = 0;
99  APP_ICON = 1;
100  SHORTCUT = 2;
101  WIDGET = 3;
102  FOLDER_ICON = 4;
103  DEEPSHORTCUT = 5;
104  SEARCHBOX = 6;
105  EDITTEXT = 7;
106  NOTIFICATION = 8;
107  TASK = 9;         // Each page of Recents UI (QuickStep)
108  WEB_APP = 10;
109  TASK_ICON = 11;
110}
111
112// Used to define what type of container a Target would represent.
113enum ContainerType {
114  DEFAULT_CONTAINERTYPE = 0;
115  WORKSPACE = 1;
116  HOTSEAT = 2;
117  FOLDER = 3;
118  ALLAPPS = 4;
119  WIDGETS = 5;
120  OVERVIEW = 6;   // Zoomed out workspace (without QuickStep)
121  PREDICTION = 7;
122  SEARCHRESULT = 8;
123  DEEPSHORTCUTS = 9;
124  PINITEM = 10;    // confirmation screen
125  NAVBAR = 11;
126  TASKSWITCHER = 12; // Recents UI Container (QuickStep)
127  APP = 13; // Foreground activity is another app (QuickStep)
128  TIP = 14; // Onboarding texts (QuickStep)
129  OTHER_LAUNCHER_APP = 15;
130}
131
132// Used to define what type of control a Target would represent.
133enum ControlType {
134  DEFAULT_CONTROLTYPE = 0;
135  ALL_APPS_BUTTON = 1;
136  WIDGETS_BUTTON = 2;
137  WALLPAPER_BUTTON = 3;
138  SETTINGS_BUTTON = 4;
139  REMOVE_TARGET = 5;
140  UNINSTALL_TARGET = 6;
141  APPINFO_TARGET = 7;
142  RESIZE_HANDLE = 8;
143  VERTICAL_SCROLL = 9;
144  HOME_INTENT = 10; // Deprecated, use enum Command instead
145  BACK_BUTTON = 11;
146  QUICK_SCRUB_BUTTON = 12;
147  CLEAR_ALL_BUTTON = 13;
148  CANCEL_TARGET = 14;
149  TASK_PREVIEW = 15;
150  SPLIT_SCREEN_TARGET = 16;
151  REMOTE_ACTION_SHORTCUT = 17;
152  APP_USAGE_SETTINGS = 18;
153  BACK_GESTURE = 19;
154  UNDO = 20;
155  DISMISS_PREDICTION = 21;
156  HYBRID_HOTSEAT_ACCEPTED = 22;
157  HYBRID_HOTSEAT_CANCELED = 23;
158  OVERVIEW_ACTIONS_SHARE_BUTTON = 24;
159  OVERVIEW_ACTIONS_SCREENSHOT_BUTTON = 25;
160  OVERVIEW_ACTIONS_SELECT_BUTTON = 26;
161  SELECT_MODE_CLOSE_BUTTON = 27;
162  SELECT_MODE_ITEM = 28;
163}
164
165enum TipType {
166  DEFAULT_NONE = 0;
167  BOUNCE = 1;
168  SWIPE_UP_TEXT = 2;
169  QUICK_SCRUB_TEXT = 3;
170  PREDICTION_TEXT = 4;
171  DWB_TOAST = 5;
172  HYBRID_HOTSEAT = 6;
173}
174
175// Used to define the action component of the LauncherEvent.
176message Action {
177  enum Type {
178    TOUCH = 0;
179    AUTOMATED = 1;
180    COMMAND = 2;
181    TIP = 3;
182    SOFT_KEYBOARD = 4;
183    // HARD_KEYBOARD, ASSIST
184  }
185
186  enum Touch {
187    TAP = 0;
188    LONGPRESS = 1;
189    DRAGDROP = 2;
190    SWIPE = 3;
191    FLING = 4;
192    PINCH = 5;
193    SWIPE_NOOP = 6;
194  }
195
196  enum Direction {
197    NONE = 0;
198    UP = 1;
199    DOWN = 2;
200    LEFT = 3;
201    RIGHT = 4;
202    UPRIGHT = 5;
203    UPLEFT = 6;
204  }
205  enum Command {
206    HOME_INTENT = 0;
207    BACK = 1;
208    ENTRY = 2;          // Indicates entry to one of Launcher container type target
209                        // not using the HOME_INTENT
210    CANCEL = 3;         // Indicates that a confirmation screen was cancelled
211    CONFIRM = 4;        // Indicates thata confirmation screen was accepted
212    STOP = 5;           // Indicates onStop() was called (screen time out, power off)
213    RECENTS_BUTTON = 6; // Indicates that Recents button was pressed
214    RESUME = 7;         // Indicates onResume() was called
215  }
216
217  optional Type type = 1;
218  optional Touch touch = 2;
219  optional Direction dir = 3;
220  optional Command command = 4;
221  // Log if the action was performed on outside of the container
222  optional bool is_outside = 5;
223  optional bool is_state_change = 6;
224}
225
226//
227// Context free grammar of typical user interaction:
228//         Action (Touch) + Target
229//         Action (Touch) + Target + Target
230//
231message LauncherEvent {
232  required Action action = 1;
233  // List of targets that touch actions can be operated on.
234  repeated Target src_target = 2;
235  repeated Target dest_target = 3;
236
237  optional int64 action_duration_millis = 4;
238  optional int64 elapsed_container_millis = 5;
239  optional int64 elapsed_session_millis = 6;
240
241  optional bool is_in_multi_window_mode = 7 [deprecated = true];
242  optional bool is_in_landscape_mode = 8 [deprecated = true];
243
244  optional LauncherEventExtension extension = 9;
245}
246