[AA+] Log app launches from AA+ search result container.
This change will update westworld logs for app launches from AA+ search result. Updates log's container info from AllAppsContainer -> AllAppsPlusSearchResultContainer. Bug: 178562918 Change-Id: I9ffca27fea42951a57640ef36717c04ff0251506
This commit is contained in:
parent
aa793ff226
commit
cbeb13d6c7
20
Android.bp
20
Android.bp
|
@ -36,17 +36,37 @@ java_library_static {
|
||||||
name: "launcher_log_protos_lite",
|
name: "launcher_log_protos_lite",
|
||||||
srcs: [
|
srcs: [
|
||||||
"protos/*.proto",
|
"protos/*.proto",
|
||||||
|
"protos_overrides/*.proto",
|
||||||
],
|
],
|
||||||
sdk_version: "current",
|
sdk_version: "current",
|
||||||
proto: {
|
proto: {
|
||||||
type: "lite",
|
type: "lite",
|
||||||
local_include_dirs:[
|
local_include_dirs:[
|
||||||
"protos",
|
"protos",
|
||||||
|
"protos_overrides",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
static_libs: ["libprotobuf-java-lite"],
|
static_libs: ["libprotobuf-java-lite"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java_library_static {
|
||||||
|
name: "launcher_quickstep_log_protos_lite",
|
||||||
|
srcs: [
|
||||||
|
"quickstep/protos_overrides/*.proto",
|
||||||
|
],
|
||||||
|
sdk_version: "current",
|
||||||
|
proto: {
|
||||||
|
type: "lite",
|
||||||
|
local_include_dirs:[
|
||||||
|
"quickstep/protos_overrides",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
static_libs: [
|
||||||
|
"libprotobuf-java-lite",
|
||||||
|
"launcher_log_protos_lite"
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
name: "LauncherPluginLib",
|
name: "LauncherPluginLib",
|
||||||
|
|
||||||
|
|
10
Android.mk
10
Android.mk
|
@ -33,7 +33,7 @@ LOCAL_STATIC_ANDROID_LIBRARIES := \
|
||||||
|
|
||||||
LOCAL_STATIC_JAVA_LIBRARIES := \
|
LOCAL_STATIC_JAVA_LIBRARIES := \
|
||||||
LauncherPluginLib \
|
LauncherPluginLib \
|
||||||
launcher_log_protos_lite \
|
launcher_quickstep_log_protos_lite \
|
||||||
search_ui
|
search_ui
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
|
@ -65,7 +65,7 @@ LOCAL_SRC_FILES := \
|
||||||
$(call all-java-files-under, src_shortcuts_overrides) \
|
$(call all-java-files-under, src_shortcuts_overrides) \
|
||||||
$(call all-java-files-under, src_ui_overrides) \
|
$(call all-java-files-under, src_ui_overrides) \
|
||||||
$(call all-java-files-under, ext_tests/src)
|
$(call all-java-files-under, ext_tests/src)
|
||||||
|
|
||||||
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/ext_tests/res
|
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/ext_tests/res
|
||||||
|
|
||||||
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
|
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
|
||||||
|
@ -129,8 +129,7 @@ LOCAL_MODULE_TAGS := optional
|
||||||
|
|
||||||
LOCAL_STATIC_JAVA_LIBRARIES := \
|
LOCAL_STATIC_JAVA_LIBRARIES := \
|
||||||
SystemUI-statsd \
|
SystemUI-statsd \
|
||||||
SystemUISharedLib \
|
SystemUISharedLib
|
||||||
launcher_log_protos_lite
|
|
||||||
ifneq (,$(wildcard frameworks/base))
|
ifneq (,$(wildcard frameworks/base))
|
||||||
LOCAL_PRIVATE_PLATFORM_APIS := true
|
LOCAL_PRIVATE_PLATFORM_APIS := true
|
||||||
else
|
else
|
||||||
|
@ -196,8 +195,7 @@ LOCAL_MODULE_TAGS := optional
|
||||||
|
|
||||||
LOCAL_STATIC_JAVA_LIBRARIES := \
|
LOCAL_STATIC_JAVA_LIBRARIES := \
|
||||||
SystemUI-statsd \
|
SystemUI-statsd \
|
||||||
SystemUISharedLib \
|
SystemUISharedLib
|
||||||
launcher_log_protos_lite
|
|
||||||
ifneq (,$(wildcard frameworks/base))
|
ifneq (,$(wildcard frameworks/base))
|
||||||
LOCAL_PRIVATE_PLATFORM_APIS := true
|
LOCAL_PRIVATE_PLATFORM_APIS := true
|
||||||
else
|
else
|
||||||
|
|
|
@ -81,7 +81,7 @@ android {
|
||||||
java.srcDirs = ['src', 'src_plugins']
|
java.srcDirs = ['src', 'src_plugins']
|
||||||
manifest.srcFile 'AndroidManifest-common.xml'
|
manifest.srcFile 'AndroidManifest-common.xml'
|
||||||
proto {
|
proto {
|
||||||
srcDir 'protos/'
|
srcDirs = ['protos/', 'protos_overrides/']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,4 +181,4 @@ protobuf {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@ syntax = "proto2";
|
||||||
option java_package = "com.android.launcher3.logger";
|
option java_package = "com.android.launcher3.logger";
|
||||||
option java_outer_classname = "LauncherAtom";
|
option java_outer_classname = "LauncherAtom";
|
||||||
|
|
||||||
|
import "launcher_atom_extension.proto";
|
||||||
|
|
||||||
//
|
//
|
||||||
// ItemInfos
|
// ItemInfos
|
||||||
message ItemInfo {
|
message ItemInfo {
|
||||||
|
@ -55,6 +57,7 @@ message ContainerInfo {
|
||||||
SettingsContainer settings_container = 9;
|
SettingsContainer settings_container = 9;
|
||||||
PredictedHotseatContainer predicted_hotseat_container = 10;
|
PredictedHotseatContainer predicted_hotseat_container = 10;
|
||||||
TaskSwitcherContainer task_switcher_container = 11;
|
TaskSwitcherContainer task_switcher_container = 11;
|
||||||
|
ExtendedContainers extended_containers = 20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* 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 = "LauncherAtomExtensions";
|
||||||
|
|
||||||
|
|
||||||
|
// This proto file contains placeholder messages that can be overridden by
|
||||||
|
// other Launcher variants.
|
||||||
|
// Variants could have its own launcher_atom_extension.proto file(should have
|
||||||
|
// same messages declared here but with different implementation); when building
|
||||||
|
// variant's apk launcher_atom.proto will reference variant's extension file,
|
||||||
|
// essentially overriding this file.
|
||||||
|
|
||||||
|
|
||||||
|
// Wrapper message for additional containers used in variants.
|
||||||
|
message ExtendedContainers {}
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* 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 = "LauncherAtomExtensions";
|
||||||
|
|
||||||
|
|
||||||
|
// Wrapper message for containers used at the quickstep level.
|
||||||
|
// Message name should match with launcher_atom_extension.proto message at
|
||||||
|
// the AOSP level.
|
||||||
|
message ExtendedContainers {
|
||||||
|
|
||||||
|
oneof Container{
|
||||||
|
DeviceSearchResultContainer device_search_result_container = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Represents on-device search result container.
|
||||||
|
message DeviceSearchResultContainer{
|
||||||
|
}
|
|
@ -49,6 +49,9 @@ import com.android.launcher3.allapps.AllAppsStore;
|
||||||
import com.android.launcher3.icons.BitmapInfo;
|
import com.android.launcher3.icons.BitmapInfo;
|
||||||
import com.android.launcher3.icons.BitmapRenderer;
|
import com.android.launcher3.icons.BitmapRenderer;
|
||||||
import com.android.launcher3.icons.LauncherIcons;
|
import com.android.launcher3.icons.LauncherIcons;
|
||||||
|
import com.android.launcher3.logger.LauncherAtom.ContainerInfo;
|
||||||
|
import com.android.launcher3.logger.LauncherAtomExtensions.DeviceSearchResultContainer;
|
||||||
|
import com.android.launcher3.logger.LauncherAtomExtensions.ExtendedContainers;
|
||||||
import com.android.launcher3.model.data.AppInfo;
|
import com.android.launcher3.model.data.AppInfo;
|
||||||
import com.android.launcher3.model.data.ItemInfoWithIcon;
|
import com.android.launcher3.model.data.ItemInfoWithIcon;
|
||||||
import com.android.launcher3.model.data.PackageItemInfo;
|
import com.android.launcher3.model.data.PackageItemInfo;
|
||||||
|
@ -142,8 +145,14 @@ public class SearchResultIcon extends BubbleTextView implements
|
||||||
|
|
||||||
SearchActionItemInfo itemInfo = new SearchActionItemInfo(searchAction.getIcon(),
|
SearchActionItemInfo itemInfo = new SearchActionItemInfo(searchAction.getIcon(),
|
||||||
searchTarget.getPackageName(), searchTarget.getUserHandle(),
|
searchTarget.getPackageName(), searchTarget.getUserHandle(),
|
||||||
searchAction.getTitle()
|
searchAction.getTitle()) {
|
||||||
);
|
// Workaround to log ItemInfo with DeviceSearchResultContainer without
|
||||||
|
// updating ItemInfo.container field.
|
||||||
|
@Override
|
||||||
|
protected ContainerInfo getContainerInfo() {
|
||||||
|
return buildDeviceSearchResultContainer();
|
||||||
|
}
|
||||||
|
};
|
||||||
itemInfo.setIntent(searchAction.getIntent());
|
itemInfo.setIntent(searchAction.getIntent());
|
||||||
itemInfo.setPendingIntent(searchAction.getPendingIntent());
|
itemInfo.setPendingIntent(searchAction.getPendingIntent());
|
||||||
|
|
||||||
|
@ -243,7 +252,15 @@ public class SearchResultIcon extends BubbleTextView implements
|
||||||
|
|
||||||
private void prepareUsingApp(ComponentName componentName, UserHandle userHandle) {
|
private void prepareUsingApp(ComponentName componentName, UserHandle userHandle) {
|
||||||
AllAppsStore appsStore = mLauncher.getAppsView().getAppsStore();
|
AllAppsStore appsStore = mLauncher.getAppsView().getAppsStore();
|
||||||
AppInfo appInfo = appsStore.getApp(new ComponentKey(componentName, userHandle));
|
AppInfo appInfo = new AppInfo(
|
||||||
|
appsStore.getApp(new ComponentKey(componentName, userHandle))) {
|
||||||
|
// Workaround to log ItemInfo with DeviceSearchResultContainer without
|
||||||
|
// updating ItemInfo.container field.
|
||||||
|
@Override
|
||||||
|
protected ContainerInfo getContainerInfo() {
|
||||||
|
return buildDeviceSearchResultContainer();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (appInfo == null) {
|
if (appInfo == null) {
|
||||||
setVisibility(GONE);
|
setVisibility(GONE);
|
||||||
|
@ -253,9 +270,15 @@ public class SearchResultIcon extends BubbleTextView implements
|
||||||
notifyItemInfoChanged(appInfo);
|
notifyItemInfoChanged(appInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void prepareUsingShortcutInfo(ShortcutInfo shortcutInfo) {
|
private void prepareUsingShortcutInfo(ShortcutInfo shortcutInfo) {
|
||||||
WorkspaceItemInfo workspaceItemInfo = new WorkspaceItemInfo(shortcutInfo, getContext());
|
WorkspaceItemInfo workspaceItemInfo = new WorkspaceItemInfo(shortcutInfo, getContext()) {
|
||||||
|
// Workaround to log ItemInfo with DeviceSearchResultContainer without
|
||||||
|
// updating ItemInfo.container field.
|
||||||
|
@Override
|
||||||
|
protected ContainerInfo getContainerInfo() {
|
||||||
|
return buildDeviceSearchResultContainer();
|
||||||
|
}
|
||||||
|
};
|
||||||
notifyItemInfoChanged(workspaceItemInfo);
|
notifyItemInfoChanged(workspaceItemInfo);
|
||||||
LauncherAppState launcherAppState = LauncherAppState.getInstance(getContext());
|
LauncherAppState launcherAppState = LauncherAppState.getInstance(getContext());
|
||||||
MODEL_EXECUTOR.execute(() -> {
|
MODEL_EXECUTOR.execute(() -> {
|
||||||
|
@ -293,4 +316,14 @@ public class SearchResultIcon extends BubbleTextView implements
|
||||||
mOnItemInfoChanged = null;
|
mOnItemInfoChanged = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ContainerInfo buildDeviceSearchResultContainer() {
|
||||||
|
return ContainerInfo.newBuilder().setExtendedContainers(
|
||||||
|
ExtendedContainers
|
||||||
|
.newBuilder()
|
||||||
|
.setDeviceSearchResultContainer(
|
||||||
|
DeviceSearchResultContainer
|
||||||
|
.newBuilder()))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package com.android.quickstep.logging;
|
package com.android.quickstep.logging;
|
||||||
|
|
||||||
|
import static com.android.launcher3.logger.LauncherAtom.ContainerInfo.ContainerCase.EXTENDED_CONTAINERS;
|
||||||
import static com.android.launcher3.logger.LauncherAtom.ContainerInfo.ContainerCase.FOLDER;
|
import static com.android.launcher3.logger.LauncherAtom.ContainerInfo.ContainerCase.FOLDER;
|
||||||
import static com.android.launcher3.logger.LauncherAtom.ContainerInfo.ContainerCase.SEARCH_RESULT_CONTAINER;
|
import static com.android.launcher3.logger.LauncherAtom.ContainerInfo.ContainerCase.SEARCH_RESULT_CONTAINER;
|
||||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORKSPACE_SNAPSHOT;
|
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORKSPACE_SNAPSHOT;
|
||||||
|
@ -72,6 +73,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||||
private static final int DEFAULT_PAGE_INDEX = -2;
|
private static final int DEFAULT_PAGE_INDEX = -2;
|
||||||
private static final int FOLDER_HIERARCHY_OFFSET = 100;
|
private static final int FOLDER_HIERARCHY_OFFSET = 100;
|
||||||
private static final int SEARCH_RESULT_HIERARCHY_OFFSET = 200;
|
private static final int SEARCH_RESULT_HIERARCHY_OFFSET = 200;
|
||||||
|
private static final int EXTENDED_CONTAINERS_HIERARCHY_OFFSET = 300;
|
||||||
|
|
||||||
public static final CopyOnWriteArrayList<StatsLogConsumer> LOGS_CONSUMER =
|
public static final CopyOnWriteArrayList<StatsLogConsumer> LOGS_CONSUMER =
|
||||||
new CopyOnWriteArrayList<>();
|
new CopyOnWriteArrayList<>();
|
||||||
|
@ -397,6 +399,9 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||||
} else if (info.getContainerInfo().getContainerCase() == SEARCH_RESULT_CONTAINER) {
|
} else if (info.getContainerInfo().getContainerCase() == SEARCH_RESULT_CONTAINER) {
|
||||||
return info.getContainerInfo().getSearchResultContainer().getParentContainerCase()
|
return info.getContainerInfo().getSearchResultContainer().getParentContainerCase()
|
||||||
.getNumber() + SEARCH_RESULT_HIERARCHY_OFFSET;
|
.getNumber() + SEARCH_RESULT_HIERARCHY_OFFSET;
|
||||||
|
} else if (info.getContainerInfo().getContainerCase() == EXTENDED_CONTAINERS) {
|
||||||
|
return info.getContainerInfo().getExtendedContainers().getContainerCase().getNumber()
|
||||||
|
+ EXTENDED_CONTAINERS_HIERARCHY_OFFSET;
|
||||||
} else {
|
} else {
|
||||||
return info.getContainerInfo().getContainerCase().getNumber();
|
return info.getContainerInfo().getContainerCase().getNumber();
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,7 +225,7 @@ public class ItemInfo {
|
||||||
protected String dumpProperties() {
|
protected String dumpProperties() {
|
||||||
return "id=" + id
|
return "id=" + id
|
||||||
+ " type=" + LauncherSettings.Favorites.itemTypeToString(itemType)
|
+ " type=" + LauncherSettings.Favorites.itemTypeToString(itemType)
|
||||||
+ " container=" + LauncherSettings.Favorites.containerToString(container)
|
+ " container=" + getContainerInfo()
|
||||||
+ " targetComponent=" + getTargetComponent()
|
+ " targetComponent=" + getTargetComponent()
|
||||||
+ " screen=" + screenId
|
+ " screen=" + screenId
|
||||||
+ " cell(" + cellX + "," + cellY + ")"
|
+ " cell(" + cellX + "," + cellY + ")"
|
||||||
|
|
Loading…
Reference in New Issue