launcher_log.proto 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. */
  16. syntax = "proto2";
  17. import "launcher_log_extension.proto";
  18. option java_package = "com.android.launcher3.userevent";
  19. option java_outer_classname = "LauncherLogProto";
  20. package userevent;
  21. message Target {
  22. enum Type {
  23. NONE = 0;
  24. ITEM = 1;
  25. CONTROL = 2;
  26. CONTAINER = 3;
  27. }
  28. optional Type type = 1;
  29. // For container type and item type
  30. // Used mainly for ContainerType.FOLDER, ItemType.*
  31. optional int32 page_index = 2;
  32. optional int32 rank = 3;
  33. optional int32 grid_x = 4;
  34. optional int32 grid_y = 5;
  35. // For container types only
  36. optional ContainerType container_type = 6;
  37. optional int32 cardinality = 7;
  38. // For control types only
  39. optional ControlType control_type = 8;
  40. // For item types only
  41. optional ItemType item_type = 9;
  42. optional int32 package_name_hash = 10;
  43. optional int32 component_hash = 11; // Used for ItemType.WIDGET
  44. optional int32 intent_hash = 12; // Used for ItemType.SHORTCUT
  45. optional int32 span_x = 13 [default = 1];// Used for ItemType.WIDGET
  46. optional int32 span_y = 14 [default = 1];// Used for ItemType.WIDGET
  47. optional int32 predictedRank = 15;
  48. optional TargetExtension extension = 16;
  49. optional TipType tip_type = 17;
  50. optional int32 search_query_length = 18;
  51. optional bool is_work_app = 19;
  52. optional FromFolderLabelState from_folder_label_state = 20;
  53. optional ToFolderLabelState to_folder_label_state = 21;
  54. // Note: proto does not support duplicate enum values, even if they belong to different enum type.
  55. // Hence "FROM" and "TO" prefix added.
  56. enum FromFolderLabelState {
  57. FROM_FOLDER_LABEL_STATE_UNSPECIFIED = 0;
  58. FROM_EMPTY = 1;
  59. FROM_CUSTOM = 2;
  60. FROM_SUGGESTED = 3;
  61. }
  62. enum ToFolderLabelState {
  63. TO_FOLDER_LABEL_STATE_UNSPECIFIED = 0;
  64. TO_SUGGESTION0_WITH_VALID_PRIMARY = 1;
  65. TO_SUGGESTION1_WITH_VALID_PRIMARY = 2;
  66. TO_SUGGESTION1_WITH_EMPTY_PRIMARY = 3;
  67. TO_SUGGESTION2_WITH_VALID_PRIMARY = 4;
  68. TO_SUGGESTION2_WITH_EMPTY_PRIMARY = 5;
  69. TO_SUGGESTION3_WITH_VALID_PRIMARY = 6;
  70. TO_SUGGESTION3_WITH_EMPTY_PRIMARY = 7;
  71. TO_EMPTY_WITH_VALID_SUGGESTIONS = 8 [deprecated = true];
  72. TO_EMPTY_WITH_VALID_PRIMARY = 15;
  73. TO_EMPTY_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 16;
  74. TO_EMPTY_WITH_EMPTY_SUGGESTIONS = 9;
  75. TO_EMPTY_WITH_SUGGESTIONS_DISABLED = 10;
  76. TO_CUSTOM_WITH_VALID_SUGGESTIONS = 11 [deprecated = true];
  77. TO_CUSTOM_WITH_VALID_PRIMARY = 17;
  78. TO_CUSTOM_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 18;
  79. TO_CUSTOM_WITH_EMPTY_SUGGESTIONS = 12;
  80. TO_CUSTOM_WITH_SUGGESTIONS_DISABLED = 13;
  81. UNCHANGED = 14;
  82. }
  83. }
  84. // Used to define what type of item a Target would represent.
  85. enum ItemType {
  86. DEFAULT_ITEMTYPE = 0;
  87. APP_ICON = 1;
  88. SHORTCUT = 2;
  89. WIDGET = 3;
  90. FOLDER_ICON = 4;
  91. DEEPSHORTCUT = 5;
  92. SEARCHBOX = 6;
  93. EDITTEXT = 7;
  94. NOTIFICATION = 8;
  95. TASK = 9; // Each page of Recents UI (QuickStep)
  96. WEB_APP = 10;
  97. TASK_ICON = 11;
  98. }
  99. // Used to define what type of container a Target would represent.
  100. enum ContainerType {
  101. DEFAULT_CONTAINERTYPE = 0;
  102. WORKSPACE = 1;
  103. HOTSEAT = 2;
  104. FOLDER = 3;
  105. ALLAPPS = 4;
  106. WIDGETS = 5;
  107. OVERVIEW = 6; // Zoomed out workspace (without QuickStep)
  108. PREDICTION = 7;
  109. SEARCHRESULT = 8;
  110. DEEPSHORTCUTS = 9;
  111. PINITEM = 10; // confirmation screen
  112. NAVBAR = 11;
  113. TASKSWITCHER = 12; // Recents UI Container (QuickStep)
  114. APP = 13; // Foreground activity is another app (QuickStep)
  115. TIP = 14; // Onboarding texts (QuickStep)
  116. OTHER_LAUNCHER_APP = 15;
  117. }
  118. // Used to define what type of control a Target would represent.
  119. enum ControlType {
  120. DEFAULT_CONTROLTYPE = 0;
  121. ALL_APPS_BUTTON = 1;
  122. WIDGETS_BUTTON = 2;
  123. WALLPAPER_BUTTON = 3;
  124. SETTINGS_BUTTON = 4;
  125. REMOVE_TARGET = 5;
  126. UNINSTALL_TARGET = 6;
  127. APPINFO_TARGET = 7;
  128. RESIZE_HANDLE = 8;
  129. VERTICAL_SCROLL = 9;
  130. HOME_INTENT = 10; // Deprecated, use enum Command instead
  131. BACK_BUTTON = 11;
  132. QUICK_SCRUB_BUTTON = 12;
  133. CLEAR_ALL_BUTTON = 13;
  134. CANCEL_TARGET = 14;
  135. TASK_PREVIEW = 15;
  136. SPLIT_SCREEN_TARGET = 16;
  137. REMOTE_ACTION_SHORTCUT = 17;
  138. APP_USAGE_SETTINGS = 18;
  139. BACK_GESTURE = 19;
  140. UNDO = 20;
  141. DISMISS_PREDICTION = 21;
  142. HYBRID_HOTSEAT_ACCEPTED = 22;
  143. HYBRID_HOTSEAT_CANCELED = 23;
  144. OVERVIEW_ACTIONS_SHARE_BUTTON = 24;
  145. OVERVIEW_ACTIONS_SCREENSHOT_BUTTON = 25;
  146. OVERVIEW_ACTIONS_SELECT_BUTTON = 26;
  147. SELECT_MODE_CLOSE_BUTTON = 27;
  148. SELECT_MODE_ITEM = 28;
  149. }
  150. enum TipType {
  151. DEFAULT_NONE = 0;
  152. BOUNCE = 1;
  153. SWIPE_UP_TEXT = 2;
  154. QUICK_SCRUB_TEXT = 3;
  155. PREDICTION_TEXT = 4;
  156. DWB_TOAST = 5;
  157. HYBRID_HOTSEAT = 6;
  158. }
  159. // Used to define the action component of the LauncherEvent.
  160. message Action {
  161. enum Type {
  162. TOUCH = 0;
  163. AUTOMATED = 1;
  164. COMMAND = 2;
  165. TIP = 3;
  166. SOFT_KEYBOARD = 4;
  167. // HARD_KEYBOARD, ASSIST
  168. }
  169. enum Touch {
  170. TAP = 0;
  171. LONGPRESS = 1;
  172. DRAGDROP = 2;
  173. SWIPE = 3;
  174. FLING = 4;
  175. PINCH = 5;
  176. SWIPE_NOOP = 6;
  177. }
  178. enum Direction {
  179. NONE = 0;
  180. UP = 1;
  181. DOWN = 2;
  182. LEFT = 3;
  183. RIGHT = 4;
  184. UPRIGHT = 5;
  185. UPLEFT = 6;
  186. }
  187. enum Command {
  188. HOME_INTENT = 0;
  189. BACK = 1;
  190. ENTRY = 2; // Indicates entry to one of Launcher container type target
  191. // not using the HOME_INTENT
  192. CANCEL = 3; // Indicates that a confirmation screen was cancelled
  193. CONFIRM = 4; // Indicates thata confirmation screen was accepted
  194. STOP = 5; // Indicates onStop() was called (screen time out, power off)
  195. RECENTS_BUTTON = 6; // Indicates that Recents button was pressed
  196. RESUME = 7; // Indicates onResume() was called
  197. }
  198. optional Type type = 1;
  199. optional Touch touch = 2;
  200. optional Direction dir = 3;
  201. optional Command command = 4;
  202. // Log if the action was performed on outside of the container
  203. optional bool is_outside = 5;
  204. optional bool is_state_change = 6;
  205. }
  206. //
  207. // Context free grammar of typical user interaction:
  208. // Action (Touch) + Target
  209. // Action (Touch) + Target + Target
  210. //
  211. message LauncherEvent {
  212. required Action action = 1;
  213. // List of targets that touch actions can be operated on.
  214. repeated Target src_target = 2;
  215. repeated Target dest_target = 3;
  216. optional int64 action_duration_millis = 4;
  217. optional int64 elapsed_container_millis = 5;
  218. optional int64 elapsed_session_millis = 6;
  219. optional bool is_in_multi_window_mode = 7 [deprecated = true];
  220. optional bool is_in_landscape_mode = 8 [deprecated = true];
  221. optional LauncherEventExtension extension = 9;
  222. }