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 | |
| 18 | option java_package = "com.android.launcher3.userevent.nano"; |
| 19 | option java_outer_classname = "LauncherLogProto"; |
| 20 | |
| 21 | package userevent; |
| 22 | |
| 23 | message Target { |
| 24 | enum Type { |
| 25 | NONE = 0; |
| 26 | ITEM = 1; |
| 27 | CONTROL = 2; |
| 28 | CONTAINER = 3; |
| 29 | } |
| 30 | |
| 31 | optional Type type = 1; |
| 32 | |
| 33 | // For container type and item type |
| 34 | // Used mainly for ContainerType.FOLDER, ItemType.* |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 35 | optional int32 page_index = 2; |
| 36 | optional int32 rank = 3; |
| 37 | optional int32 grid_x = 4; |
| 38 | optional int32 grid_y = 5; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 39 | |
| 40 | // For container types only |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 41 | optional ContainerType container_type = 6; |
| 42 | optional int32 cardinality = 7; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 43 | |
| 44 | // For control types only |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 45 | optional ControlType control_type = 8; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 46 | |
| 47 | // For item types only |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 48 | optional ItemType item_type = 9; |
| 49 | optional int32 package_name_hash = 10; |
| 50 | optional int32 component_hash = 11; // Used for ItemType.WIDGET |
| 51 | optional int32 intent_hash = 12; // Used for ItemType.SHORTCUT |
| 52 | optional int32 span_x = 13 [default = 1];// Used for ItemType.WIDGET |
| 53 | optional int32 span_y = 14 [default = 1];// Used for ItemType.WIDGET |
| 54 | optional int32 predictedRank = 15; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 55 | } |
| 56 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 57 | // Used to define what type of item a Target would represent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 58 | enum ItemType { |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 59 | DEFAULT_ITEMTYPE = 0; |
| 60 | APP_ICON = 1; |
| 61 | SHORTCUT = 2; |
| 62 | WIDGET = 3; |
| 63 | FOLDER_ICON = 4; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 64 | } |
| 65 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 66 | // Used to define what type of container a Target would represent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 67 | enum ContainerType { |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 68 | DEFAULT_CONTAINERTYPE = 0; |
| 69 | WORKSPACE = 1; |
| 70 | HOTSEAT = 2; |
| 71 | FOLDER = 3; |
| 72 | ALLAPPS = 4; |
| 73 | WIDGETS = 5; |
| 74 | OVERVIEW = 6; |
| 75 | PREDICTION = 7; |
| 76 | SEARCHRESULT = 8; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 77 | } |
| 78 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 79 | // Used to define what type of control a Target would represent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 80 | enum ControlType { |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 81 | DEFAULT_CONTROLTYPE = 0; |
| 82 | ALL_APPS_BUTTON = 1; |
| 83 | WIDGETS_BUTTON = 2; |
| 84 | WALLPAPER_BUTTON = 3; |
| 85 | SETTINGS_BUTTON = 4; |
| 86 | REMOVE_TARGET = 5; |
| 87 | UNINSTALL_TARGET = 6; |
| 88 | APPINFO_TARGET = 7; |
| 89 | RESIZE_HANDLE = 8; |
| 90 | VERTICAL_SCROLL = 9; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 91 | // HOME, BACK, GO_TO_PLAYSTORE |
| 92 | } |
| 93 | |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 94 | // Used to define the action component of the LauncherEvent. |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 95 | message Action { |
| 96 | enum Type { |
| 97 | TOUCH = 0; |
| 98 | AUTOMATED = 1; |
| 99 | // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST |
| 100 | } |
| 101 | enum Touch { |
| 102 | TAP = 0; |
| 103 | LONGPRESS = 1; |
| 104 | DRAGDROP = 2; |
| 105 | SWIPE = 3; |
| 106 | FLING = 4; |
| 107 | PINCH = 5; |
| 108 | } |
| 109 | optional Type type = 1; |
| 110 | optional Touch touch = 2; |
| 111 | } |
| 112 | |
| 113 | // |
| 114 | // Context free grammar of typical user interaction: |
| 115 | // Action (Touch) + Target |
| 116 | // Action (Touch) + Target + Target |
| 117 | // |
| 118 | message LauncherEvent { |
| 119 | |
| 120 | required Action action = 1; |
| 121 | |
| 122 | // List of targets that touch actions can be operated on. |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 123 | repeated Target src_target = 2; |
| 124 | repeated Target dest_target = 3; |
Hyunyoung Song | 726eb82 | 2016-03-07 10:07:35 -0800 | [diff] [blame] | 125 | |
| 126 | optional int64 action_duration_millis = 4; |
| 127 | optional int64 elapsed_container_millis = 5; |
| 128 | optional int64 elapsed_session_millis = 6; |
Hyunyoung Song | ddec1c7 | 2016-04-12 18:32:04 -0700 | [diff] [blame] | 129 | } |