blob: c42b142f72a5f4dc3f899afb71123eccd306a65e [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
Tamas Berghammere54852d2016-10-31 18:07:11 +000018option java_package = "com.android.launcher3.userevent";
Hyunyoung Song726eb822016-03-07 10:07:35 -080019option java_outer_classname = "LauncherLogProto";
20
21package userevent;
22
23message 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 Songddec1c72016-04-12 18:32:04 -070035 optional int32 page_index = 2;
36 optional int32 rank = 3;
37 optional int32 grid_x = 4;
38 optional int32 grid_y = 5;
Hyunyoung Song726eb822016-03-07 10:07:35 -080039
40 // For container types only
Hyunyoung Songddec1c72016-04-12 18:32:04 -070041 optional ContainerType container_type = 6;
42 optional int32 cardinality = 7;
Hyunyoung Song726eb822016-03-07 10:07:35 -080043
44 // For control types only
Hyunyoung Songddec1c72016-04-12 18:32:04 -070045 optional ControlType control_type = 8;
Hyunyoung Song726eb822016-03-07 10:07:35 -080046
47 // For item types only
Hyunyoung Songddec1c72016-04-12 18:32:04 -070048 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 Song726eb822016-03-07 10:07:35 -080055}
56
Hyunyoung Songddec1c72016-04-12 18:32:04 -070057// Used to define what type of item a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -080058enum ItemType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -070059 DEFAULT_ITEMTYPE = 0;
60 APP_ICON = 1;
61 SHORTCUT = 2;
62 WIDGET = 3;
63 FOLDER_ICON = 4;
Hyunyoung Song5aa27142016-07-21 11:48:37 -070064 DEEPSHORTCUT = 5;
Hyunyoung Songffad9622016-09-27 18:07:00 -070065 SEARCHBOX = 6;
Jon Mirandafeba90f2016-10-06 10:53:29 -070066 EDITTEXT = 7;
Tony Wickhamc6b79e32017-02-01 09:13:24 -080067 NOTIFICATION = 8;
Hyunyoung Song726eb822016-03-07 10:07:35 -080068}
69
Hyunyoung Songddec1c72016-04-12 18:32:04 -070070// Used to define what type of container a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -080071enum ContainerType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -070072 DEFAULT_CONTAINERTYPE = 0;
73 WORKSPACE = 1;
74 HOTSEAT = 2;
75 FOLDER = 3;
76 ALLAPPS = 4;
77 WIDGETS = 5;
78 OVERVIEW = 6;
79 PREDICTION = 7;
80 SEARCHRESULT = 8;
Hyunyoung Song5aa27142016-07-21 11:48:37 -070081 DEEPSHORTCUTS = 9;
Hyunyoung Song726eb822016-03-07 10:07:35 -080082}
83
Hyunyoung Songddec1c72016-04-12 18:32:04 -070084// Used to define what type of control a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -080085enum ControlType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -070086 DEFAULT_CONTROLTYPE = 0;
87 ALL_APPS_BUTTON = 1;
88 WIDGETS_BUTTON = 2;
89 WALLPAPER_BUTTON = 3;
90 SETTINGS_BUTTON = 4;
91 REMOVE_TARGET = 5;
92 UNINSTALL_TARGET = 6;
93 APPINFO_TARGET = 7;
94 RESIZE_HANDLE = 8;
95 VERTICAL_SCROLL = 9;
Jon Mirandafeba90f2016-10-06 10:53:29 -070096 HOME_INTENT = 10; // Deprecated, use enum Command instead
97 BACK_BUTTON = 11; // Deprecated, use enum Command instead
98 // GO_TO_PLAYSTORE
Hyunyoung Song726eb822016-03-07 10:07:35 -080099}
100
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700101// Used to define the action component of the LauncherEvent.
Hyunyoung Song726eb822016-03-07 10:07:35 -0800102message Action {
103 enum Type {
104 TOUCH = 0;
105 AUTOMATED = 1;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700106 COMMAND = 2;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800107 // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST
108 }
109 enum Touch {
110 TAP = 0;
111 LONGPRESS = 1;
112 DRAGDROP = 2;
113 SWIPE = 3;
114 FLING = 4;
115 PINCH = 5;
116 }
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700117 enum Direction {
118 NONE = 0;
119 UP = 1;
120 DOWN = 2;
121 LEFT = 3;
122 RIGHT = 4;
123 }
Jon Mirandafeba90f2016-10-06 10:53:29 -0700124 enum Command {
125 HOME_INTENT = 0;
126 BACK = 1;
127 }
Hyunyoung Song726eb822016-03-07 10:07:35 -0800128 optional Type type = 1;
129 optional Touch touch = 2;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700130 optional Direction dir = 3;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700131 optional Command command = 4;
132 // Log if the action was performed on outside of the container
133 optional bool is_outside = 5;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800134}
135
136//
137// Context free grammar of typical user interaction:
138// Action (Touch) + Target
139// Action (Touch) + Target + Target
140//
141message LauncherEvent {
142
143 required Action action = 1;
144
145 // List of targets that touch actions can be operated on.
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700146 repeated Target src_target = 2;
147 repeated Target dest_target = 3;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800148
149 optional int64 action_duration_millis = 4;
150 optional int64 elapsed_container_millis = 5;
151 optional int64 elapsed_session_millis = 6;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700152}