blob: 02c6b0f419f1aadeb22125b7466e718217008416 [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 Song018eec62018-05-09 16:18:58 -070058 optional TipType tip_type = 17;
Hyunyoung Song726eb822016-03-07 10:07:35 -080059}
60
Hyunyoung Songddec1c72016-04-12 18:32:04 -070061// Used to define what type of item a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -080062enum ItemType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -070063 DEFAULT_ITEMTYPE = 0;
64 APP_ICON = 1;
65 SHORTCUT = 2;
66 WIDGET = 3;
67 FOLDER_ICON = 4;
Hyunyoung Song5aa27142016-07-21 11:48:37 -070068 DEEPSHORTCUT = 5;
Hyunyoung Songffad9622016-09-27 18:07:00 -070069 SEARCHBOX = 6;
Jon Mirandafeba90f2016-10-06 10:53:29 -070070 EDITTEXT = 7;
Tony Wickhamc6b79e32017-02-01 09:13:24 -080071 NOTIFICATION = 8;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -080072 TASK = 9; // Each page of Recents UI (QuickStep)
Mario Bertschlerd2e3c5d2018-03-29 21:12:12 +020073 WEB_APP = 10;
Hyunyoung Songfd94cd52019-04-25 11:20:42 -070074 TASK_ICON = 11;
Hyunyoung Song726eb822016-03-07 10:07:35 -080075}
76
Hyunyoung Songddec1c72016-04-12 18:32:04 -070077// Used to define what type of container a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -080078enum ContainerType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -070079 DEFAULT_CONTAINERTYPE = 0;
80 WORKSPACE = 1;
81 HOTSEAT = 2;
82 FOLDER = 3;
83 ALLAPPS = 4;
84 WIDGETS = 5;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -080085 OVERVIEW = 6; // Zoomed out workspace (without QuickStep)
Hyunyoung Songddec1c72016-04-12 18:32:04 -070086 PREDICTION = 7;
87 SEARCHRESULT = 8;
Hyunyoung Song5aa27142016-07-21 11:48:37 -070088 DEEPSHORTCUTS = 9;
Sunny Goyal778634c2017-03-21 11:59:04 -070089 PINITEM = 10; // confirmation screen
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -080090 NAVBAR = 11;
91 TASKSWITCHER = 12; // Recents UI Container (QuickStep)
92 APP = 13; // Foreground activity is another app (QuickStep)
Hyunyoung Song018eec62018-05-09 16:18:58 -070093 TIP = 14; // Onboarding texts (QuickStep)
Vadim Tryshevd0788022018-05-15 14:05:47 -070094 SIDELOADED_LAUNCHER = 15;
Hyunyoung Song726eb822016-03-07 10:07:35 -080095}
96
Hyunyoung Songddec1c72016-04-12 18:32:04 -070097// Used to define what type of control a Target would represent.
Hyunyoung Song726eb822016-03-07 10:07:35 -080098enum ControlType {
Hyunyoung Songddec1c72016-04-12 18:32:04 -070099 DEFAULT_CONTROLTYPE = 0;
100 ALL_APPS_BUTTON = 1;
101 WIDGETS_BUTTON = 2;
102 WALLPAPER_BUTTON = 3;
103 SETTINGS_BUTTON = 4;
104 REMOVE_TARGET = 5;
105 UNINSTALL_TARGET = 6;
106 APPINFO_TARGET = 7;
107 RESIZE_HANDLE = 8;
108 VERTICAL_SCROLL = 9;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700109 HOME_INTENT = 10; // Deprecated, use enum Command instead
Winson Chung41d58f72019-04-02 15:09:36 -0700110 BACK_BUTTON = 11;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -0800111 QUICK_SCRUB_BUTTON = 12;
Hyunyoung Song63311a22018-04-27 15:50:44 -0700112 CLEAR_ALL_BUTTON = 13;
Mehdi Alizadehbda47cf2018-05-01 19:26:05 -0700113 CANCEL_TARGET = 14;
Hyunyoung Songde184a22018-05-24 13:05:50 -0700114 TASK_PREVIEW = 15;
115 SPLIT_SCREEN_TARGET = 16;
Vadim Tryshevdc7d25d2018-10-15 14:01:04 -0700116 REMOTE_ACTION_SHORTCUT = 17;
Vadim Tryshev3514a222018-10-03 16:34:41 -0700117 APP_USAGE_SETTINGS = 18;
Winson Chung41d58f72019-04-02 15:09:36 -0700118 BACK_GESTURE = 19;
Hyunyoung Songfd94cd52019-04-25 11:20:42 -0700119 UNDO = 20;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800120}
121
Hyunyoung Song018eec62018-05-09 16:18:58 -0700122enum TipType {
123 DEFAULT_NONE = 0;
124 BOUNCE = 1;
125 SWIPE_UP_TEXT = 2;
126 QUICK_SCRUB_TEXT = 3;
127 PREDICTION_TEXT = 4;
vadimtc28aa1a2019-03-11 17:49:01 -0700128 DWB_TOAST = 5;
Hyunyoung Song018eec62018-05-09 16:18:58 -0700129}
130
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700131// Used to define the action component of the LauncherEvent.
Hyunyoung Song726eb822016-03-07 10:07:35 -0800132message Action {
133 enum Type {
134 TOUCH = 0;
135 AUTOMATED = 1;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700136 COMMAND = 2;
Hyunyoung Song018eec62018-05-09 16:18:58 -0700137 TIP = 3;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800138 // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST
139 }
Hyunyoung Song018eec62018-05-09 16:18:58 -0700140
Hyunyoung Song726eb822016-03-07 10:07:35 -0800141 enum Touch {
142 TAP = 0;
143 LONGPRESS = 1;
144 DRAGDROP = 2;
145 SWIPE = 3;
146 FLING = 4;
147 PINCH = 5;
Hyunyoung Songebc5f822019-04-03 12:28:01 -0700148 SWIPE_NOOP = 6;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800149 }
Hyunyoung Song018eec62018-05-09 16:18:58 -0700150
151 enum Direction {
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700152 NONE = 0;
153 UP = 1;
154 DOWN = 2;
155 LEFT = 3;
156 RIGHT = 4;
Hyunyoung Songebc5f822019-04-03 12:28:01 -0700157 UPRIGHT = 5;
158 UPLEFT = 6;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700159 }
Jon Mirandafeba90f2016-10-06 10:53:29 -0700160 enum Command {
161 HOME_INTENT = 0;
162 BACK = 1;
Vadim Tryshevd0788022018-05-15 14:05:47 -0700163 ENTRY = 2; // Indicates entry to one of Launcher container type target
164 // not using the HOME_INTENT
165 CANCEL = 3; // Indicates that a confirmation screen was cancelled
166 CONFIRM = 4; // Indicates thata confirmation screen was accepted
167 STOP = 5; // Indicates onStop() was called (screen time out, power off)
168 RECENTS_BUTTON = 6; // Indicates that Recents button was pressed
Hyunyoung Songbd6fba92018-05-16 15:54:31 -0700169 RESUME = 7; // Indicates onResume() was called
Jon Mirandafeba90f2016-10-06 10:53:29 -0700170 }
Hyunyoung Song7fb3ccc2017-10-17 15:39:46 -0700171
Hyunyoung Song726eb822016-03-07 10:07:35 -0800172 optional Type type = 1;
173 optional Touch touch = 2;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700174 optional Direction dir = 3;
Jon Mirandafeba90f2016-10-06 10:53:29 -0700175 optional Command command = 4;
176 // Log if the action was performed on outside of the container
177 optional bool is_outside = 5;
Hyunyoung Songb3fbc0b2018-02-14 13:40:25 -0800178 optional bool is_state_change = 6;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800179}
180
181//
182// Context free grammar of typical user interaction:
183// Action (Touch) + Target
184// Action (Touch) + Target + Target
185//
186message LauncherEvent {
Hyunyoung Song726eb822016-03-07 10:07:35 -0800187 required Action action = 1;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800188 // List of targets that touch actions can be operated on.
Hyunyoung Songddec1c72016-04-12 18:32:04 -0700189 repeated Target src_target = 2;
190 repeated Target dest_target = 3;
Hyunyoung Song726eb822016-03-07 10:07:35 -0800191
192 optional int64 action_duration_millis = 4;
193 optional int64 elapsed_container_millis = 5;
194 optional int64 elapsed_session_millis = 6;
Jon Mirandafe964322017-03-22 10:25:17 -0700195
Hyunyoung Song956ec4b2018-07-02 13:17:32 -0700196 optional bool is_in_multi_window_mode = 7 [deprecated = true];
197 optional bool is_in_landscape_mode = 8 [deprecated = true];
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700198
199 optional LauncherEventExtension extension = 9;
Hyunyoung Song5aa27142016-07-21 11:48:37 -0700200}