launcher_log.proto 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. }
  50. // Used to define what type of item a Target would represent.
  51. enum ItemType {
  52. DEFAULT_ITEMTYPE = 0;
  53. APP_ICON = 1;
  54. SHORTCUT = 2;
  55. WIDGET = 3;
  56. FOLDER_ICON = 4;
  57. DEEPSHORTCUT = 5;
  58. SEARCHBOX = 6;
  59. EDITTEXT = 7;
  60. NOTIFICATION = 8;
  61. }
  62. // Used to define what type of container a Target would represent.
  63. enum ContainerType {
  64. DEFAULT_CONTAINERTYPE = 0;
  65. WORKSPACE = 1;
  66. HOTSEAT = 2;
  67. FOLDER = 3;
  68. ALLAPPS = 4;
  69. WIDGETS = 5;
  70. OVERVIEW = 6;
  71. PREDICTION = 7;
  72. SEARCHRESULT = 8;
  73. DEEPSHORTCUTS = 9;
  74. PINITEM = 10; // confirmation screen
  75. }
  76. // Used to define what type of control a Target would represent.
  77. enum ControlType {
  78. DEFAULT_CONTROLTYPE = 0;
  79. ALL_APPS_BUTTON = 1;
  80. WIDGETS_BUTTON = 2;
  81. WALLPAPER_BUTTON = 3;
  82. SETTINGS_BUTTON = 4;
  83. REMOVE_TARGET = 5;
  84. UNINSTALL_TARGET = 6;
  85. APPINFO_TARGET = 7;
  86. RESIZE_HANDLE = 8;
  87. VERTICAL_SCROLL = 9;
  88. HOME_INTENT = 10; // Deprecated, use enum Command instead
  89. BACK_BUTTON = 11; // Deprecated, use enum Command instead
  90. // GO_TO_PLAYSTORE
  91. }
  92. // Used to define the action component of the LauncherEvent.
  93. message Action {
  94. enum Type {
  95. TOUCH = 0;
  96. AUTOMATED = 1;
  97. COMMAND = 2;
  98. // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST
  99. }
  100. enum Touch {
  101. TAP = 0;
  102. LONGPRESS = 1;
  103. DRAGDROP = 2;
  104. SWIPE = 3;
  105. FLING = 4;
  106. PINCH = 5;
  107. }
  108. enum Direction {
  109. NONE = 0;
  110. UP = 1;
  111. DOWN = 2;
  112. LEFT = 3;
  113. RIGHT = 4;
  114. }
  115. enum Command {
  116. HOME_INTENT = 0;
  117. BACK = 1;
  118. ENTRY = 2; // Indicates entry to one of Launcher container type target
  119. // not using the HOME_INTENT
  120. CANCEL = 3; // Indicates that a confirmation screen was cancelled
  121. CONFIRM = 4; // Indicates thata confirmation screen was accepted
  122. }
  123. optional Type type = 1;
  124. optional Touch touch = 2;
  125. optional Direction dir = 3;
  126. optional Command command = 4;
  127. // Log if the action was performed on outside of the container
  128. optional bool is_outside = 5;
  129. }
  130. //
  131. // Context free grammar of typical user interaction:
  132. // Action (Touch) + Target
  133. // Action (Touch) + Target + Target
  134. //
  135. message LauncherEvent {
  136. required Action action = 1;
  137. // List of targets that touch actions can be operated on.
  138. repeated Target src_target = 2;
  139. repeated Target dest_target = 3;
  140. optional int64 action_duration_millis = 4;
  141. optional int64 elapsed_container_millis = 5;
  142. optional int64 elapsed_session_millis = 6;
  143. optional bool is_in_multi_window_mode = 7;
  144. optional bool is_in_landscape_mode = 8;
  145. optional LauncherEventExtension extension = 9;
  146. }