blob: a7b6429e4269e92f83a6e333fc9783b61911ffbc [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
18option java_package = "com.android.launcher3.userevent.nano";
19option 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.*
35 optional Target parent = 2;
36 optional int32 page_index = 3;
37 optional int32 rank = 4;
38 optional int32 grid_x = 5;
39 optional int32 grid_y = 6;
40
41 // For container types only
42 optional ContainerType container_type = 7;
43 optional int32 cardinality = 8;
44
45 // For control types only
46 optional ControlType control_type = 9;
47
48 // For item types only
49 optional ItemType item_type = 10;
50 optional int32 package_name_hash = 11;
51 optional int32 component_hash = 12; // Used for ItemType.WIDGET
52 optional int32 intent_hash = 13; // Used for ItemType.SHORTCUT
53 optional int32 span_x = 14 [default = 1];// Used for ItemType.WIDGET
54 optional int32 span_y = 15 [default = 1];// Used for ItemType.WIDGET
55}
56
57enum ItemType {
58 APP_ICON = 0;
59 SHORTCUT = 1;
60 WIDGET = 2;
61 FOLDER_ICON = 3;
62}
63
64enum ContainerType {
65 WORKSPACE = 0;
66 HOTSEAT = 1;
67 FOLDER = 2;
68 ALLAPPS = 3;
69 WIDGETS = 4;
70 OVERVIEW = 5;
71 PREDICTION = 6;
72 SEARCHRESULT = 7;
73}
74
75enum ControlType {
76 ALL_APPS_BUTTON = 0;
77 WIDGETS_BUTTON = 1;
78 WALLPAPER_BUTTON = 2;
79 SETTINGS_BUTTON = 3;
80 REMOVE_TARGET = 4;
81 UNINSTALL_TARGET = 5;
82 APPINFO_TARGET = 6;
83 RESIZE_HANDLE = 7;
84 FAST_SCROLL_HANDLE = 8;
85 // HOME, BACK, GO_TO_PLAYSTORE
86}
87
88message Action {
89 enum Type {
90 TOUCH = 0;
91 AUTOMATED = 1;
92 // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST
93 }
94 enum Touch {
95 TAP = 0;
96 LONGPRESS = 1;
97 DRAGDROP = 2;
98 SWIPE = 3;
99 FLING = 4;
100 PINCH = 5;
101 }
102 optional Type type = 1;
103 optional Touch touch = 2;
104}
105
106//
107// Context free grammar of typical user interaction:
108// Action (Touch) + Target
109// Action (Touch) + Target + Target
110//
111message LauncherEvent {
112
113 required Action action = 1;
114
115 // List of targets that touch actions can be operated on.
116 optional Target src_target = 2;
117 optional Target dest_target = 3;
118
119 optional int64 action_duration_millis = 4;
120 optional int64 elapsed_container_millis = 5;
121 optional int64 elapsed_session_millis = 6;
122}