launcher_atom.proto 9.1 KB

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