Include additional logs for widget removal
It isn't clear what causes widgets to be removed when restoring on a new
device. This CL included additional error message, which hopefully would
reveal the root cause.
Bug: 235923862
Test: manual
Change-Id: I8601d8fe598072dc9def0549796d1e527e167e23
diff --git a/src/com/android/launcher3/model/PackageUpdatedTask.java b/src/com/android/launcher3/model/PackageUpdatedTask.java
index 489bc38..a9d272e 100644
--- a/src/com/android/launcher3/model/PackageUpdatedTask.java
+++ b/src/com/android/launcher3/model/PackageUpdatedTask.java
@@ -57,7 +57,9 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Objects;
import java.util.function.Predicate;
+import java.util.stream.Collectors;
/**
* Handles updates due to changes in package manager (app installed/updated/removed)
@@ -343,7 +345,12 @@
.or(ItemInfoMatcher.ofComponents(removedComponents, mUser))
.and(ItemInfoMatcher.ofItemIds(forceKeepShortcuts).negate());
deleteAndBindComponentsRemoved(removeMatch,
- "removed because the corresponding package or component is removed");
+ "removed because the corresponding package or component is removed. "
+ + "mOp=" + mOp + " removedPackages=" + removedPackages.stream().collect(
+ Collectors.joining(",", "[", "]"))
+ + " removedComponents=" + removedComponents.stream()
+ .filter(Objects::nonNull).map(ComponentName::toShortString)
+ .collect(Collectors.joining(",", "[", "]")));
// Remove any queued items from the install queue
ItemInstallQueue.INSTANCE.get(context)