f81e8b002a
* Fixes null component issue when ItemInfo object copiedFrom.
* Fixes missing container when item is dragged from hybrid hotseat.
Sample Logs:
2020-04-30 14:09:45.499 30472-30472/com.google.android.apps.nexuslauncher D/StatsLogManager: LAUNCHER_ITEM_DRAG_STARTED
# com.android.launcher3.logger.LauncherAtom$ItemInfo@260f31f8
application {
component_name: "com.android.chrome/com.google.android.apps.chrome.Main"
package_name: "com.android.chrome"
}
container_info {
workspace {
grid_x: 2
grid_y: 2
page_index: 2
}
}
is_work: false
2020-04-30 14:23:15.230 31320-31320/com.google.android.apps.nexuslauncher D/StatsLogManager: LAUNCHER_ITEM_DRAG_STARTED
# com.android.launcher3.logger.LauncherAtom$ItemInfo@608f101
application {
component_name: "com.google.android.gm/.ConversationListActivityGmail"
package_name: "com.google.android.gm"
}
container_info {
hotseat {
index: 1
}
}
is_work: false
Bug: 152978018
Change-Id: I3d3ce213fd2fc6eb5ffb239e048ceb7c0fa88b53
117 lines
3.6 KiB
Protocol Buffer
117 lines
3.6 KiB
Protocol Buffer
/*
|
|
* 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;
|
|
}
|
|
// 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 Origin source = 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;
|
|
}
|
|
}
|
|
|
|
message AllAppsContainer {
|
|
}
|
|
|
|
enum Origin {
|
|
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
|
|
}
|
|
|
|
// 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;
|
|
}
|
|
|
|
//////////////////////////////////////////////
|
|
// 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;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|