summaryrefslogtreecommitdiffstats
path: root/protos/launcher_log.proto
blob: 06e6a923d4b1146c76c407ce21b311885b3dc3ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
syntax = "proto2";

import "launcher_log_extension.proto";

option java_package = "com.android.launcher3.userevent";
option java_outer_classname = "LauncherLogProto";

package userevent;

message Target {
  enum Type {
    NONE = 0;
    ITEM = 1;
    CONTROL = 2;
    CONTAINER = 3;
  }

  optional Type type = 1;

  // For container type and item type
  // Used mainly for ContainerType.FOLDER, ItemType.*
  optional int32 page_index = 2;
  optional int32 rank = 3;
  optional int32 grid_x = 4;
  optional int32 grid_y = 5;

  // For container types only
  optional ContainerType container_type = 6;
  optional int32 cardinality = 7;

  // For control types only
  optional ControlType control_type = 8;

  // For item types only
  optional ItemType item_type = 9;
  optional int32 package_name_hash = 10;
  optional int32 component_hash = 11;      // Used for ItemType.WIDGET
  optional int32 intent_hash = 12;         // Used for ItemType.SHORTCUT
  optional int32 span_x = 13 [default = 1];// Used for ItemType.WIDGET
  optional int32 span_y = 14 [default = 1];// Used for ItemType.WIDGET
  optional int32 predictedRank = 15;
  optional TargetExtension extension = 16;
  optional TipType tip_type = 17;
}

// Used to define what type of item a Target would represent.
enum ItemType {
  DEFAULT_ITEMTYPE = 0;
  APP_ICON = 1;
  SHORTCUT = 2;
  WIDGET = 3;
  FOLDER_ICON = 4;
  DEEPSHORTCUT = 5;
  SEARCHBOX = 6;
  EDITTEXT = 7;
  NOTIFICATION = 8;
  TASK = 9;         // Each page of Recents UI (QuickStep)
  WEB_APP = 10;
}

// Used to define what type of container a Target would represent.
enum ContainerType {
  DEFAULT_CONTAINERTYPE = 0;
  WORKSPACE = 1;
  HOTSEAT = 2;
  FOLDER = 3;
  ALLAPPS = 4;
  WIDGETS = 5;
  OVERVIEW = 6;   // Zoomed out workspace (without QuickStep)
  PREDICTION = 7;
  SEARCHRESULT = 8;
  DEEPSHORTCUTS = 9;
  PINITEM = 10;    // confirmation screen
  NAVBAR = 11;
  TASKSWITCHER = 12; // Recents UI Container (QuickStep)
  APP = 13; // Foreground activity is another app (QuickStep)
  TIP = 14; // Onboarding texts (QuickStep)
  SIDELOADED_LAUNCHER = 15;
}

// Used to define what type of control a Target would represent.
enum ControlType {
  DEFAULT_CONTROLTYPE = 0;
  ALL_APPS_BUTTON = 1;
  WIDGETS_BUTTON = 2;
  WALLPAPER_BUTTON = 3;
  SETTINGS_BUTTON = 4;
  REMOVE_TARGET = 5;
  UNINSTALL_TARGET = 6;
  APPINFO_TARGET = 7;
  RESIZE_HANDLE = 8;
  VERTICAL_SCROLL = 9;
  HOME_INTENT = 10; // Deprecated, use enum Command instead
  BACK_BUTTON = 11; // Deprecated, use enum Command instead
  QUICK_SCRUB_BUTTON = 12;
  CLEAR_ALL_BUTTON = 13;
  CANCEL_TARGET = 14;
  TASK_PREVIEW = 15;
  SPLIT_SCREEN_TARGET = 16;
}

enum TipType {
  DEFAULT_NONE = 0;
  BOUNCE = 1;
  SWIPE_UP_TEXT = 2;
  QUICK_SCRUB_TEXT = 3;
  PREDICTION_TEXT = 4;
}

// Used to define the action component of the LauncherEvent.
message Action {
  enum Type {
    TOUCH = 0;
    AUTOMATED = 1;
    COMMAND = 2;
    TIP = 3;
    // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST
  }

  enum Touch {
    TAP = 0;
    LONGPRESS = 1;
    DRAGDROP = 2;
    SWIPE = 3;
    FLING = 4;
    PINCH = 5;
  }

  enum Direction {
    NONE = 0;
    UP = 1;
    DOWN = 2;
    LEFT = 3;
    RIGHT = 4;
  }
  enum Command {
    HOME_INTENT = 0;
    BACK = 1;
    ENTRY = 2;          // Indicates entry to one of Launcher container type target
                        // not using the HOME_INTENT
    CANCEL = 3;         // Indicates that a confirmation screen was cancelled
    CONFIRM = 4;        // Indicates thata confirmation screen was accepted
    STOP = 5;           // Indicates onStop() was called (screen time out, power off)
    RECENTS_BUTTON = 6; // Indicates that Recents button was pressed
    RESUME = 7;         // Indicates onResume() was called
  }

  optional Type type = 1;
  optional Touch touch = 2;
  optional Direction dir = 3;
  optional Command command = 4;
  // Log if the action was performed on outside of the container
  optional bool is_outside = 5;
  optional bool is_state_change = 6;
}

//
// Context free grammar of typical user interaction:
//         Action (Touch) + Target
//         Action (Touch) + Target + Target
//
message LauncherEvent {
  required Action action = 1;
  // List of targets that touch actions can be operated on.
  repeated Target src_target = 2;
  repeated Target dest_target = 3;

  optional int64 action_duration_millis = 4;
  optional int64 elapsed_container_millis = 5;
  optional int64 elapsed_session_millis = 6;

  optional bool is_in_multi_window_mode = 7;
  optional bool is_in_landscape_mode = 8;

  optional LauncherEventExtension extension = 9;
}