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
This commit is contained in:
Pinyao Ting committed 2022-07-19 14:43:32 -07:00
1 parent cd195b6c0a
commit 415740978b
1 file changed
+8 -1
@@ -57,7 +57,9 @@ import java.util.Collections;
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 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
.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)