launcher_log.proto 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.nano";
  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. }
  58. // Used to define what type of container a Target would represent.
  59. enum ContainerType {
  60. DEFAULT_CONTAINERTYPE = 0;
  61. WORKSPACE = 1;
  62. HOTSEAT = 2;
  63. FOLDER = 3;
  64. ALLAPPS = 4;
  65. WIDGETS = 5;
  66. OVERVIEW = 6;
  67. PREDICTION = 7;
  68. SEARCHRESULT = 8;
  69. DEEPSHORTCUTS = 9;
  70. }
  71. // Used to define what type of control a Target would represent.
  72. enum ControlType {
  73. DEFAULT_CONTROLTYPE = 0;
  74. ALL_APPS_BUTTON = 1;
  75. WIDGETS_BUTTON = 2;
  76. WALLPAPER_BUTTON = 3;
  77. SETTINGS_BUTTON = 4;
  78. REMOVE_TARGET = 5;
  79. UNINSTALL_TARGET = 6;
  80. APPINFO_TARGET = 7;
  81. RESIZE_HANDLE = 8;
  82. VERTICAL_SCROLL = 9;
  83. // HOME, BACK, GO_TO_PLAYSTORE
  84. }
  85. // Used to define the action component of the LauncherEvent.
  86. message Action {
  87. enum Type {
  88. TOUCH = 0;
  89. AUTOMATED = 1;
  90. // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST
  91. }
  92. enum Touch {
  93. TAP = 0;
  94. LONGPRESS = 1;
  95. DRAGDROP = 2;
  96. SWIPE = 3;
  97. FLING = 4;
  98. PINCH = 5;
  99. }
  100. enum Direction {
  101. NONE = 0;
  102. UP = 1;
  103. DOWN = 2;
  104. LEFT = 3;
  105. RIGHT = 4;
  106. }
  107. optional Type type = 1;
  108. optional Touch touch = 2;
  109. optional Direction dir = 3;
  110. }
  111. //
  112. // Context free grammar of typical user interaction:
  113. // Action (Touch) + Target
  114. // Action (Touch) + Target + Target
  115. //
  116. message LauncherEvent {
  117. required Action action = 1;
  118. // List of targets that touch actions can be operated on.
  119. repeated Target src_target = 2;
  120. repeated Target dest_target = 3;
  121. optional int64 action_duration_millis = 4;
  122. optional int64 elapsed_container_millis = 5;
  123. optional int64 elapsed_session_millis = 6;
  124. }