launcher_atom.proto 12 KB

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