diff --git a/protos/launcher_atom.proto b/protos/launcher_atom.proto new file mode 100644 index 0000000000..561196941c --- /dev/null +++ b/protos/launcher_atom.proto @@ -0,0 +1,272 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +syntax = "proto2"; + +option java_package = "com.android.launcher3.logger"; +option java_outer_classname = "LauncherAtom"; + +// +// ItemInfos +message ItemInfo { + oneof Item { + Application application = 1; + Task task = 2; + Shortcut shortcut = 3; + Widget widget = 4; + FolderIcon folder_icon = 9; + } + // When used for launch event, stores the global predictive rank + optional int32 rank = 5; + + // Stores whether the Item belows to non primary user + optional bool is_work = 6; + + // Item can be child node to parent container or parent containers (nested) + optional ContainerInfo container_info = 7; + + // Stores the origin of the Item + optional Attribute attribute = 8; +} + +// Represents various launcher surface where items are placed. +message ContainerInfo { + oneof Container { + WorkspaceContainer workspace = 1; + HotseatContainer hotseat = 2; + FolderContainer folder = 3; + AllAppsContainer all_apps_container = 4; + WidgetsContainer widgets_container = 5; + PredictionContainer prediction_container = 6; + SearchResultContainer search_result_container = 7; + ShortcutsContainer shortcuts_container = 8; + SettingsContainer settings_container = 9; + PredictedHotseatContainer predicted_hotseat_container = 10; + TaskSwitcherContainer task_switcher_container = 11; + } +} + +// Represents the apps list sorted alphabetically inside the all-apps view. +message AllAppsContainer { +} + +message WidgetsContainer { +} + +// Represents the predicted apps row(top row) in the all-apps view. +message PredictionContainer { +} + +// Represents the apps container within search results. +message SearchResultContainer { + + // Length of search term. + optional int32 query_length = 1; + + // Container from where search was invoked. + oneof ParentContainer { + WorkspaceContainer workspace = 2; + AllAppsContainer all_apps_container = 3; + } +} + +// Container for package specific shortcuts to deep links and notifications. +// Typically shown as popup window by longpressing on an icon. +message ShortcutsContainer { +} + +// Container for generic system shortcuts for launcher specific settings. +// Typically shown up as popup window by longpressing on empty space on workspace. +message SettingsContainer { +} + +message TaskSwitcherContainer { +} + +enum Attribute { + UNKNOWN = 0; + DEFAULT_LAYOUT = 1; // icon automatically placed in workspace, folder, hotseat + BACKUP_RESTORE = 2; // icon layout restored from backup + PINITEM = 3; // from another app (e.g., Chrome's "Add to Home screen") + ALLAPPS_ATOZ = 4; // within launcher surface, all aps a-z + WIDGETS = 5; // within launcher, widgets tray + ADD_TO_HOMESCREEN = 6; // play install + launcher home setting + ALLAPPS_PREDICTION = 7; // from prediction bar in all apps container + HOTSEAT_PREDICTION = 8; // from prediction bar in hotseat container + + // Folder's label is one of the non-empty suggested values. + SUGGESTED_LABEL = 9; + + // Folder's label is non-empty, manually entered by the user + // and different from any of suggested values. + MANUAL_LABEL = 10; + + // Folder's label is not yet assigned( i.e., title == null). + // Eligible for auto-labeling. + UNLABELED = 11; + + // Folder's label is empty(i.e., title == ""). + // Not eligible for auto-labeling. + EMPTY_LABEL = 12; +} + +// Main app icons +message Application { + optional string package_name = 1; + optional string component_name = 2; +} + +// Legacy shortcuts and shortcuts handled by ShortcutManager +message Shortcut { + optional string shortcut_name = 1; +} + +// AppWidgets handled by AppWidgetManager +message Widget { + optional int32 span_x = 1 [default = 1]; + optional int32 span_y = 2 [default = 1]; + optional int32 app_widget_id = 3; + optional string package_name = 4; // only populated during snapshot if from workspace + optional string component_name = 5; // only populated during snapshot if from workspace +} + +// Tasks handled by PackageManager +message Task { + optional string package_name = 1; + optional string component_name = 2; + optional int32 index = 3; +} + +// Represents folder in a closed state. +message FolderIcon { + // Number of items inside folder. + optional int32 cardinality = 1; + + // State of the folder label before the event. + optional FromState from_label_state = 2; + + // State of the folder label after the event. + optional ToState to_label_state = 3; + + // Details about actual folder label. + // Populated when folder label is not a PII. + optional string label_info = 4; +} + +////////////////////////////////////////////// +// Containers + +message WorkspaceContainer { + optional int32 page_index = 1 [default = -2]; // range [-1, l], 0 is the index of the main homescreen + optional int32 grid_x = 2 [default = -1]; // [0, m], m varies based on the display density and resolution + optional int32 grid_y = 3 [default = -1]; // [0, n], n varies based on the display density and resolution +} + +message HotseatContainer { + optional int32 index = 1; +} + +// Represents hotseat container with prediction feature enabled. +message PredictedHotseatContainer { + optional int32 index = 1; + + // No of hotseat positions filled with predicted items. + optional int32 cardinality = 2; +} + +message FolderContainer { + optional int32 page_index = 1 [default = -1]; + optional int32 grid_x = 2 [default = -1]; + optional int32 grid_y = 3 [default = -1]; + oneof ParentContainer { + WorkspaceContainer workspace = 4; + HotseatContainer hotseat = 5; + } +} + +// Represents state of EditText field before update. +enum FromState { + // Default value. + // Used when a FromState is not applicable, for example, during folder creation. + FROM_STATE_UNSPECIFIED = 0; + + // EditText was empty. + // Eg: When a folder label is updated from empty string. + FROM_EMPTY = 1; + + // EditText was non-empty and manually entered by the user. + // Eg: When a folder label is updated from a user-entered value. + FROM_CUSTOM = 2; + + // EditText was non-empty and one of the suggestions. + // Eg: When a folder label is updated from a suggested value. + FROM_SUGGESTED = 3; +} + +// Represents state of EditText field after update. +enum ToState { + // Default value. + // Used when ToState is not applicable, for example, when folder label is updated to a different + // value when folder label suggestion feature is disabled. + TO_STATE_UNSPECIFIED = 0; + + // User attempted to change the EditText, but was not changed. + UNCHANGED = 1; + + // New label matches with primary(aka top) suggestion. + TO_SUGGESTION0 = 2; + + // New value matches with second top suggestion even though the top suggestion was non-empty. + TO_SUGGESTION1_WITH_VALID_PRIMARY = 3; + + // New value matches with second top suggestion given that top suggestion was empty. + TO_SUGGESTION1_WITH_EMPTY_PRIMARY = 4; + + // New value matches with third top suggestion even though the top suggestion was non-empty. + TO_SUGGESTION2_WITH_VALID_PRIMARY = 5; + + // New value matches with third top suggestion given that top suggestion was empty. + TO_SUGGESTION2_WITH_EMPTY_PRIMARY = 6; + + // New value matches with 4th top suggestion even though the top suggestion was non-empty. + TO_SUGGESTION3_WITH_VALID_PRIMARY = 7; + + // New value matches with 4th top suggestion given that top suggestion was empty. + TO_SUGGESTION3_WITH_EMPTY_PRIMARY = 8; + + // New value is empty even though the top suggestion was non-empty. + TO_EMPTY_WITH_VALID_PRIMARY = 9; + + // New value is empty given that top suggestion was empty. + TO_EMPTY_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 10; + + // New value is empty given that no suggestions were provided. + TO_EMPTY_WITH_EMPTY_SUGGESTIONS = 11; + + // New value is empty given that suggestions feature was disabled. + TO_EMPTY_WITH_SUGGESTIONS_DISABLED = 12; + + // New value is non-empty and does not match with any of the suggestions even though the top suggestion was non-empty. + TO_CUSTOM_WITH_VALID_PRIMARY = 13; + + // New value is non-empty and not match with any suggestions given that top suggestion was empty. + TO_CUSTOM_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 14; + + // New value is non-empty and also no suggestions were provided. + TO_CUSTOM_WITH_EMPTY_SUGGESTIONS = 15; + + // New value is non-empty and also suggestions feature was disable. + TO_CUSTOM_WITH_SUGGESTIONS_DISABLED = 16; +} diff --git a/protos/launcher_dump.proto b/protos/launcher_dump.proto deleted file mode 100644 index dc8fbda250..0000000000 --- a/protos/launcher_dump.proto +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -syntax = "proto2"; - -option java_package = "com.android.launcher3.model"; -option java_outer_classname = "LauncherDumpProto"; - -package model; - -message DumpTarget { - enum Type { - NONE = 0; - ITEM = 1; - CONTAINER = 2; - } - - optional Type type = 1; - optional int32 page_id = 2; - optional int32 grid_x = 3; - optional int32 grid_y = 4; - - // For container types only - optional ContainerType container_type = 5; - - // For item types only - optional ItemType item_type = 6; - - optional string package_name = 7; // All ItemTypes except UNKNOWN type - optional string component = 8; // All ItemTypes except UNKNOWN type - optional string item_id = 9; // For Pinned Shortcuts and appWidgetId - - optional int32 span_x = 10 [default = 1];// Used for ItemType.WIDGET - optional int32 span_y = 11 [default = 1];// Used for ItemType.WIDGET - optional UserType user_type = 12; -} - -// Used to define what type of item a Target would represent. -enum ItemType { - UNKNOWN_ITEMTYPE = 0; // Launcher specific items - APP_ICON = 1; // Regular app icons - WIDGET = 2; // Elements from AppWidgetManager - SHORTCUT = 3; // ShortcutManager -} - -// Used to define what type of container a Target would represent. -enum ContainerType { - UNKNOWN_CONTAINERTYPE = 0; - WORKSPACE = 1; - HOTSEAT = 2; - FOLDER = 3; -} - -// Used to define what type of control a Target would represent. -enum UserType { - DEFAULT = 0; - WORK = 1; -} - -// Main message; -message LauncherImpression { - repeated DumpTarget targets = 1; -} diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto index 055ade58eb..9423cb2642 100644 --- a/protos/launcher_log.proto +++ b/protos/launcher_log.proto @@ -57,6 +57,40 @@ message Target { optional TargetExtension extension = 16; optional TipType tip_type = 17; optional int32 search_query_length = 18; + optional bool is_work_app = 19; + optional FromFolderLabelState from_folder_label_state = 20; + optional ToFolderLabelState to_folder_label_state = 21; + + // Note: proto does not support duplicate enum values, even if they belong to different enum type. + // Hence "FROM" and "TO" prefix added. + enum FromFolderLabelState { + FROM_FOLDER_LABEL_STATE_UNSPECIFIED = 0; + FROM_EMPTY = 1; + FROM_CUSTOM = 2; + FROM_SUGGESTED = 3; + } + + enum ToFolderLabelState { + TO_FOLDER_LABEL_STATE_UNSPECIFIED = 0; + TO_SUGGESTION0_WITH_VALID_PRIMARY = 1; + TO_SUGGESTION1_WITH_VALID_PRIMARY = 2; + TO_SUGGESTION1_WITH_EMPTY_PRIMARY = 3; + TO_SUGGESTION2_WITH_VALID_PRIMARY = 4; + TO_SUGGESTION2_WITH_EMPTY_PRIMARY = 5; + TO_SUGGESTION3_WITH_VALID_PRIMARY = 6; + TO_SUGGESTION3_WITH_EMPTY_PRIMARY = 7; + TO_EMPTY_WITH_VALID_SUGGESTIONS = 8 [deprecated = true]; + TO_EMPTY_WITH_VALID_PRIMARY = 15; + TO_EMPTY_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 16; + TO_EMPTY_WITH_EMPTY_SUGGESTIONS = 9; + TO_EMPTY_WITH_SUGGESTIONS_DISABLED = 10; + TO_CUSTOM_WITH_VALID_SUGGESTIONS = 11 [deprecated = true]; + TO_CUSTOM_WITH_VALID_PRIMARY = 17; + TO_CUSTOM_WITH_VALID_SUGGESTIONS_AND_EMPTY_PRIMARY = 18; + TO_CUSTOM_WITH_EMPTY_SUGGESTIONS = 12; + TO_CUSTOM_WITH_SUGGESTIONS_DISABLED = 13; + UNCHANGED = 14; + } } // Used to define what type of item a Target would represent. @@ -92,7 +126,7 @@ enum ContainerType { TASKSWITCHER = 12; // Recents UI Container (QuickStep) APP = 13; // Foreground activity is another app (QuickStep) TIP = 14; // Onboarding texts (QuickStep) - SIDELOADED_LAUNCHER = 15; + OTHER_LAUNCHER_APP = 15; } // Used to define what type of control a Target would represent. @@ -119,6 +153,13 @@ enum ControlType { BACK_GESTURE = 19; UNDO = 20; DISMISS_PREDICTION = 21; + HYBRID_HOTSEAT_ACCEPTED = 22; + HYBRID_HOTSEAT_CANCELED = 23; + OVERVIEW_ACTIONS_SHARE_BUTTON = 24; + OVERVIEW_ACTIONS_SCREENSHOT_BUTTON = 25; + OVERVIEW_ACTIONS_SELECT_BUTTON = 26; + SELECT_MODE_CLOSE_BUTTON = 27; + SELECT_MODE_ITEM = 28; } enum TipType { @@ -128,6 +169,7 @@ enum TipType { QUICK_SCRUB_TEXT = 3; PREDICTION_TEXT = 4; DWB_TOAST = 5; + HYBRID_HOTSEAT = 6; } // Used to define the action component of the LauncherEvent. @@ -137,7 +179,8 @@ message Action { AUTOMATED = 1; COMMAND = 2; TIP = 3; - // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST + SOFT_KEYBOARD = 4; + // HARD_KEYBOARD, ASSIST } enum Touch { diff --git a/protos/launcher_trace.proto b/protos/launcher_trace.proto new file mode 100644 index 0000000000..4795654f8b --- /dev/null +++ b/protos/launcher_trace.proto @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +syntax = "proto2"; + +package com.android.launcher3.tracing; + +option java_multiple_files = true; + +message LauncherTraceProto { + + optional TouchInteractionServiceProto touch_interaction_service = 1; +} + +message TouchInteractionServiceProto { + + optional bool service_connected = 1; +} diff --git a/protos/launcher_trace_file.proto b/protos/launcher_trace_file.proto new file mode 100644 index 0000000000..0ee5d42acf --- /dev/null +++ b/protos/launcher_trace_file.proto @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +syntax = "proto2"; + +import "launcher_trace.proto"; + +package com.android.launcher3.tracing; + +option java_multiple_files = true; + +/* represents a file full of launcher trace entries. + Encoded, it should start with 0x9 0x4C 0x4E 0x43 0x48 0x52 0x54 0x52 0x43 (.LNCHRTRC), such + that they can be easily identified. */ +message LauncherTraceFileProto { + + /* constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 | MagicNumber.MAGIC_NUMBER_L + (this is needed because enums have to be 32 bits and there's no nice way to put 64bit + constants into .proto files. */ + enum MagicNumber { + INVALID = 0; + MAGIC_NUMBER_L = 0x48434E4C; /* LNCH (little-endian ASCII) */ + MAGIC_NUMBER_H = 0x43525452; /* RTRC (little-endian ASCII) */ + } + + optional fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */ + repeated LauncherTraceEntryProto entry = 2; +} + +/* one launcher trace entry. */ +message LauncherTraceEntryProto { + /* required: elapsed realtime in nanos since boot of when this entry was logged */ + optional fixed64 elapsed_realtime_nanos = 1; + + optional LauncherTraceProto launcher = 3; +} diff --git a/protos/search.proto b/protos/search.proto deleted file mode 100644 index fa178861ba..0000000000 --- a/protos/search.proto +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -syntax = "proto2"; - -option java_package = "com.google.android.apps.nexuslauncher.search"; -option java_outer_classname = "SearchProto"; - -package search; - -message Columns { - optional int32 edgeMargin = 1; - optional int32 innerMargin = 2; - optional int32 iconDistance = 3; - optional int32 height = 4; -} - -message AppIndex { - optional string label = 1; - optional string predictionRank = 2; - optional string iconBitmap = 3; - optional string searchUri = 4; -} - -message SearchBase { - optional int32 bgColor = 1; - optional string iconViewTemplate = 2; - optional string iconLongClick = 3; - optional Columns apps = 4; - optional int32 allAppsCols = 5; - repeated AppIndex index = 6; - optional Columns bounds = 7; - optional string searchTemplate = 8; - optional int32 gIcon = 9; - optional int32 micIcon = 10; - optional string view = 11; - optional Columns viewBounds = 12; - optional bool isAllApps = 13; - optional Columns appsView = 14; - optional bool isDark = 15; -} - -message SearchView { - optional SearchBase base = 1; -} diff --git a/protos/smartspace.proto b/protos/smartspace.proto deleted file mode 100644 index 6c8b313184..0000000000 --- a/protos/smartspace.proto +++ /dev/null @@ -1,69 +0,0 @@ -syntax = "proto2"; - -option java_package = "com.google.android.apps.nexuslauncher.smartspace"; -option java_outer_classname = "SmartspaceProto"; - -package nano; - -message a { - repeated b cw = 1; -} - -message b { - optional bool cy = 1; - optional int32 cJ = 2; - optional c cB = 3; - optional c cC = 4; - optional c cH = 5; - optional f cx = 6; - optional int32 cA = 7; - optional g cG = 8; - optional int64 cK = 9; - optional int64 cD = 10; - optional int64 cE = 11; - optional h cF = 12; - optional int32 cz = 13; -} - -message c { - optional d cL = 1; - optional d cM = 2; -} - -message d { - optional string cN = 1; - optional int32 cP = 2; - repeated e cO = 3; -} - -message e { - optional string cR = 1; - optional int32 cS = 2; - optional int32 cQ = 3; - optional bool cU = 4; -} - -message f { - optional string cV = 1; - optional string cW = 2; - optional string cX = 3; -} - -message g { - optional int32 cY = 1; - optional string cZ = 2; -} - -message h { - optional int64 da = 1; - optional int32 db = 2; -} - -message i { - optional bool dc = 6; - optional bytes dd = 5; - optional b de = 1; - optional int64 df = 2; - optional int32 dg = 4; - optional int64 dh = 3; -} \ No newline at end of file