From 4d9ad3a19620abfc18de7c855aebd3a7e7f9a2ca Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Fri, 13 Mar 2020 11:04:34 -0700 Subject: [PATCH] Cleanup LoggerUtils Change-Id: Ibeccb61b25236ee905f61bdb5ea2255f778d4b05 --- .../launcher3/logging/LoggerUtils.java | 92 ------------------- 1 file changed, 92 deletions(-) diff --git a/src/com/android/launcher3/logging/LoggerUtils.java b/src/com/android/launcher3/logging/LoggerUtils.java index a9d10d775d..1b70fde88c 100644 --- a/src/com/android/launcher3/logging/LoggerUtils.java +++ b/src/com/android/launcher3/logging/LoggerUtils.java @@ -15,8 +15,6 @@ */ package com.android.launcher3.logging; -import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType.NAVBAR; - import android.util.ArrayMap; import android.util.SparseArray; import android.view.View; @@ -27,12 +25,9 @@ import com.android.launcher3.ItemInfo; import com.android.launcher3.LauncherSettings; import com.android.launcher3.userevent.nano.LauncherLogExtensions.TargetExtension; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; -import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; -import com.android.launcher3.userevent.nano.LauncherLogProto.ControlType; import com.android.launcher3.userevent.nano.LauncherLogProto.ItemType; import com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent; import com.android.launcher3.userevent.nano.LauncherLogProto.Target; -import com.android.launcher3.userevent.nano.LauncherLogProto.TipType; import com.android.launcher3.util.InstantAppResolver; import java.lang.reflect.Field; @@ -70,93 +65,6 @@ public class LoggerUtils { return result != null ? result : UNKNOWN; } - public static String getActionStr(Action action) { - String str = ""; - switch (action.type) { - case Action.Type.TOUCH: - str += getFieldName(action.touch, Action.Touch.class); - if (action.touch == Action.Touch.SWIPE || action.touch == Action.Touch.FLING) { - str += " direction=" + getFieldName(action.dir, Action.Direction.class); - } - break; - case Action.Type.COMMAND: - str += getFieldName(action.command, Action.Command.class); - break; - default: return getFieldName(action.type, Action.Type.class); - } - if (action.touch == Action.Touch.SWIPE || action.touch == Action.Touch.FLING || - (action.command == Action.Command.BACK && action.dir != Action.Direction.NONE)) { - str += " direction=" + getFieldName(action.dir, Action.Direction.class); - } - return str; - } - - public static String getTargetStr(Target t) { - if (t == null) { - return ""; - } - String str = ""; - switch (t.type) { - case Target.Type.ITEM: - str = getItemStr(t); - break; - case Target.Type.CONTROL: - str = getFieldName(t.controlType, ControlType.class); - break; - case Target.Type.CONTAINER: - str = getFieldName(t.containerType, ContainerType.class); - if (t.containerType == ContainerType.WORKSPACE || - t.containerType == ContainerType.HOTSEAT || - t.containerType == NAVBAR) { - str += " id=" + t.pageIndex; - } else if (t.containerType == ContainerType.FOLDER) { - str += " grid(" + t.gridX + "," + t.gridY + ")"; - } - break; - default: - str += "UNKNOWN TARGET TYPE"; - } - - if (t.spanX != 1 || t.spanY != 1) { - str += " span(" + t.spanX + "," + t.spanY + ")"; - } - - if (t.tipType != TipType.DEFAULT_NONE) { - str += " " + getFieldName(t.tipType, TipType.class); - } - - return str; - } - - private static String getItemStr(Target t) { - String typeStr = getFieldName(t.itemType, ItemType.class); - if (t.packageNameHash != 0) { - typeStr += ", packageHash=" + t.packageNameHash; - } - if (t.componentHash != 0) { - typeStr += ", componentHash=" + t.componentHash; - } - if (t.intentHash != 0) { - typeStr += ", intentHash=" + t.intentHash; - } - if (t.itemType == ItemType.FOLDER_ICON) { - typeStr += ", grid(" + t.gridX + "," + t.gridY + ")"; - } else if ((t.packageNameHash != 0 || t.componentHash != 0 || t.intentHash != 0) - && t.itemType != ItemType.TASK) { - typeStr += - ", isWorkApp=" + t.isWorkApp + ", predictiveRank=" + t.predictedRank + ", grid(" - + t.gridX + "," + t.gridY + "), span(" + t.spanX + "," + t.spanY - + "), pageIdx=" + t.pageIndex; - } - if (t.searchQueryLength != 0) { - typeStr += ", searchQueryLength=" + t.searchQueryLength; - } - if (t.itemType == ItemType.TASK) { - typeStr += ", pageIdx=" + t.pageIndex; - } - return typeStr; - } - public static Target newItemTarget(int itemType) { Target t = newTarget(Target.Type.ITEM); t.itemType = itemType;