launcher_atom.proto 10 KB

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