Launcher shortcut callback should deliver manifest shortcuts too
- Also include "activity" in the key fields, as this is now an
important field.
- Also optimize ShortcutInfo parceling for the "key field only" case.
Bug 29394043
Bug 29451629
Change-Id: I61b2bc2f61ad6ebdcbaf6d02f1bd88777c45a7f0
diff --git a/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java b/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java
index 712bc1e..d9dbd5a 100644
--- a/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java
+++ b/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java
@@ -806,11 +806,24 @@
return this;
}
+ public ShortcutListAsserter areAllWithKeyFieldsOnly() {
+ forAllShortcuts(s -> assertTrue("id=" + s.getId(), s.hasKeyFieldsOnly()));
+ return this;
+ }
+
+ public ShortcutListAsserter areAllNotWithKeyFieldsOnly() {
+ forAllShortcuts(s -> assertFalse("id=" + s.getId(), s.hasKeyFieldsOnly()));
+ return this;
+ }
+
public ShortcutListAsserter forAllShortcuts(Consumer<ShortcutInfo> sa) {
+ boolean found = false;
for (int i = 0; i < mList.size(); i++) {
final ShortcutInfo si = mList.get(i);
+ found = true;
sa.accept(si);
}
+ assertTrue("No shortcuts found.", found);
return this;
}