launcher_atom.proto 11 KB

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