launcher_log.proto 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. option java_package = "com.android.launcher3.userevent";
  18. option java_outer_classname = "LauncherLogProto";
  19. package userevent;
  20. message Target {
  21. enum Type {
  22. NONE = 0;
  23. ITEM = 1;
  24. CONTROL = 2;
  25. CONTAINER = 3;
  26. }
  27. optional Type type = 1;
  28. // For container type and item type
  29. // Used mainly for ContainerType.FOLDER, ItemType.*
  30. optional int32 page_index = 2;
  31. optional int32 rank = 3;
  32. optional int32 grid_x = 4;
  33. optional int32 grid_y = 5;
  34. // For container types only
  35. optional ContainerType container_type = 6;
  36. optional int32 cardinality = 7;
  37. // For control types only
  38. optional ControlType control_type = 8;
  39. // For item types only
  40. optional ItemType item_type = 9;
  41. optional int32 package_name_hash = 10;
  42. optional int32 component_hash = 11; // Used for ItemType.WIDGET
  43. optional int32 intent_hash = 12; // Used for ItemType.SHORTCUT
  44. optional int32 span_x = 13 [default = 1];// Used for ItemType.WIDGET
  45. optional int32 span_y = 14 [default = 1];// Used for ItemType.WIDGET
  46. optional int32 predictedRank = 15;
  47. }
  48. // Used to define what type of item a Target would represent.
  49. enum ItemType {
  50. DEFAULT_ITEMTYPE = 0;
  51. APP_ICON = 1;
  52. SHORTCUT = 2;
  53. WIDGET = 3;
  54. FOLDER_ICON = 4;
  55. DEEPSHORTCUT = 5;
  56. SEARCHBOX = 6;
  57. EDITTEXT = 7;
  58. NOTIFICATION = 8;
  59. }
  60. // Used to define what type of container a Target would represent.
  61. enum ContainerType {
  62. DEFAULT_CONTAINERTYPE = 0;
  63. WORKSPACE = 1;
  64. HOTSEAT = 2;
  65. FOLDER = 3;
  66. ALLAPPS = 4;
  67. WIDGETS = 5;
  68. OVERVIEW = 6;
  69. PREDICTION = 7;
  70. SEARCHRESULT = 8;
  71. DEEPSHORTCUTS = 9;
  72. PINITEM = 10; // confirmation screen
  73. }
  74. // Used to define what type of control a Target would represent.
  75. enum ControlType {
  76. DEFAULT_CONTROLTYPE = 0;
  77. ALL_APPS_BUTTON = 1;
  78. WIDGETS_BUTTON = 2;
  79. WALLPAPER_BUTTON = 3;
  80. SETTINGS_BUTTON = 4;
  81. REMOVE_TARGET = 5;
  82. UNINSTALL_TARGET = 6;
  83. APPINFO_TARGET = 7;
  84. RESIZE_HANDLE = 8;
  85. VERTICAL_SCROLL = 9;
  86. HOME_INTENT = 10; // Deprecated, use enum Command instead
  87. BACK_BUTTON = 11; // Deprecated, use enum Command instead
  88. // GO_TO_PLAYSTORE
  89. }
  90. // Used to define the action component of the LauncherEvent.
  91. message Action {
  92. enum Type {
  93. TOUCH = 0;
  94. AUTOMATED = 1;
  95. COMMAND = 2;
  96. // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST
  97. }
  98. enum Touch {
  99. TAP = 0;
  100. LONGPRESS = 1;
  101. DRAGDROP = 2;
  102. SWIPE = 3;
  103. FLING = 4;
  104. PINCH = 5;
  105. }
  106. enum Direction {
  107. NONE = 0;
  108. UP = 1;
  109. DOWN = 2;
  110. LEFT = 3;
  111. RIGHT = 4;
  112. }
  113. enum Command {
  114. HOME_INTENT = 0;
  115. BACK = 1;
  116. ENTRY = 2; // Indicates entry to one of Launcher container type target
  117. // not using the HOME_INTENT
  118. CANCEL = 3; // Indicates that a confirmation screen was cancelled
  119. CONFIRM = 4; // Indicates thata confirmation screen was accepted
  120. }
  121. optional Type type = 1;
  122. optional Touch touch = 2;
  123. optional Direction dir = 3;
  124. optional Command command = 4;
  125. // Log if the action was performed on outside of the container
  126. optional bool is_outside = 5;
  127. }
  128. //
  129. // Context free grammar of typical user interaction:
  130. // Action (Touch) + Target
  131. // Action (Touch) + Target + Target
  132. //
  133. message LauncherEvent {
  134. required Action action = 1;
  135. // List of targets that touch actions can be operated on.
  136. repeated Target src_target = 2;
  137. repeated Target dest_target = 3;
  138. optional int64 action_duration_millis = 4;
  139. optional int64 elapsed_container_millis = 5;
  140. optional int64 elapsed_session_millis = 6;
  141. optional bool is_in_multi_window_mode = 7;
  142. optional bool is_in_landscape_mode = 8;
  143. }