blob: d08d851e156e582de2b90650116c4c832349a3c9 [file] [log] [blame]
Hyunyoung Song726eb822016-03-07 10:07:35 -08001/*
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
Sunny Goyal2385ebe2017-07-19 01:24:07 -070018import "launcher_log_extension.proto";
19
Tamas Berghammere54852d2016-10-31 18:07:11 +000020option java_package = "com.android.launcher3.userevent";
Hyunyoung Song726eb822016-03-07 10:07:35 -080021option 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.*
Hyunyoung Songddec1c72016-04-12 18:32:04 -070037 optional int32 page_index = 2;
38 optional int32 rank = 3;
39 optional int32 grid_x = 4;
40 optional int32 grid_y = 5;
Hyunyoung Song726eb822016-03-07 10:07:35 -080041
42 // For container types only
Hyunyoung Songddec1c72016-04-12 18:32:04 -070043 optional ContainerType container_type = 6;
44 optional int32 cardinality = 7;
Hyunyoung Song726eb822016-03-07 10:07:35 -080045
46 // For control types only
Hyunyoung Songddec1c72016-04-12 18:32:04 -070047 optional ControlType control_type = 8;
Hyunyoung Song726eb822016-03-07 10:07:35 -080048
49 // For item types only
Hyunyoung Songddec1c72016-04-12 18:32:04 -070050 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;
Sunny Goyal2385ebe2017-07-19 01:24:07 -070057 optional TargetExtension extension = 16;
Hyunyoung Song018eec62018-05-09 16:18:58 -070058 optional TipType tip_type = 17;
Alex Mang68c67542019-05-06 21:20:07 -070059 optional int32 search_query_length = 18;
Samuel Fufa78e7e5f2019-12-10 13:23:51 -080060 optional bool is_work_app = 19;
thiruramc1c2bfa2020-02-04 18:56:40 -080061 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;
83 TO_EMPTY_WITH_EMPTY_SUGGESTIONS = 9;
84 TO_EMPTY_WITH_SUGGESTIONS_DISABLED = 10;
85 TO_CUSTOM_WITH_VALID_SUGGESTIONS = 11;
86 TO_CUSTOM_WITH_EMPTY_SUGGESTIONS = 12;
87 TO_CUSTOM_WITH_SUGGESTIONS_DISABLED = 13;
88 UNCHANGED = 14;
89 }
Hyunyoung Song726eb822016-03-07 10:07:35 -080090}
91
Hyunyoung Songddec1c72016-04-12 18:32:04 -070092// Used to define what type of item a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -080093enum ItemType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -070094 DEFAULT_ITEMTYPE = 0;
95 APP_ICON = 1;
96 SHORTCUT = 2;
97 WIDGET = 3;
98 FOLDER_ICON = 4;
Hyunyoung Song5aa27142016-07-21 11:48:37 -070099 DEEPSHORTCUT = 5;
Hyunyoung Songffad9622016-09-27 18:07:00 -0700100 SEARCHBOX = 6;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700101 EDITTEXT = 7;
Tony Wickhamc6b79e32017-02-01 09:13:24 -0800102 NOTIFICATION = 8;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -0800103 TASK = 9; // Each page of Recents UI (QuickStep)
Mario Bertschlerd2e3c5d2018-03-29 21:12:12 +0200104 WEB_APP = 10;
Hyunyoung Songfd94cd52019-04-25 11:20:42 -0700105 TASK_ICON = 11;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800106}
107
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700108// Used to define what type of container a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -0800109enum ContainerType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700110 DEFAULT_CONTAINERTYPE = 0;
111 WORKSPACE = 1;
112 HOTSEAT = 2;
113 FOLDER = 3;
114 ALLAPPS = 4;
115 WIDGETS = 5;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -0800116 OVERVIEW = 6; // Zoomed out workspace (without QuickStep)
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700117 PREDICTION = 7;
118 SEARCHRESULT = 8;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700119 DEEPSHORTCUTS = 9;
Sunny Goyal778634c2017-03-21 11:59:04 -0700120 PINITEM = 10; // confirmation screen
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -0800121 NAVBAR = 11;
122 TASKSWITCHER = 12; // Recents UI Container (QuickStep)
123 APP = 13; // Foreground activity is another app (QuickStep)
Hyunyoung Song018eec62018-05-09 16:18:58 -0700124 TIP = 14; // Onboarding texts (QuickStep)
vadimtbd28a8e2019-12-13 17:16:19 -0800125 OTHER_LAUNCHER_APP = 15;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800126}
127
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700128// Used to define what type of control a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -0800129enum ControlType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700130 DEFAULT_CONTROLTYPE = 0;
131 ALL_APPS_BUTTON = 1;
132 WIDGETS_BUTTON = 2;
133 WALLPAPER_BUTTON = 3;
134 SETTINGS_BUTTON = 4;
135 REMOVE_TARGET = 5;
136 UNINSTALL_TARGET = 6;
137 APPINFO_TARGET = 7;
138 RESIZE_HANDLE = 8;
139 VERTICAL_SCROLL = 9;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700140 HOME_INTENT = 10; // Deprecated, use enum Command instead
Winson Chung41d58f72019-04-02 15:09:36 -0700141 BACK_BUTTON = 11;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -0800142 QUICK_SCRUB_BUTTON = 12;
Hyunyoung Song63311a22018-04-27 15:50:44 -0700143 CLEAR_ALL_BUTTON = 13;
Mehdi Alizadehbda47cf2018-05-01 19:26:05 -0700144 CANCEL_TARGET = 14;
Hyunyoung Songde184a22018-05-24 13:05:50 -0700145 TASK_PREVIEW = 15;
146 SPLIT_SCREEN_TARGET = 16;
Vadim Tryshevdc7d25d2018-10-15 14:01:04 -0700147 REMOTE_ACTION_SHORTCUT = 17;
Vadim Tryshev3514a222018-10-03 16:34:41 -0700148 APP_USAGE_SETTINGS = 18;
Winson Chung41d58f72019-04-02 15:09:36 -0700149 BACK_GESTURE = 19;
Hyunyoung Songfd94cd52019-04-25 11:20:42 -0700150 UNDO = 20;
Samuel Fufa866ff002019-08-09 16:16:06 -0700151 DISMISS_PREDICTION = 21;
Samuel Fufab641ac22020-02-10 17:58:11 -0800152 HYBRID_HOTSEAT_ACCEPTED = 22;
153 HYBRID_HOTSEAT_CANCELED = 23;
Becky Qiu4e3eaa52020-02-19 17:37:22 -0800154 OVERVIEW_ACTIONS_SHARE_BUTTON = 24;
155 OVERVIEW_ACTIONS_SCREENSHOT_BUTTON = 25;
156 OVERVIEW_ACTIONS_SELECT_BUTTON = 26;
157 SELECT_MODE_CLOSE_BUTTON = 27;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800158}
159
Hyunyoung Song018eec62018-05-09 16:18:58 -0700160enum TipType {
161 DEFAULT_NONE = 0;
162 BOUNCE = 1;
163 SWIPE_UP_TEXT = 2;
164 QUICK_SCRUB_TEXT = 3;
165 PREDICTION_TEXT = 4;
vadimtc28aa1a2019-03-11 17:49:01 -0700166 DWB_TOAST = 5;
Samuel Fufab641ac22020-02-10 17:58:11 -0800167 HYBRID_HOTSEAT = 6;
Hyunyoung Song018eec62018-05-09 16:18:58 -0700168}
169
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700170// Used to define the action component of the LauncherEvent.
Hyunyoung Song726eb822016-03-07 10:07:35 -0800171message Action {
172 enum Type {
173 TOUCH = 0;
174 AUTOMATED = 1;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700175 COMMAND = 2;
Hyunyoung Song018eec62018-05-09 16:18:58 -0700176 TIP = 3;
thiruramc1c2bfa2020-02-04 18:56:40 -0800177 SOFT_KEYBOARD = 4;
178 // HARD_KEYBOARD, ASSIST
Hyunyoung Song726eb822016-03-07 10:07:35 -0800179 }
Hyunyoung Song018eec62018-05-09 16:18:58 -0700180
Hyunyoung Song726eb822016-03-07 10:07:35 -0800181 enum Touch {
182 TAP = 0;
183 LONGPRESS = 1;
184 DRAGDROP = 2;
185 SWIPE = 3;
186 FLING = 4;
187 PINCH = 5;
Hyunyoung Songebc5f822019-04-03 12:28:01 -0700188 SWIPE_NOOP = 6;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800189 }
Hyunyoung Song018eec62018-05-09 16:18:58 -0700190
191 enum Direction {
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700192 NONE = 0;
193 UP = 1;
194 DOWN = 2;
195 LEFT = 3;
196 RIGHT = 4;
Hyunyoung Songebc5f822019-04-03 12:28:01 -0700197 UPRIGHT = 5;
198 UPLEFT = 6;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700199 }
Jon Mirandafeba90f2016-10-06 10:53:29 -0700200 enum Command {
201 HOME_INTENT = 0;
202 BACK = 1;
Vadim Tryshevd0788022018-05-15 14:05:47 -0700203 ENTRY = 2; // Indicates entry to one of Launcher container type target
204 // not using the HOME_INTENT
205 CANCEL = 3; // Indicates that a confirmation screen was cancelled
206 CONFIRM = 4; // Indicates thata confirmation screen was accepted
207 STOP = 5; // Indicates onStop() was called (screen time out, power off)
208 RECENTS_BUTTON = 6; // Indicates that Recents button was pressed
Hyunyoung Songbd6fba92018-05-16 15:54:31 -0700209 RESUME = 7; // Indicates onResume() was called
Jon Mirandafeba90f2016-10-06 10:53:29 -0700210 }
Hyunyoung Song7fb3ccc2017-10-17 15:39:46 -0700211
Hyunyoung Song726eb822016-03-07 10:07:35 -0800212 optional Type type = 1;
213 optional Touch touch = 2;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700214 optional Direction dir = 3;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700215 optional Command command = 4;
216 // Log if the action was performed on outside of the container
217 optional bool is_outside = 5;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -0800218 optional bool is_state_change = 6;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800219}
220
221//
222// Context free grammar of typical user interaction:
223// Action (Touch) + Target
224// Action (Touch) + Target + Target
225//
226message LauncherEvent {
Hyunyoung Song726eb822016-03-07 10:07:35 -0800227 required Action action = 1;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800228 // List of targets that touch actions can be operated on.
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700229 repeated Target src_target = 2;
230 repeated Target dest_target = 3;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800231
232 optional int64 action_duration_millis = 4;
233 optional int64 elapsed_container_millis = 5;
234 optional int64 elapsed_session_millis = 6;
Jon Mirandafe964322017-03-22 10:25:17 -0700235
Hyunyoung Song956ec4b2018-07-02 13:17:32 -0700236 optional bool is_in_multi_window_mode = 7 [deprecated = true];
237 optional bool is_in_landscape_mode = 8 [deprecated = true];
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700238
239 optional LauncherEventExtension extension = 9;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700240}