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 */
16syntax = "proto2";
17
18import "launcher_log_extension.proto";
19
20option java_package = "com.android.launcher3.userevent";
21option 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.*
37  optional int32 page_index = 2;
38  optional int32 rank = 3;
39  optional int32 grid_x = 4;
40  optional int32 grid_y = 5;
41
42  // For container types only
43  optional ContainerType container_type = 6;
44  optional int32 cardinality = 7;
45
46  // For control types only
47  optional ControlType control_type = 8;
48
49  // For item types only
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;
57  optional TargetExtension extension = 16;
58  optional TipType tip_type = 17;
59  optional int32 search_query_length = 18;
60}
61
62// Used to define what type of item a Target would represent.
63enum ItemType {
64  DEFAULT_ITEMTYPE = 0;
65  APP_ICON = 1;
66  SHORTCUT = 2;
67  WIDGET = 3;
68  FOLDER_ICON = 4;
69  DEEPSHORTCUT = 5;
70  SEARCHBOX = 6;
71  EDITTEXT = 7;
72  NOTIFICATION = 8;
73  TASK = 9;         // Each page of Recents UI (QuickStep)
74  WEB_APP = 10;
75  TASK_ICON = 11;
76}
77
78// Used to define what type of container a Target would represent.
79enum ContainerType {
80  DEFAULT_CONTAINERTYPE = 0;
81  WORKSPACE = 1;
82  HOTSEAT = 2;
83  FOLDER = 3;
84  ALLAPPS = 4;
85  WIDGETS = 5;
86  OVERVIEW = 6;   // Zoomed out workspace (without QuickStep)
87  PREDICTION = 7;
88  SEARCHRESULT = 8;
89  DEEPSHORTCUTS = 9;
90  PINITEM = 10;    // confirmation screen
91  NAVBAR = 11;
92  TASKSWITCHER = 12; // Recents UI Container (QuickStep)
93  APP = 13; // Foreground activity is another app (QuickStep)
94  TIP = 14; // Onboarding texts (QuickStep)
95  SIDELOADED_LAUNCHER = 15;
96}
97
98// Used to define what type of control a Target would represent.
99enum ControlType {
100  DEFAULT_CONTROLTYPE = 0;
101  ALL_APPS_BUTTON = 1;
102  WIDGETS_BUTTON = 2;
103  WALLPAPER_BUTTON = 3;
104  SETTINGS_BUTTON = 4;
105  REMOVE_TARGET = 5;
106  UNINSTALL_TARGET = 6;
107  APPINFO_TARGET = 7;
108  RESIZE_HANDLE = 8;
109  VERTICAL_SCROLL = 9;
110  HOME_INTENT = 10; // Deprecated, use enum Command instead
111  BACK_BUTTON = 11;
112  QUICK_SCRUB_BUTTON = 12;
113  CLEAR_ALL_BUTTON = 13;
114  CANCEL_TARGET = 14;
115  TASK_PREVIEW = 15;
116  SPLIT_SCREEN_TARGET = 16;
117  REMOTE_ACTION_SHORTCUT = 17;
118  APP_USAGE_SETTINGS = 18;
119  BACK_GESTURE = 19;
120  UNDO = 20;
121  DISMISS_PREDICTION = 21;
122}
123
124enum TipType {
125  DEFAULT_NONE = 0;
126  BOUNCE = 1;
127  SWIPE_UP_TEXT = 2;
128  QUICK_SCRUB_TEXT = 3;
129  PREDICTION_TEXT = 4;
130  DWB_TOAST = 5;
131}
132
133// Used to define the action component of the LauncherEvent.
134message Action {
135  enum Type {
136    TOUCH = 0;
137    AUTOMATED = 1;
138    COMMAND = 2;
139    TIP = 3;
140    SOFT_KEYBOARD = 4;
141    // HARD_KEYBOARD, ASSIST
142  }
143
144  enum Touch {
145    TAP = 0;
146    LONGPRESS = 1;
147    DRAGDROP = 2;
148    SWIPE = 3;
149    FLING = 4;
150    PINCH = 5;
151    SWIPE_NOOP = 6;
152  }
153
154  enum Direction {
155    NONE = 0;
156    UP = 1;
157    DOWN = 2;
158    LEFT = 3;
159    RIGHT = 4;
160    UPRIGHT = 5;
161    UPLEFT = 6;
162  }
163  enum Command {
164    HOME_INTENT = 0;
165    BACK = 1;
166    ENTRY = 2;          // Indicates entry to one of Launcher container type target
167                        // not using the HOME_INTENT
168    CANCEL = 3;         // Indicates that a confirmation screen was cancelled
169    CONFIRM = 4;        // Indicates thata confirmation screen was accepted
170    STOP = 5;           // Indicates onStop() was called (screen time out, power off)
171    RECENTS_BUTTON = 6; // Indicates that Recents button was pressed
172    RESUME = 7;         // Indicates onResume() was called
173  }
174
175  optional Type type = 1;
176  optional Touch touch = 2;
177  optional Direction dir = 3;
178  optional Command command = 4;
179  // Log if the action was performed on outside of the container
180  optional bool is_outside = 5;
181  optional bool is_state_change = 6;
182}
183
184//
185// Context free grammar of typical user interaction:
186//         Action (Touch) + Target
187//         Action (Touch) + Target + Target
188//
189message LauncherEvent {
190  required Action action = 1;
191  // List of targets that touch actions can be operated on.
192  repeated Target src_target = 2;
193  repeated Target dest_target = 3;
194
195  optional int64 action_duration_millis = 4;
196  optional int64 elapsed_container_millis = 5;
197  optional int64 elapsed_session_millis = 6;
198
199  optional bool is_in_multi_window_mode = 7 [deprecated = true];
200  optional bool is_in_landscape_mode = 8 [deprecated = true];
201
202  optional LauncherEventExtension extension = 9;
203}
204