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

Commit 2a120d44 authored by Hyunyoung Song's avatar Hyunyoung Song Committed by Android (Google) Code Review
Browse files

Merge "make sure all type of Item in DumpTarget contains component and package...

Merge "make sure all type of Item in DumpTarget contains component and package name b/36904684" into ub-launcher3-dorval
parents 8c5f2f56 52a77044
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ 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.model.nano.LauncherDumpProto;
import com.android.launcher3.model.nano.LauncherDumpProto.ContainerType;
@@ -40,11 +41,6 @@ public class DumpTargetWrapper {
        children = new ArrayList<>();
    }

    public DumpTargetWrapper(DumpTarget t) {
        this();
        node = t;
    }

    public DumpTargetWrapper(int containerType, int id) {
        this();
        node = newContainerTarget(containerType, id);
@@ -138,7 +134,13 @@ public class DumpTargetWrapper {
    public DumpTarget writeToDumpTarget(ItemInfo info) {
        node.component = info.getTargetComponent() == null? "":
                info.getTargetComponent().flattenToString();
        node.packageName = info.getIntent() == null? "": info.getIntent().getPackage();
        node.packageName = info.getTargetComponent() == null? "":
                info.getTargetComponent().getPackageName();
        if (info instanceof LauncherAppWidgetInfo) {
            node.component = ((LauncherAppWidgetInfo) info).providerName.flattenToString();
            node.packageName = ((LauncherAppWidgetInfo) info).providerName.getPackageName();
        }

        node.gridX = info.cellX;
        node.gridY = info.cellY;
        node.spanX = info.spanX;