diff options
Diffstat (limited to 'src/com/android/launcher3/logging/LoggerUtils.java')
-rw-r--r-- | src/com/android/launcher3/logging/LoggerUtils.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/com/android/launcher3/logging/LoggerUtils.java b/src/com/android/launcher3/logging/LoggerUtils.java index 9b75b43b4..598792abc 100644 --- a/src/com/android/launcher3/logging/LoggerUtils.java +++ b/src/com/android/launcher3/logging/LoggerUtils.java @@ -44,6 +44,7 @@ import java.lang.reflect.Modifier; public class LoggerUtils { private static final ArrayMap<Class, SparseArray<String>> sNameCache = new ArrayMap<>(); private static final String UNKNOWN = "UNKNOWN"; + private static final int DEFAULT_PREDICTED_RANK = -100; public static String getFieldName(int value, Class c) { SparseArray<String> cache; @@ -90,7 +91,7 @@ public class LoggerUtils { } public static String getTargetStr(Target t) { - if (t == null){ + if (t == null) { return ""; } String str = ""; @@ -137,17 +138,16 @@ public class LoggerUtils { if (t.intentHash != 0) { typeStr += ", intentHash=" + t.intentHash; } - if ((t.packageNameHash != 0 || t.componentHash != 0 || t.intentHash != 0) && - t.itemType != ItemType.TASK) { + 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 += ", predictiveRank=" + t.predictedRank + ", grid(" + t.gridX + "," + t.gridY - + "), span(" + t.spanX + "," + t.spanY - + "), pageIdx=" + t.pageIndex; - + + "), 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; } @@ -168,17 +168,17 @@ public class LoggerUtils { public static Target newItemTarget(ItemInfo info, InstantAppResolver instantAppResolver) { Target t = newTarget(Target.Type.ITEM); - switch (info.itemType) { case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION: t.itemType = (instantAppResolver != null && info instanceof AppInfo - && instantAppResolver.isInstantApp(((AppInfo) info)) ) + && instantAppResolver.isInstantApp(((AppInfo) info))) ? ItemType.WEB_APP : ItemType.APP_ICON; - t.predictedRank = -100; // Never assigned + t.predictedRank = DEFAULT_PREDICTED_RANK; break; case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT: t.itemType = ItemType.SHORTCUT; + t.predictedRank = DEFAULT_PREDICTED_RANK; break; case LauncherSettings.Favorites.ITEM_TYPE_FOLDER: t.itemType = ItemType.FOLDER_ICON; @@ -188,6 +188,7 @@ public class LoggerUtils { break; case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT: t.itemType = ItemType.DEEPSHORTCUT; + t.predictedRank = DEFAULT_PREDICTED_RANK; break; } return t; |