Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbd61d40 authored by thiruram's avatar thiruram
Browse files

Log query_length & parent_container for actions on search results.

Bug: 154717227
Change-Id: I8e7d725014f60a2fd9a7fe13fce705acbc7623ad
parent 51ece184
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -71,6 +71,15 @@ message PredictionContainer {


// Represents the apps container within search results.
// Represents the apps container within search results.
message SearchResultContainer {
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.
// Container for package specific shortcuts to deep links and notifications.
+34 −16
Original line number Original line Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.quickstep.logging;
package com.android.quickstep.logging;


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.PREDICTED_HOTSEAT_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;
import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DST_STATE__ALLAPPS;
import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DST_STATE__ALLAPPS;
import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DST_STATE__BACKGROUND;
import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DST_STATE__BACKGROUND;
@@ -75,6 +75,7 @@ public class StatsLogCompatManager extends StatsLogManager {
    // from nano to lite, bake constant to prevent robo test failure.
    // from nano to lite, bake constant to prevent robo test failure.
    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;


    public StatsLogCompatManager(Context context) {
    public StatsLogCompatManager(Context context) {
        sContext = context;
        sContext = context;
@@ -156,10 +157,10 @@ public class StatsLogCompatManager extends StatsLogManager {
                getComponentName(info) /* component_name */,
                getComponentName(info) /* component_name */,
                getGridX(info, false) /* grid_x */,
                getGridX(info, false) /* grid_x */,
                getGridY(info, false) /* grid_y */,
                getGridY(info, false) /* grid_y */,
                getPageId(info, false) /* page_id */,
                getPageId(info) /* page_id */,
                getGridX(info, true) /* grid_x_parent */,
                getGridX(info, true) /* grid_x_parent */,
                getGridY(info, true) /* grid_y_parent */,
                getGridY(info, true) /* grid_y_parent */,
                getPageId(info, true) /* page_id_parent */,
                getParentPageId(info) /* page_id_parent */,
                getHierarchy(info) /* hierarchy */,
                getHierarchy(info) /* hierarchy */,
                info.getIsWork() /* is_work_profile */,
                info.getIsWork() /* is_work_profile */,
                info.getAttribute().getNumber() /* origin */,
                info.getAttribute().getNumber() /* origin */,
@@ -321,10 +322,10 @@ public class StatsLogCompatManager extends StatsLogManager {
                    getComponentName(atomInfo) /* component_name */,
                    getComponentName(atomInfo) /* component_name */,
                    getGridX(atomInfo, false) /* grid_x */,
                    getGridX(atomInfo, false) /* grid_x */,
                    getGridY(atomInfo, false) /* grid_y */,
                    getGridY(atomInfo, false) /* grid_y */,
                    getPageId(atomInfo, false) /* page_id */,
                    getPageId(atomInfo) /* page_id */,
                    getGridX(atomInfo, true) /* grid_x_parent */,
                    getGridX(atomInfo, true) /* grid_x_parent */,
                    getGridY(atomInfo, true) /* grid_y_parent */,
                    getGridY(atomInfo, true) /* grid_y_parent */,
                    getPageId(atomInfo, true) /* page_id_parent */,
                    getParentPageId(atomInfo) /* page_id_parent */,
                    getHierarchy(atomInfo) /* hierarchy */,
                    getHierarchy(atomInfo) /* hierarchy */,
                    atomInfo.getIsWork() /* is_work_profile */,
                    atomInfo.getIsWork() /* is_work_profile */,
                    atomInfo.getRank() /* rank */,
                    atomInfo.getRank() /* rank */,
@@ -336,9 +337,14 @@ public class StatsLogCompatManager extends StatsLogManager {
    }
    }


    private static int getCardinality(LauncherAtom.ItemInfo info) {
    private static int getCardinality(LauncherAtom.ItemInfo info) {
        return info.getContainerInfo().getContainerCase().equals(PREDICTED_HOTSEAT_CONTAINER)
        switch (info.getContainerInfo().getContainerCase()){
                ? info.getContainerInfo().getPredictedHotseatContainer().getCardinality()
            case PREDICTED_HOTSEAT_CONTAINER:
                : info.getFolderIcon().getCardinality();
                return info.getContainerInfo().getPredictedHotseatContainer().getCardinality();
            case SEARCH_RESULT_CONTAINER:
                return info.getContainerInfo().getSearchResultContainer().getQueryLength();
            default:
                return info.getFolderIcon().getCardinality();
        }
    }
    }


    private static String getPackageName(LauncherAtom.ItemInfo info) {
    private static String getPackageName(LauncherAtom.ItemInfo info) {
@@ -395,14 +401,23 @@ public class StatsLogCompatManager extends StatsLogManager {
        }
        }
    }
    }


    private static int getPageId(LauncherAtom.ItemInfo info, boolean parent) {
    private static int getPageId(LauncherAtom.ItemInfo info) {
        if (info.getContainerInfo().getContainerCase() == FOLDER) {
        switch (info.getContainerInfo().getContainerCase()) {
            if (parent) {
            case FOLDER:
                return info.getContainerInfo().getFolder().getWorkspace().getPageIndex();
            } else {
                return info.getContainerInfo().getFolder().getPageIndex();
                return info.getContainerInfo().getFolder().getPageIndex();
            default:
                return info.getContainerInfo().getWorkspace().getPageIndex();
        }
        }
        } else {
    }

    private static int getParentPageId(LauncherAtom.ItemInfo info) {
        switch (info.getContainerInfo().getContainerCase()) {
            case FOLDER:
                return info.getContainerInfo().getFolder().getWorkspace().getPageIndex();
            case SEARCH_RESULT_CONTAINER:
                return info.getContainerInfo().getSearchResultContainer().getWorkspace()
                        .getPageIndex();
            default:
                return info.getContainerInfo().getWorkspace().getPageIndex();
                return info.getContainerInfo().getWorkspace().getPageIndex();
        }
        }
    }
    }
@@ -411,6 +426,9 @@ public class StatsLogCompatManager extends StatsLogManager {
        if (info.getContainerInfo().getContainerCase() == FOLDER) {
        if (info.getContainerInfo().getContainerCase() == FOLDER) {
            return info.getContainerInfo().getFolder().getParentContainerCase().getNumber()
            return info.getContainerInfo().getFolder().getParentContainerCase().getNumber()
                    + FOLDER_HIERARCHY_OFFSET;
                    + FOLDER_HIERARCHY_OFFSET;
        } else if (info.getContainerInfo().getContainerCase() == SEARCH_RESULT_CONTAINER) {
            return info.getContainerInfo().getSearchResultContainer().getParentContainerCase()
                    .getNumber() + SEARCH_RESULT_HIERARCHY_OFFSET;
        } else {
        } else {
            return info.getContainerInfo().getContainerCase().getNumber();
            return info.getContainerInfo().getContainerCase().getNumber();
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -344,7 +344,7 @@ public class ItemInfo {
        return itemBuilder;
        return itemBuilder;
    }
    }


    ContainerInfo getContainerInfo() {
    protected ContainerInfo getContainerInfo() {
        switch (container) {
        switch (container) {
            case CONTAINER_HOTSEAT:
            case CONTAINER_HOTSEAT:
                return ContainerInfo.newBuilder()
                return ContainerInfo.newBuilder()