summaryrefslogtreecommitdiff
path: root/src/com/android/launcher3/PendingAddItemInfo.java
diff options
context:
space:
mode:
authorthiruram <thiruram@google.com>2020-05-06 22:19:43 -0700
committerthiruram <thiruram@google.com>2020-05-18 16:44:46 -0700
commit6bf6848951666ed1f5d4779f62ef98643aabb351 (patch)
tree62583adb4cebd3786524b9586a348034e11eb907 /src/com/android/launcher3/PendingAddItemInfo.java
parent4ae95beb9bbfb002deb73f644b28edfa3f5c27fa (diff)
downloadLauncher3-6bf6848951666ed1f5d4779f62ef98643aabb351.tar.gz
Introduces CONTAINER_WIDGETS_TRAY to LauncherSettings.Favorites.
This would log LAUNCHER_ITEM_DRAG_STARTED event when an item is dragged from widgets tray. This also fixes empty component with widget logs. Sample Log: https://docs.google.com/document/d/1CBP2yTcXdFhPdNG5ZmWFKSgd8mDbMevY-akVlUXPLDo/edit#bookmark=id.bk5w3n8uwhcl Bug: 152978018 Change-Id: I51d16edae13973d5e62adda0e4efa861fa10dc1b
Diffstat (limited to 'src/com/android/launcher3/PendingAddItemInfo.java')
-rw-r--r--src/com/android/launcher3/PendingAddItemInfo.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/com/android/launcher3/PendingAddItemInfo.java b/src/com/android/launcher3/PendingAddItemInfo.java
index 29c9d935ae..be994ee138 100644
--- a/src/com/android/launcher3/PendingAddItemInfo.java
+++ b/src/com/android/launcher3/PendingAddItemInfo.java
@@ -18,12 +18,15 @@ package com.android.launcher3;
import android.content.ComponentName;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.model.data.ItemInfo;
+import java.util.Optional;
+
/**
- * Meta data that is used for deferred binding.
- * e.g., this object is used to pass information on draggable targets when they are dropped onto
- * the workspace from another container.
+ * Meta data that is used for deferred binding. e.g., this object is used to pass information on
+ * draggable targets when they are dropped onto the workspace from another container.
*/
public class PendingAddItemInfo extends ItemInfo {
@@ -36,4 +39,22 @@ public class PendingAddItemInfo extends ItemInfo {
protected String dumpProperties() {
return super.dumpProperties() + " componentName=" + componentName;
}
+
+ /**
+ * Returns shallow copy of the object.
+ */
+ @Override
+ public ItemInfo makeShallowCopy() {
+ PendingAddItemInfo itemInfo = new PendingAddItemInfo();
+ itemInfo.copyFrom(this);
+ itemInfo.componentName = this.componentName;
+ return itemInfo;
+ }
+
+ @Nullable
+ @Override
+ public ComponentName getTargetComponent() {
+ return Optional.ofNullable(super.getTargetComponent()).orElse(componentName);
+ }
+
}