launcher_atom.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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 51
  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_PLAY_GMS = 44;
  147. ALL_APPS_SEARCH_RESULT_FALLBACK = 22;
  148. ALL_APPS_SEARCH_RESULT_SUGGEST = 22 [deprecated = true];
  149. ALL_APPS_SEARCH_RESULT_ASSISTANT = 23;
  150. ALL_APPS_SEARCH_RESULT_CHROMETAB = 24;
  151. ALL_APPS_SEARCH_RESULT_NAVVYSITE = 25 [deprecated = true];
  152. ALL_APPS_SEARCH_RESULT_TIPS = 26;
  153. ALL_APPS_SEARCH_RESULT_PEOPLE_TILE = 27;
  154. ALL_APPS_SEARCH_RESULT_LEGACY_SHORTCUT = 30;
  155. ALL_APPS_SEARCH_RESULT_ASSISTANT_MEMORY = 31;
  156. ALL_APPS_SEARCH_RESULT_VIDEO = 41;
  157. ALL_APPS_SEARCH_RESULT_SYSTEM_POINTER = 42;
  158. ALL_APPS_SEARCH_RESULT_EDUCARD = 43;
  159. ALL_APPS_SEARCH_RESULT_LOCATION = 50;
  160. // Result sources
  161. DATA_SOURCE_APPSEARCH_APP_PREVIEW = 45;
  162. DATA_SOURCE_APPSEARCH_APP_SRP_PREVIEW = 46;
  163. DATA_SOURCE_APPSEARCH_CATEGORY_SRP_PREVIEW = 48;
  164. DATA_SOURCE_APPSEARCH_ENTITY_SRP_PREVIEW = 49;
  165. DATA_SOURCE_AIAI_SEARCH_ROOT = 47;
  166. // Web suggestions provided by AGA
  167. ALL_APPS_SEARCH_RESULT_WEB_SUGGEST = 39;
  168. // Suggestion Type provided by AGA
  169. WEB_SEARCH_RESULT_QUERY = 32;
  170. WEB_SEARCH_RESULT_TRENDING = 33;
  171. WEB_SEARCH_RESULT_ENTITY = 34;
  172. WEB_SEARCH_RESULT_ANSWER = 35;
  173. WEB_SEARCH_RESULT_PERSONAL = 36;
  174. WEB_SEARCH_RESULT_CALCULATOR = 37;
  175. WEB_SEARCH_RESULT_URL = 38;
  176. WEB_SEARCH_RESULT_RICH_ANSWER = 40;
  177. WIDGETS_BOTTOM_TRAY = 28;
  178. WIDGETS_TRAY_PREDICTION = 29;
  179. }
  180. // Main app icons
  181. message Application {
  182. optional string package_name = 1;
  183. optional string component_name = 2;
  184. }
  185. // Legacy shortcuts and shortcuts handled by ShortcutManager
  186. message Shortcut {
  187. optional string shortcut_name = 1;
  188. optional string shortcut_id = 2;
  189. }
  190. // AppWidgets handled by AppWidgetManager
  191. message Widget {
  192. optional int32 span_x = 1 [default = 1];
  193. optional int32 span_y = 2 [default = 1];
  194. optional int32 app_widget_id = 3;
  195. optional string package_name = 4; // only populated during snapshot if from workspace
  196. optional string component_name = 5; // only populated during snapshot if from workspace
  197. optional int32 widget_features = 6;
  198. }
  199. // Tasks handled by PackageManager
  200. message Task {
  201. optional string package_name = 1;
  202. optional string component_name = 2;
  203. optional int32 index = 3;
  204. }
  205. // Represents folder in a closed state.
  206. message FolderIcon {
  207. // Number of items inside folder.
  208. optional int32 cardinality = 1;
  209. // State of the folder label before the event.
  210. optional FromState from_label_state = 2;
  211. // State of the folder label after the event.
  212. optional ToState to_label_state = 3;
  213. // Details about actual folder label.
  214. // Populated when folder label is not a PII.
  215. optional string label_info = 4;
  216. }
  217. // Contains Slice details for logging.
  218. message Slice{
  219. optional string uri = 1;
  220. }
  221. // Represents SearchAction with in launcher
  222. message SearchActionItem{
  223. optional string package_name = 1;
  224. optional string title = 2;
  225. }
  226. //////////////////////////////////////////////
  227. // Containers
  228. message WorkspaceContainer {
  229. optional int32 page_index = 1 [default = -2]; // range [-1, l], 0 is the index of the main homescreen
  230. optional int32 grid_x = 2 [default = -1]; // [0, m], m varies based on the display density and resolution
  231. optional int32 grid_y = 3 [default = -1]; // [0, n], n varies based on the display density and resolution
  232. }
  233. message HotseatContainer {
  234. optional int32 index = 1;
  235. }
  236. // Represents hotseat container with prediction feature enabled.
  237. message PredictedHotseatContainer {
  238. optional int32 index = 1;
  239. // No of hotseat positions filled with predicted items.
  240. optional int32 cardinality = 2;
  241. }
  242. message FolderContainer {
  243. optional int32 page_index = 1 [default = -1];
  244. optional int32 grid_x = 2 [default = -1];
  245. optional int32 grid_y = 3 [default = -1];
  246. oneof ParentContainer {
  247. WorkspaceContainer workspace = 4;
  248. HotseatContainer hotseat = 5;
  249. TaskBarContainer taskbar = 6;
  250. }
  251. }
  252. // Represents wallpapers container for quick switching.
  253. message WallpapersContainer {
  254. // Number of wallpapers in the container.
  255. optional int32 cardinality = 1;
  256. }
  257. // Represents state of EditText field before update.
  258. enum FromState {
  259. // Default value.
  260. // Used when a FromState is not applicable, for example, during folder creation.
  261. FROM_STATE_UNSPECIFIED = 0;
  262. // EditText was empty.
  263. // Eg: When a folder label is updated from empty string.
  264. FROM_EMPTY = 1;
  265. // EditText was non-empty and manually entered by the user.
  266. // Eg: When a folder label is updated from a user-entered value.
  267. FROM_CUSTOM = 2;
  268. // EditText was non-empty and one of the suggestions.
  269. // Eg: When a folder label is updated from a suggested value.
  270. FROM_SUGGESTED = 3;
  271. }
  272. // Represents state of EditText field after update.
  273. enum ToState {
  274. // Default value.
  275. // Used when ToState is not applicable, for example, when folder label is updated to a different
  276. // value when folder label suggestion feature is disabled.
  277. TO_STATE_UNSPECIFIED = 0;
  278. // User attempted to change the EditText, but was not changed.
  279. UNCHANGED = 1;
  280. // New label matches with primary(aka top) suggestion.
  281. TO_SUGGESTION0 = 2;
  282. // New value matches with second top suggestion even though the top suggestion was non-empty.
  283. TO_SUGGESTION1_WITH_VALID_PRIMARY = 3;
  284. // New value matches with second top suggestion given that top suggestion was empty.
  285. TO_SUGGESTION1_WITH_EMPTY_PRIMARY = 4;
  286. // New value matches with third top suggestion even though the top suggestion was non-empty.
  287. TO_SUGGESTION2_WITH_VALID_PRIMARY = 5;
  288. // New value matches with third top suggestion given that top suggestion was empty.
  289. TO_SUGGESTION2_WITH_EMPTY_PRIMARY = 6;
  290. // New value matches with 4th top suggestion even though the top suggestion was non-empty.
  291. TO_SUGGESTION3_WITH_VALID_PRIMARY = 7;
  292. // New value matches with 4th top suggestion given that top suggestion was empty.
  293. TO_SUGGESTION3_WITH_EMPTY_PRIMARY = 8;
  294. // New value is empty even though the top suggestion was non-empty.
  295. TO_EMPTY_WITH_VALID_PRIMARY = 9;
  296. // New value is empty given that top suggestion was empty.
  297. TO_EMPTY_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 10;
  298. // New value is empty given that no suggestions were provided.
  299. TO_EMPTY_WITH_EMPTY_SUGGESTIONS = 11;
  300. // New value is empty given that suggestions feature was disabled.
  301. TO_EMPTY_WITH_SUGGESTIONS_DISABLED = 12;
  302. // New value is non-empty and does not match with any of the suggestions even though the top suggestion was non-empty.
  303. TO_CUSTOM_WITH_VALID_PRIMARY = 13;
  304. // New value is non-empty and not match with any suggestions given that top suggestion was empty.
  305. TO_CUSTOM_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 14;
  306. // New value is non-empty and also no suggestions were provided.
  307. TO_CUSTOM_WITH_EMPTY_SUGGESTIONS = 15;
  308. // New value is non-empty and also suggestions feature was disable.
  309. TO_CUSTOM_WITH_SUGGESTIONS_DISABLED = 16;
  310. }