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; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 59 | } |
| 60 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 61 | // Used to define what type of item a Target would represent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 62 | enum ItemType { |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 63 | DEFAULT_ITEMTYPE = 0; |
| 64 | APP_ICON = 1; |
| 65 | SHORTCUT = 2; |
| 66 | WIDGET = 3; |
| 67 | FOLDER_ICON = 4; |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 68 | DEEPSHORTCUT = 5; |
Hyunyoung Song | ffad962 | 2016-09-27 18:07:00 -0700 | [diff] [blame] | 69 | SEARCHBOX = 6; |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 70 | EDITTEXT = 7; |
Tony Wickham | c6b79e3 | 2017-02-01 09:13:24 -0800 | [diff] [blame] | 71 | NOTIFICATION = 8; |
Hyunyoung Song | b3fbc0b | 2018-02-14 13:40:25 -0800 | [diff] [blame] | 72 | TASK = 9; // Each page of Recents UI (QuickStep) |
Mario Bertschler | d2e3c5d | 2018-03-29 21:12:12 +0200 | [diff] [blame] | 73 | WEB_APP = 10; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 74 | } |
| 75 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 76 | // Used to define what type of container a Target would represent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 77 | enum ContainerType { |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 78 | DEFAULT_CONTAINERTYPE = 0; |
| 79 | WORKSPACE = 1; |
| 80 | HOTSEAT = 2; |
| 81 | FOLDER = 3; |
| 82 | ALLAPPS = 4; |
| 83 | WIDGETS = 5; |
Hyunyoung Song | b3fbc0b | 2018-02-14 13:40:25 -0800 | [diff] [blame] | 84 | OVERVIEW = 6; // Zoomed out workspace (without QuickStep) |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 85 | PREDICTION = 7; |
| 86 | SEARCHRESULT = 8; |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 87 | DEEPSHORTCUTS = 9; |
Sunny Goyal | 778634c | 2017-03-21 11:59:04 -0700 | [diff] [blame] | 88 | PINITEM = 10; // confirmation screen |
Hyunyoung Song | b3fbc0b | 2018-02-14 13:40:25 -0800 | [diff] [blame] | 89 | NAVBAR = 11; |
| 90 | TASKSWITCHER = 12; // Recents UI Container (QuickStep) |
| 91 | APP = 13; // Foreground activity is another app (QuickStep) |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 92 | TIP = 14; // Onboarding texts (QuickStep) |
Vadim Tryshev | d078802 | 2018-05-15 14:05:47 -0700 | [diff] [blame] | 93 | SIDELOADED_LAUNCHER = 15; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 94 | } |
| 95 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 96 | // Used to define what type of control a Target would represent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 97 | enum ControlType { |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 98 | DEFAULT_CONTROLTYPE = 0; |
| 99 | ALL_APPS_BUTTON = 1; |
| 100 | WIDGETS_BUTTON = 2; |
| 101 | WALLPAPER_BUTTON = 3; |
| 102 | SETTINGS_BUTTON = 4; |
| 103 | REMOVE_TARGET = 5; |
| 104 | UNINSTALL_TARGET = 6; |
| 105 | APPINFO_TARGET = 7; |
| 106 | RESIZE_HANDLE = 8; |
| 107 | VERTICAL_SCROLL = 9; |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 108 | HOME_INTENT = 10; // Deprecated, use enum Command instead |
| 109 | BACK_BUTTON = 11; // Deprecated, use enum Command instead |
Hyunyoung Song | b3fbc0b | 2018-02-14 13:40:25 -0800 | [diff] [blame] | 110 | QUICK_SCRUB_BUTTON = 12; |
Hyunyoung Song | 63311a2 | 2018-04-27 15:50:44 -0700 | [diff] [blame] | 111 | CLEAR_ALL_BUTTON = 13; |
Mehdi Alizadeh | bda47cf | 2018-05-01 19:26:05 -0700 | [diff] [blame] | 112 | CANCEL_TARGET = 14; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 113 | } |
| 114 | |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 115 | enum TipType { |
| 116 | DEFAULT_NONE = 0; |
| 117 | BOUNCE = 1; |
| 118 | SWIPE_UP_TEXT = 2; |
| 119 | QUICK_SCRUB_TEXT = 3; |
| 120 | PREDICTION_TEXT = 4; |
| 121 | } |
| 122 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 123 | // Used to define the action component of the LauncherEvent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 124 | message Action { |
| 125 | enum Type { |
| 126 | TOUCH = 0; |
| 127 | AUTOMATED = 1; |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 128 | COMMAND = 2; |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 129 | TIP = 3; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 130 | // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST |
| 131 | } |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 132 | |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 133 | enum Touch { |
| 134 | TAP = 0; |
| 135 | LONGPRESS = 1; |
| 136 | DRAGDROP = 2; |
| 137 | SWIPE = 3; |
| 138 | FLING = 4; |
| 139 | PINCH = 5; |
| 140 | } |
Hyunyoung Song | 018eec6 | 2018-05-09 16:18:58 -0700 | [diff] [blame] | 141 | |
| 142 | enum Direction { |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 143 | NONE = 0; |
| 144 | UP = 1; |
| 145 | DOWN = 2; |
| 146 | LEFT = 3; |
| 147 | RIGHT = 4; |
| 148 | } |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 149 | enum Command { |
| 150 | HOME_INTENT = 0; |
| 151 | BACK = 1; |
Vadim Tryshev | d078802 | 2018-05-15 14:05:47 -0700 | [diff] [blame] | 152 | ENTRY = 2; // Indicates entry to one of Launcher container type target |
| 153 | // not using the HOME_INTENT |
| 154 | CANCEL = 3; // Indicates that a confirmation screen was cancelled |
| 155 | CONFIRM = 4; // Indicates thata confirmation screen was accepted |
| 156 | STOP = 5; // Indicates onStop() was called (screen time out, power off) |
| 157 | RECENTS_BUTTON = 6; // Indicates that Recents button was pressed |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 158 | } |
Hyunyoung Song | 7fb3ccc | 2017-10-17 15:39:46 -0700 | [diff] [blame] | 159 | |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 160 | optional Type type = 1; |
| 161 | optional Touch touch = 2; |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 162 | optional Direction dir = 3; |
Jon Miranda | feba90f | 2016-10-06 10:53:29 -0700 | [diff] [blame] | 163 | optional Command command = 4; |
| 164 | // Log if the action was performed on outside of the container |
| 165 | optional bool is_outside = 5; |
Hyunyoung Song | b3fbc0b | 2018-02-14 13:40:25 -0800 | [diff] [blame] | 166 | optional bool is_state_change = 6; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 167 | } |
| 168 | |
| 169 | // |
| 170 | // Context free grammar of typical user interaction: |
| 171 | // Action (Touch) + Target |
| 172 | // Action (Touch) + Target + Target |
| 173 | // |
| 174 | message LauncherEvent { |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 175 | required Action action = 1; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 176 | // List of targets that touch actions can be operated on. |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 177 | repeated Target src_target = 2; |
| 178 | repeated Target dest_target = 3; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 179 | |
| 180 | optional int64 action_duration_millis = 4; |
| 181 | optional int64 elapsed_container_millis = 5; |
| 182 | optional int64 elapsed_session_millis = 6; |
Jon Miranda | fe96432 | 2017-03-22 10:25:17 -0700 | [diff] [blame] | 183 | |
| 184 | optional bool is_in_multi_window_mode = 7; |
Hyunyoung Song | d5a9b57 | 2017-05-16 11:04:26 -0700 | [diff] [blame] | 185 | optional bool is_in_landscape_mode = 8; |
Sunny Goyal | 2385ebe | 2017-07-19 01:24:07 -0700 | [diff] [blame] | 186 | |
| 187 | optional LauncherEventExtension extension = 9; |
Hyunyoung Song | 5aa2714 | 2016-07-21 11:48:37 -0700 | [diff] [blame] | 188 | } |