blob: 3b983d254f2c0db231db724122c0ff9a30318080 [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 Song726eb822016-03-07 10:07:35 -080058}
59
Hyunyoung Songddec1c72016-04-12 18:32:04 -070060// Used to define what type of item a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -080061enum ItemType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -070062 DEFAULT_ITEMTYPE = 0;
63 APP_ICON = 1;
64 SHORTCUT = 2;
65 WIDGET = 3;
66 FOLDER_ICON = 4;
Hyunyoung Song5aa27142016-07-21 11:48:37 -070067 DEEPSHORTCUT = 5;
Hyunyoung Songffad9622016-09-27 18:07:00 -070068 SEARCHBOX = 6;
Jon Mirandafeba90f2016-10-06 10:53:29 -070069 EDITTEXT = 7;
Tony Wickhamc6b79e32017-02-01 09:13:24 -080070 NOTIFICATION = 8;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -080071 TASK = 9; // Each page of Recents UI (QuickStep)
Hyunyoung Song726eb822016-03-07 10:07:35 -080072}
73
Hyunyoung Songddec1c72016-04-12 18:32:04 -070074// Used to define what type of container a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -080075enum ContainerType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -070076 DEFAULT_CONTAINERTYPE = 0;
77 WORKSPACE = 1;
78 HOTSEAT = 2;
79 FOLDER = 3;
80 ALLAPPS = 4;
81 WIDGETS = 5;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -080082 OVERVIEW = 6; // Zoomed out workspace (without QuickStep)
Hyunyoung Songddec1c72016-04-12 18:32:04 -070083 PREDICTION = 7;
84 SEARCHRESULT = 8;
Hyunyoung Song5aa27142016-07-21 11:48:37 -070085 DEEPSHORTCUTS = 9;
Sunny Goyal778634c2017-03-21 11:59:04 -070086 PINITEM = 10; // confirmation screen
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -080087 NAVBAR = 11;
88 TASKSWITCHER = 12; // Recents UI Container (QuickStep)
89 APP = 13; // Foreground activity is another app (QuickStep)
Hyunyoung Song726eb822016-03-07 10:07:35 -080090}
91
Hyunyoung Songddec1c72016-04-12 18:32:04 -070092// Used to define what type of control a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -080093enum ControlType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -070094 DEFAULT_CONTROLTYPE = 0;
95 ALL_APPS_BUTTON = 1;
96 WIDGETS_BUTTON = 2;
97 WALLPAPER_BUTTON = 3;
98 SETTINGS_BUTTON = 4;
99 REMOVE_TARGET = 5;
100 UNINSTALL_TARGET = 6;
101 APPINFO_TARGET = 7;
102 RESIZE_HANDLE = 8;
103 VERTICAL_SCROLL = 9;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700104 HOME_INTENT = 10; // Deprecated, use enum Command instead
105 BACK_BUTTON = 11; // Deprecated, use enum Command instead
106 // GO_TO_PLAYSTORE
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -0800107 QUICK_SCRUB_BUTTON = 12;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800108}
109
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700110// Used to define the action component of the LauncherEvent.
Hyunyoung Song726eb822016-03-07 10:07:35 -0800111message Action {
112 enum Type {
113 TOUCH = 0;
114 AUTOMATED = 1;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700115 COMMAND = 2;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800116 // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST
117 }
118 enum Touch {
119 TAP = 0;
120 LONGPRESS = 1;
121 DRAGDROP = 2;
122 SWIPE = 3;
123 FLING = 4;
124 PINCH = 5;
125 }
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700126 enum Direction {
127 NONE = 0;
128 UP = 1;
129 DOWN = 2;
130 LEFT = 3;
131 RIGHT = 4;
132 }
Jon Mirandafeba90f2016-10-06 10:53:29 -0700133 enum Command {
134 HOME_INTENT = 0;
135 BACK = 1;
Sunny Goyal778634c2017-03-21 11:59:04 -0700136 ENTRY = 2; // Indicates entry to one of Launcher container type target
137 // not using the HOME_INTENT
138 CANCEL = 3; // Indicates that a confirmation screen was cancelled
139 CONFIRM = 4; // Indicates thata confirmation screen was accepted
Hyunyoung Song7fb3ccc2017-10-17 15:39:46 -0700140 STOP = 5; // Indicates onStop() was called (screen time out, power off)
Jon Mirandafeba90f2016-10-06 10:53:29 -0700141 }
Hyunyoung Song7fb3ccc2017-10-17 15:39:46 -0700142
Hyunyoung Song726eb822016-03-07 10:07:35 -0800143 optional Type type = 1;
144 optional Touch touch = 2;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700145 optional Direction dir = 3;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700146 optional Command command = 4;
147 // Log if the action was performed on outside of the container
148 optional bool is_outside = 5;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -0800149 optional bool is_state_change = 6;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800150}
151
152//
153// Context free grammar of typical user interaction:
154// Action (Touch) + Target
155// Action (Touch) + Target + Target
156//
157message LauncherEvent {
Hyunyoung Song726eb822016-03-07 10:07:35 -0800158 required Action action = 1;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800159 // List of targets that touch actions can be operated on.
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700160 repeated Target src_target = 2;
161 repeated Target dest_target = 3;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800162
163 optional int64 action_duration_millis = 4;
164 optional int64 elapsed_container_millis = 5;
165 optional int64 elapsed_session_millis = 6;
Jon Mirandafe964322017-03-22 10:25:17 -0700166
167 optional bool is_in_multi_window_mode = 7;
Hyunyoung Songd5a9b572017-05-16 11:04:26 -0700168 optional bool is_in_landscape_mode = 8;
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700169
170 optional LauncherEventExtension extension = 9;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700171}