launcher_log.proto 5.1 KB

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