Log the reason why a WorkspaceItemInfo was removed

In the past we've seen a WorkspaceItem disappeared from the workspace
but wasn't able to determine why it was removed. This CL includes the
reason why it was removed in the error log, which hopefully would help
us debugging similar issues in the future.

Bug: 231239260
Test: make
Change-Id: Iba3d57568c9b3e011a6b65b26f0d4170d42fe1a5
This commit is contained in:
Pinyao Ting
2022-05-10 23:47:36 +00:00
parent 9c7551a9c9
commit 6a41d56b50
12 changed files with 67 additions and 31 deletions

View File

@@ -176,7 +176,8 @@ public class ItemClickHandler {
.setNeutralButton(R.string.abandoned_clean_this,
(d, i) -> launcher.getWorkspace()
.persistRemoveItemsByMatcher(ItemInfoMatcher.ofPackages(
Collections.singleton(packageName), user)))
Collections.singleton(packageName), user),
"user explicitly removes the promise app icon"))
.create().show();
}
@@ -259,7 +260,8 @@ public class ItemClickHandler {
// Remove the icon if launcher is successfully initialized
launcher.getWorkspace().persistRemoveItemsByMatcher(ItemInfoMatcher
.ofShortcutKeys(Collections.singleton(ShortcutKey
.fromItemInfo(shortcut))));
.fromItemInfo(shortcut))),
"user explicitly removes disabled shortcut");
})
.create()
.show();