launcher_log.proto 5.3 KB

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