summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-12-22 00:19:17 (GMT)
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-12-22 00:19:17 (GMT)
commit87a96bc0450699417d0d73a53336a7515edec530 (patch)
tree5d8e7818fe70ca8beec15ebb06275a885225f4a4
parent9f825b2d4ae8c8aa106a70860675a753bef29f99 (diff)
parentb0738b0739dac1dc8b55e3c83e36188ba66974e9 (diff)
downloadandroid_packages_apps_Trebuchet-87a96bc0450699417d0d73a53336a7515edec530.zip
android_packages_apps_Trebuchet-87a96bc0450699417d0d73a53336a7515edec530.tar.gz
android_packages_apps_Trebuchet-87a96bc0450699417d0d73a53336a7515edec530.tar.bz2
Snap for 6091872 from b0738b0739dac1dc8b55e3c83e36188ba66974e9 to qt-qpr2-release
Change-Id: If0c370913fd3e576461421af4a1c1d756c2cd018
-rw-r--r--src/com/android/launcher3/logging/DumpTargetWrapper.java32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/com/android/launcher3/logging/DumpTargetWrapper.java b/src/com/android/launcher3/logging/DumpTargetWrapper.java
index 365e8f2..067bdfd 100644
--- a/src/com/android/launcher3/logging/DumpTargetWrapper.java
+++ b/src/com/android/launcher3/logging/DumpTargetWrapper.java
@@ -15,17 +15,22 @@
*/
package com.android.launcher3.logging;
+import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
+
+import android.content.ComponentName;
import android.os.Process;
import android.text.TextUtils;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.LauncherAppWidgetInfo;
import com.android.launcher3.LauncherSettings;
+import com.android.launcher3.WorkspaceItemInfo;
import com.android.launcher3.model.nano.LauncherDumpProto;
import com.android.launcher3.model.nano.LauncherDumpProto.ContainerType;
import com.android.launcher3.model.nano.LauncherDumpProto.DumpTarget;
import com.android.launcher3.model.nano.LauncherDumpProto.ItemType;
import com.android.launcher3.model.nano.LauncherDumpProto.UserType;
+import com.android.launcher3.util.ShortcutUtil;
import java.util.ArrayList;
import java.util.List;
@@ -73,20 +78,23 @@ public class DumpTargetWrapper {
public DumpTarget newItemTarget(ItemInfo info) {
DumpTarget dt = new DumpTarget();
dt.type = DumpTarget.Type.ITEM;
-
+ if (info == null) {
+ return dt;
+ }
switch (info.itemType) {
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
dt.itemType = ItemType.APP_ICON;
break;
- case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
- dt.itemType = ItemType.UNKNOWN_ITEMTYPE;
- break;
case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
dt.itemType = ItemType.WIDGET;
break;
- case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT:
+ case ITEM_TYPE_DEEP_SHORTCUT:
+ case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
dt.itemType = ItemType.SHORTCUT;
break;
+ default:
+ dt.itemType = ItemType.UNKNOWN_ITEMTYPE;
+ break;
}
return dt;
}
@@ -120,6 +128,9 @@ public class DumpTargetWrapper {
}
private static String getItemStr(DumpTarget t) {
+ if (t == null) {
+ return "";
+ }
String typeStr = LoggerUtils.getFieldName(t.itemType, ItemType.class);
if (!TextUtils.isEmpty(t.packageName)) {
typeStr += ", package=" + t.packageName;
@@ -132,8 +143,15 @@ public class DumpTargetWrapper {
}
public DumpTarget writeToDumpTarget(ItemInfo info) {
- node.component = info.getTargetComponent() == null? "":
- info.getTargetComponent().flattenToString();
+ if (info == null) {
+ return node;
+ }
+ if (ShortcutUtil.isDeepShortcut(info)) {
+ node.component = ((WorkspaceItemInfo) info).getDeepShortcutId();
+ } else {
+ ComponentName cmp = info.getTargetComponent();
+ node.component = cmp == null ? "" : cmp.flattenToString();
+ }
node.packageName = info.getTargetComponent() == null? "":
info.getTargetComponent().getPackageName();
if (info instanceof LauncherAppWidgetInfo) {