launcher_atom.proto 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. /*
  2. * Copyright (C) 2020 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.logger";
  18. option java_outer_classname = "LauncherAtom";
  19. import "launcher_atom_extension.proto";
  20. //
  21. // ItemInfos
  22. message ItemInfo {
  23. oneof Item {
  24. Application application = 1;
  25. Task task = 2;
  26. Shortcut shortcut = 3;
  27. Widget widget = 4;
  28. FolderIcon folder_icon = 9;
  29. Slice slice = 10;
  30. SearchActionItem search_action_item = 11;
  31. }
  32. // When used for launch event, stores the global predictive rank
  33. optional int32 rank = 5;
  34. // Stores whether the Item belows to non primary user
  35. optional bool is_work = 6;
  36. // Item can be child node to parent container or parent containers (nested)
  37. optional ContainerInfo container_info = 7;
  38. // Stores the origin of the Item
  39. optional Attribute attribute = 8;
  40. }
  41. // Represents various launcher surface where items are placed.
  42. message ContainerInfo {
  43. oneof Container {
  44. WorkspaceContainer workspace = 1;
  45. HotseatContainer hotseat = 2;
  46. FolderContainer folder = 3;
  47. AllAppsContainer all_apps_container = 4;
  48. WidgetsContainer widgets_container = 5;
  49. PredictionContainer prediction_container = 6;
  50. SearchResultContainer search_result_container = 7;
  51. ShortcutsContainer shortcuts_container = 8;
  52. SettingsContainer settings_container = 9;
  53. PredictedHotseatContainer predicted_hotseat_container = 10;
  54. TaskSwitcherContainer task_switcher_container = 11;
  55. ExtendedContainers extended_containers = 20;
  56. }
  57. }
  58. // Represents the apps list sorted alphabetically inside the all-apps view.
  59. message AllAppsContainer {
  60. }
  61. message WidgetsContainer {
  62. }
  63. // Represents the predicted apps row(top row) in the all-apps view.
  64. message PredictionContainer {
  65. }
  66. // Represents the apps container within search results.
  67. message SearchResultContainer {
  68. // Length of search term.
  69. optional int32 query_length = 1;
  70. // Container from where search was invoked.
  71. oneof ParentContainer {
  72. WorkspaceContainer workspace = 2;
  73. AllAppsContainer all_apps_container = 3;
  74. }
  75. }
  76. // Container for package specific shortcuts to deep links and notifications.
  77. // Typically shown as popup window by longpressing on an icon.
  78. message ShortcutsContainer {
  79. }
  80. // Container for generic system shortcuts for launcher specific settings.
  81. // Typically shown up as popup window by longpressing on empty space on workspace.
  82. message SettingsContainer {
  83. }
  84. message TaskSwitcherContainer {
  85. }
  86. enum Attribute {
  87. UNKNOWN = 0;
  88. DEFAULT_LAYOUT = 1; // icon automatically placed in workspace, folder, hotseat
  89. BACKUP_RESTORE = 2; // icon layout restored from backup
  90. PINITEM = 3; // from another app (e.g., Chrome's "Add to Home screen")
  91. ALLAPPS_ATOZ = 4; // within launcher surface, all aps a-z
  92. WIDGETS = 5; // within launcher, widgets tray
  93. ADD_TO_HOMESCREEN = 6; // play install + launcher home setting
  94. ALLAPPS_PREDICTION = 7; // from prediction bar in all apps container
  95. HOTSEAT_PREDICTION = 8; // from prediction bar in hotseat container
  96. // Folder's label is one of the non-empty suggested values.
  97. SUGGESTED_LABEL = 9;
  98. // Folder's label is non-empty, manually entered by the user
  99. // and different from any of suggested values.
  100. MANUAL_LABEL = 10;
  101. // Folder's label is not yet assigned( i.e., title == null).
  102. // Eligible for auto-labeling.
  103. UNLABELED = 11;
  104. // Folder's label is empty(i.e., title == "").
  105. // Not eligible for auto-labeling.
  106. EMPTY_LABEL = 12;
  107. ALL_APPS_SEARCH_RESULT_APPLICATION = 13;
  108. ALL_APPS_SEARCH_RESULT_SHORTCUT = 14;
  109. ALL_APPS_SEARCH_RESULT_PEOPLE = 15;
  110. ALL_APPS_SEARCH_RESULT_ACTION = 16;
  111. ALL_APPS_SEARCH_RESULT_SETTING = 17;
  112. ALL_APPS_SEARCH_RESULT_SCREENSHOT = 18;
  113. ALL_APPS_SEARCH_RESULT_SLICE = 19;
  114. ALL_APPS_SEARCH_RESULT_WIDGETS = 20;
  115. ALL_APPS_SEARCH_RESULT_PLAY = 21;
  116. ALL_APPS_SEARCH_RESULT_SUGGEST = 22;
  117. ALL_APPS_SEARCH_RESULT_ASSISTANT = 23;
  118. ALL_APPS_SEARCH_RESULT_CHROMETAB = 24;
  119. ALL_APPS_SEARCH_RESULT_NAVVYSITE = 25;
  120. ALL_APPS_SEARCH_RESULT_TIPS = 26;
  121. ALL_APPS_SEARCH_RESULT_PEOPLE_TILE = 27;
  122. WIDGETS_BOTTOM_TRAY = 28;
  123. WIDGETS_TRAY_PREDICTION = 29;
  124. }
  125. // Main app icons
  126. message Application {
  127. optional string package_name = 1;
  128. optional string component_name = 2;
  129. }
  130. // Legacy shortcuts and shortcuts handled by ShortcutManager
  131. message Shortcut {
  132. optional string shortcut_name = 1;
  133. optional string shortcut_id = 2;
  134. }
  135. // AppWidgets handled by AppWidgetManager
  136. message Widget {
  137. optional int32 span_x = 1 [default = 1];
  138. optional int32 span_y = 2 [default = 1];
  139. optional int32 app_widget_id = 3;
  140. optional string package_name = 4; // only populated during snapshot if from workspace
  141. optional string component_name = 5; // only populated during snapshot if from workspace
  142. optional int32 widget_features = 6;
  143. }
  144. // Tasks handled by PackageManager
  145. message Task {
  146. optional string package_name = 1;
  147. optional string component_name = 2;
  148. optional int32 index = 3;
  149. }
  150. // Represents folder in a closed state.
  151. message FolderIcon {
  152. // Number of items inside folder.
  153. optional int32 cardinality = 1;
  154. // State of the folder label before the event.
  155. optional FromState from_label_state = 2;
  156. // State of the folder label after the event.
  157. optional ToState to_label_state = 3;
  158. // Details about actual folder label.
  159. // Populated when folder label is not a PII.
  160. optional string label_info = 4;
  161. }
  162. // Contains Slice details for logging.
  163. message Slice{
  164. optional string uri = 1;
  165. }
  166. // Represents SearchAction with in launcher
  167. message SearchActionItem{
  168. optional string package_name = 1;
  169. optional string title = 2;
  170. }
  171. //////////////////////////////////////////////
  172. // Containers
  173. message WorkspaceContainer {
  174. optional int32 page_index = 1 [default = -2]; // range [-1, l], 0 is the index of the main homescreen
  175. optional int32 grid_x = 2 [default = -1]; // [0, m], m varies based on the display density and resolution
  176. optional int32 grid_y = 3 [default = -1]; // [0, n], n varies based on the display density and resolution
  177. }
  178. message HotseatContainer {
  179. optional int32 index = 1;
  180. }
  181. // Represents hotseat container with prediction feature enabled.
  182. message PredictedHotseatContainer {
  183. optional int32 index = 1;
  184. // No of hotseat positions filled with predicted items.
  185. optional int32 cardinality = 2;
  186. }
  187. message FolderContainer {
  188. optional int32 page_index = 1 [default = -1];
  189. optional int32 grid_x = 2 [default = -1];
  190. optional int32 grid_y = 3 [default = -1];
  191. oneof ParentContainer {
  192. WorkspaceContainer workspace = 4;
  193. HotseatContainer hotseat = 5;
  194. }
  195. }
  196. // Represents state of EditText field before update.
  197. enum FromState {
  198. // Default value.
  199. // Used when a FromState is not applicable, for example, during folder creation.
  200. FROM_STATE_UNSPECIFIED = 0;
  201. // EditText was empty.
  202. // Eg: When a folder label is updated from empty string.
  203. FROM_EMPTY = 1;
  204. // EditText was non-empty and manually entered by the user.
  205. // Eg: When a folder label is updated from a user-entered value.
  206. FROM_CUSTOM = 2;
  207. // EditText was non-empty and one of the suggestions.
  208. // Eg: When a folder label is updated from a suggested value.
  209. FROM_SUGGESTED = 3;
  210. }
  211. // Represents state of EditText field after update.
  212. enum ToState {
  213. // Default value.
  214. // Used when ToState is not applicable, for example, when folder label is updated to a different
  215. // value when folder label suggestion feature is disabled.
  216. TO_STATE_UNSPECIFIED = 0;
  217. // User attempted to change the EditText, but was not changed.
  218. UNCHANGED = 1;
  219. // New label matches with primary(aka top) suggestion.
  220. TO_SUGGESTION0 = 2;
  221. // New value matches with second top suggestion even though the top suggestion was non-empty.
  222. TO_SUGGESTION1_WITH_VALID_PRIMARY = 3;
  223. // New value matches with second top suggestion given that top suggestion was empty.
  224. TO_SUGGESTION1_WITH_EMPTY_PRIMARY = 4;
  225. // New value matches with third top suggestion even though the top suggestion was non-empty.
  226. TO_SUGGESTION2_WITH_VALID_PRIMARY = 5;
  227. // New value matches with third top suggestion given that top suggestion was empty.
  228. TO_SUGGESTION2_WITH_EMPTY_PRIMARY = 6;
  229. // New value matches with 4th top suggestion even though the top suggestion was non-empty.
  230. TO_SUGGESTION3_WITH_VALID_PRIMARY = 7;
  231. // New value matches with 4th top suggestion given that top suggestion was empty.
  232. TO_SUGGESTION3_WITH_EMPTY_PRIMARY = 8;
  233. // New value is empty even though the top suggestion was non-empty.
  234. TO_EMPTY_WITH_VALID_PRIMARY = 9;
  235. // New value is empty given that top suggestion was empty.
  236. TO_EMPTY_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 10;
  237. // New value is empty given that no suggestions were provided.
  238. TO_EMPTY_WITH_EMPTY_SUGGESTIONS = 11;
  239. // New value is empty given that suggestions feature was disabled.
  240. TO_EMPTY_WITH_SUGGESTIONS_DISABLED = 12;
  241. // New value is non-empty and does not match with any of the suggestions even though the top suggestion was non-empty.
  242. TO_CUSTOM_WITH_VALID_PRIMARY = 13;
  243. // New value is non-empty and not match with any suggestions given that top suggestion was empty.
  244. TO_CUSTOM_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 14;
  245. // New value is non-empty and also no suggestions were provided.
  246. TO_CUSTOM_WITH_EMPTY_SUGGESTIONS = 15;
  247. // New value is non-empty and also suggestions feature was disable.
  248. TO_CUSTOM_WITH_SUGGESTIONS_DISABLED = 16;
  249. }