Merge "Log taskbar all apps entrypoint, launches, and drags" into tm-dev

This commit is contained in:
Brian Isganitis
2022-04-20 17:13:52 +00:00
committed by Android (Google) Code Review
5 changed files with 28 additions and 1 deletions
+6
View File
@@ -76,6 +76,9 @@ message ContainerInfo {
// Represents the apps list sorted alphabetically inside the all-apps view.
message AllAppsContainer {
oneof ParentContainer {
TaskBarContainer taskbar_container = 1;
}
}
message WidgetsContainer {
@@ -83,6 +86,9 @@ message WidgetsContainer {
// Represents the predicted apps row(top row) in the all-apps view.
message PredictionContainer {
oneof ParentContainer {
TaskBarContainer taskbar_container = 1;
}
}
// Represents the apps container within search results.
@@ -380,6 +380,14 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
folderBuilder.clearHotseat();
itemInfoBuilder.setContainerInfo(LauncherAtom.ContainerInfo.newBuilder()
.setFolder(folderBuilder));
} else if (oldContainer.hasAllAppsContainer()) {
itemInfoBuilder.setContainerInfo(LauncherAtom.ContainerInfo.newBuilder()
.setAllAppsContainer(oldContainer.getAllAppsContainer().toBuilder()
.setTaskbarContainer(LauncherAtom.TaskBarContainer.newBuilder())));
} else if (oldContainer.hasPredictionContainer()) {
itemInfoBuilder.setContainerInfo(LauncherAtom.ContainerInfo.newBuilder()
.setPredictionContainer(oldContainer.getPredictionContainer().toBuilder()
.setTaskbarContainer(LauncherAtom.TaskBarContainer.newBuilder())));
}
}
@@ -703,6 +711,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
}
} else if (tag instanceof AppInfo) {
startItemInfoActivity((AppInfo) tag);
mControllers.uiController.onTaskbarIconLaunched((AppInfo) tag);
} else {
Log.e(TAG, "Unknown type clicked: " + tag);
}
@@ -18,6 +18,7 @@ package com.android.launcher3.taskbar;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.Utilities.squaredHypot;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP;
import static com.android.quickstep.AnimatedFloat.VALUE;
import android.annotation.NonNull;
@@ -341,7 +342,10 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
}
public View.OnClickListener getAllAppsButtonClickListener() {
return v -> mControllers.taskbarAllAppsController.show();
return v -> {
mActivity.getStatsLogManager().logger().log(LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP);
mControllers.taskbarAllAppsController.show();
};
}
public View.OnLongClickListener getIconOnLongClickListener() {
@@ -20,6 +20,7 @@ import static androidx.core.util.Preconditions.checkNotNull;
import static androidx.core.util.Preconditions.checkState;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_NON_ACTIONABLE;
import static com.android.launcher3.logger.LauncherAtom.ContainerInfo.ContainerCase.ALL_APPS_CONTAINER;
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.SEARCH_RESULT_CONTAINER;
@@ -92,6 +93,7 @@ public class StatsLogCompatManager extends StatsLogManager {
private static final int FOLDER_HIERARCHY_OFFSET = 100;
private static final int SEARCH_RESULT_HIERARCHY_OFFSET = 200;
private static final int EXTENDED_CONTAINERS_HIERARCHY_OFFSET = 300;
private static final int ALL_APPS_HIERARCHY_OFFSET = 400;
/**
* Flags for converting SearchAttribute to integer value.
@@ -632,6 +634,9 @@ public class StatsLogCompatManager extends StatsLogManager {
} else if (info.getContainerInfo().getContainerCase() == EXTENDED_CONTAINERS) {
return info.getContainerInfo().getExtendedContainers().getContainerCase().getNumber()
+ EXTENDED_CONTAINERS_HIERARCHY_OFFSET;
} else if (info.getContainerInfo().getContainerCase() == ALL_APPS_CONTAINER) {
return info.getContainerInfo().getAllAppsContainer().getParentContainerCase()
.getNumber() + ALL_APPS_HIERARCHY_OFFSET;
} else {
return info.getContainerInfo().getContainerCase().getNumber();
}
@@ -586,6 +586,9 @@ public class StatsLogManager implements ResourceBasedOverride {
@UiEvent(doc = "User clicked on IME quicksearch button.")
LAUNCHER_ALLAPPS_QUICK_SEARCH_WITH_IME(1047),
@UiEvent(doc = "User tapped taskbar All Apps button.")
LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP(1057),
;
// ADD MORE