Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 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 | */ |
| 16 | syntax = "proto2"; |
| 17 | |
Sunny Goyal | 2385ebe | 2017-07-19 01:24:07 -0700 | [diff] [blame] | 18 | import "launcher_log_extension.proto"; |
| 19 | |
Tamas Berghammer | e54852d | 2016-10-31 18:07:11 +0000 | [diff] [blame] | 20 | option java_package = "com.android.launcher3.userevent"; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 21 | option java_outer_classname = "LauncherLogProto"; |
| 22 | |
| 23 | package userevent; |
| 24 | |
| 25 | message 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 Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 37 | optional int32 page_index = 2; |
| 38 | optional int32 rank = 3; |
| 39 | optional int32 grid_x = 4; |
| 40 | optional int32 grid_y = 5; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 41 | |
| 42 | // For container types only |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 43 | optional ContainerType container_type = 6; |
| 44 | optional int32 cardinality = 7; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 45 | |
| 46 | // For control types only |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 47 | optional ControlType control_type = 8; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 48 | |
| 49 | // For item types only |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 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; |
Sunny Goyal | 2385ebe | 2017-07-19 01:24:07 -0700 | [diff] [blame] | 57 | optional TargetExtension extension = 16; |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 58 | optional TipType tip_type = 17; |
Alex Mang | 68c6754 | 2019-05-06 21:20:07 -0700 | [diff] [blame] | 59 | optional int32 search_query_length = 18; |
Samuel Fufa | 78e7e5f | 2019-12-10 13:23:51 -0800 | [diff] [blame] | 60 | optional bool is_work_app = 19; |
thiruram | c1c2bfa | 2020-02-04 18:56:40 -0800 | [diff] [blame] | 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; |
| 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 Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 90 | } |
| 91 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 92 | // Used to define what type of item a Target would represent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 93 | enum ItemType { |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 94 | DEFAULT_ITEMTYPE = 0; |
| 95 | APP_ICON = 1; |
| 96 | SHORTCUT = 2; |
| 97 | WIDGET = 3; |
| 98 | FOLDER_ICON = 4; |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 99 | DEEPSHORTCUT = 5; |
Hyunyoung Song | ffad962 | 2016-09-27 18:07:00 -0700 | [diff] [blame] | 100 | SEARCHBOX = 6; |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 101 | EDITTEXT = 7; |
Tony Wickham | c6b79e3 | 2017-02-01 09:13:24 -0800 | [diff] [blame] | 102 | NOTIFICATION = 8; |
Hyunyoung Song | b3fbc0b | 2018-02-14 13:40:25 -0800 | [diff] [blame] | 103 | TASK = 9; // Each page of Recents UI (QuickStep) |
Mario Bertschler | d2e3c5d | 2018-03-29 21:12:12 +0200 | [diff] [blame] | 104 | WEB_APP = 10; |
Hyunyoung Song | fd94cd5 | 2019-04-25 11:20:42 -0700 | [diff] [blame] | 105 | TASK_ICON = 11; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 106 | } |
| 107 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 108 | // Used to define what type of container a Target would represent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 109 | enum ContainerType { |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 110 | DEFAULT_CONTAINERTYPE = 0; |
| 111 | WORKSPACE = 1; |
| 112 | HOTSEAT = 2; |
| 113 | FOLDER = 3; |
| 114 | ALLAPPS = 4; |
| 115 | WIDGETS = 5; |
Hyunyoung Song | b3fbc0b | 2018-02-14 13:40:25 -0800 | [diff] [blame] | 116 | OVERVIEW = 6; // Zoomed out workspace (without QuickStep) |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 117 | PREDICTION = 7; |
| 118 | SEARCHRESULT = 8; |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 119 | DEEPSHORTCUTS = 9; |
Sunny Goyal | 778634c | 2017-03-21 11:59:04 -0700 | [diff] [blame] | 120 | PINITEM = 10; // confirmation screen |
Hyunyoung Song | b3fbc0b | 2018-02-14 13:40:25 -0800 | [diff] [blame] | 121 | NAVBAR = 11; |
| 122 | TASKSWITCHER = 12; // Recents UI Container (QuickStep) |
| 123 | APP = 13; // Foreground activity is another app (QuickStep) |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 124 | TIP = 14; // Onboarding texts (QuickStep) |
vadimt | bd28a8e | 2019-12-13 17:16:19 -0800 | [diff] [blame] | 125 | OTHER_LAUNCHER_APP = 15; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 126 | } |
| 127 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 128 | // Used to define what type of control a Target would represent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 129 | enum ControlType { |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 130 | 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 Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 140 | HOME_INTENT = 10; // Deprecated, use enum Command instead |
Winson Chung | 41d58f7 | 2019-04-02 15:09:36 -0700 | [diff] [blame] | 141 | BACK_BUTTON = 11; |
Hyunyoung Song | b3fbc0b | 2018-02-14 13:40:25 -0800 | [diff] [blame] | 142 | QUICK_SCRUB_BUTTON = 12; |
Hyunyoung Song | 63311a2 | 2018-04-27 15:50:44 -0700 | [diff] [blame] | 143 | CLEAR_ALL_BUTTON = 13; |
Mehdi Alizadeh | bda47cf | 2018-05-01 19:26:05 -0700 | [diff] [blame] | 144 | CANCEL_TARGET = 14; |
Hyunyoung Song | de184a2 | 2018-05-24 13:05:50 -0700 | [diff] [blame] | 145 | TASK_PREVIEW = 15; |
| 146 | SPLIT_SCREEN_TARGET = 16; |
Vadim Tryshev | dc7d25d | 2018-10-15 14:01:04 -0700 | [diff] [blame] | 147 | REMOTE_ACTION_SHORTCUT = 17; |
Vadim Tryshev | 3514a22 | 2018-10-03 16:34:41 -0700 | [diff] [blame] | 148 | APP_USAGE_SETTINGS = 18; |
Winson Chung | 41d58f7 | 2019-04-02 15:09:36 -0700 | [diff] [blame] | 149 | BACK_GESTURE = 19; |
Hyunyoung Song | fd94cd5 | 2019-04-25 11:20:42 -0700 | [diff] [blame] | 150 | UNDO = 20; |
Samuel Fufa | 866ff00 | 2019-08-09 16:16:06 -0700 | [diff] [blame] | 151 | DISMISS_PREDICTION = 21; |
Samuel Fufa | b641ac2 | 2020-02-10 17:58:11 -0800 | [diff] [blame] | 152 | HYBRID_HOTSEAT_ACCEPTED = 22; |
| 153 | HYBRID_HOTSEAT_CANCELED = 23; |
Becky Qiu | 4e3eaa5 | 2020-02-19 17:37:22 -0800 | [diff] [blame] | 154 | OVERVIEW_ACTIONS_SHARE_BUTTON = 24; |
| 155 | OVERVIEW_ACTIONS_SCREENSHOT_BUTTON = 25; |
| 156 | OVERVIEW_ACTIONS_SELECT_BUTTON = 26; |
| 157 | SELECT_MODE_CLOSE_BUTTON = 27; |
Zak Cohen | 8f1e00b | 2020-03-05 15:41:22 -0800 | [diff] [blame] | 158 | SELECT_MODE_ITEM = 28; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 159 | } |
| 160 | |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 161 | enum TipType { |
| 162 | DEFAULT_NONE = 0; |
| 163 | BOUNCE = 1; |
| 164 | SWIPE_UP_TEXT = 2; |
| 165 | QUICK_SCRUB_TEXT = 3; |
| 166 | PREDICTION_TEXT = 4; |
vadimt | c28aa1a | 2019-03-11 17:49:01 -0700 | [diff] [blame] | 167 | DWB_TOAST = 5; |
Samuel Fufa | b641ac2 | 2020-02-10 17:58:11 -0800 | [diff] [blame] | 168 | HYBRID_HOTSEAT = 6; |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 169 | } |
| 170 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 171 | // Used to define the action component of the LauncherEvent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 172 | message Action { |
| 173 | enum Type { |
| 174 | TOUCH = 0; |
| 175 | AUTOMATED = 1; |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 176 | COMMAND = 2; |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 177 | TIP = 3; |
thiruram | c1c2bfa | 2020-02-04 18:56:40 -0800 | [diff] [blame] | 178 | SOFT_KEYBOARD = 4; |
| 179 | // HARD_KEYBOARD, ASSIST |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 180 | } |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 181 | |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 182 | enum Touch { |
| 183 | TAP = 0; |
| 184 | LONGPRESS = 1; |
| 185 | DRAGDROP = 2; |
| 186 | SWIPE = 3; |
| 187 | FLING = 4; |
| 188 | PINCH = 5; |
Hyunyoung Song | ebc5f82 | 2019-04-03 12:28:01 -0700 | [diff] [blame] | 189 | SWIPE_NOOP = 6; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 190 | } |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 191 | |
| 192 | enum Direction { |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 193 | NONE = 0; |
| 194 | UP = 1; |
| 195 | DOWN = 2; |
| 196 | LEFT = 3; |
| 197 | RIGHT = 4; |
Hyunyoung Song | ebc5f82 | 2019-04-03 12:28:01 -0700 | [diff] [blame] | 198 | UPRIGHT = 5; |
| 199 | UPLEFT = 6; |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 200 | } |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 201 | enum Command { |
| 202 | HOME_INTENT = 0; |
| 203 | BACK = 1; |
Vadim Tryshev | d078802 | 2018-05-15 14:05:47 -0700 | [diff] [blame] | 204 | ENTRY = 2; // Indicates entry to one of Launcher container type target |
| 205 | // not using the HOME_INTENT |
| 206 | CANCEL = 3; // Indicates that a confirmation screen was cancelled |
| 207 | CONFIRM = 4; // Indicates thata confirmation screen was accepted |
| 208 | STOP = 5; // Indicates onStop() was called (screen time out, power off) |
| 209 | RECENTS_BUTTON = 6; // Indicates that Recents button was pressed |
Hyunyoung Song | bd6fba9 | 2018-05-16 15:54:31 -0700 | [diff] [blame] | 210 | RESUME = 7; // Indicates onResume() was called |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 211 | } |
Hyunyoung Song | 7fb3ccc | 2017-10-17 15:39:46 -0700 | [diff] [blame] | 212 | |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 213 | optional Type type = 1; |
| 214 | optional Touch touch = 2; |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 215 | optional Direction dir = 3; |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 216 | optional Command command = 4; |
| 217 | // Log if the action was performed on outside of the container |
| 218 | optional bool is_outside = 5; |
Hyunyoung Song | b3fbc0b | 2018-02-14 13:40:25 -0800 | [diff] [blame] | 219 | optional bool is_state_change = 6; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | // |
| 223 | // Context free grammar of typical user interaction: |
| 224 | // Action (Touch) + Target |
| 225 | // Action (Touch) + Target + Target |
| 226 | // |
| 227 | message LauncherEvent { |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 228 | required Action action = 1; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 229 | // List of targets that touch actions can be operated on. |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 230 | repeated Target src_target = 2; |
| 231 | repeated Target dest_target = 3; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 232 | |
| 233 | optional int64 action_duration_millis = 4; |
| 234 | optional int64 elapsed_container_millis = 5; |
| 235 | optional int64 elapsed_session_millis = 6; |
Jon Miranda | fe96432 | 2017-03-22 10:25:17 -0700 | [diff] [blame] | 236 | |
Hyunyoung Song | 956ec4b | 2018-07-02 13:17:32 -0700 | [diff] [blame] | 237 | optional bool is_in_multi_window_mode = 7 [deprecated = true]; |
| 238 | optional bool is_in_landscape_mode = 8 [deprecated = true]; |
Sunny Goyal | 2385ebe | 2017-07-19 01:24:07 -0700 | [diff] [blame] | 239 | |
| 240 | optional LauncherEventExtension extension = 9; |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 241 | } |