Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47d1a022 authored by Pinyao Ting's avatar Pinyao Ting
Browse files

Shortcut integration with AppSearch (Part 2)

In order to move shortcuts from memory into AppSearch, we need to move
the bookkeeping states associated with ShortcutInfo into AppSearch as
well. This CL updates the schema to reflect the necessary chagnes.

Bug: 151359749
Test: atest ShortcutManagerTest1 ShortcutManagerTest2 ShortcutManagerTest3 ShortcutManagerTest4 ShortcutManagerTest5 ShortcutManagerTest6 ShortcutManagerTest7 ShortcutManagerTest8 ShortcutManagerTest9 ShortcutManagerTest10 ShortcutManagerTest11
Change-Id: Iaafaf6b81504b3f80c05b7f4a996b1b5b6beaeb7
parent c19c22f2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ public class AppSearchPerson extends GenericDocument {
    public static final String KEY_IS_BOT = "isBot";
    public static final String KEY_IS_IMPORTANT = "isImportant";

    private AppSearchPerson(@NonNull GenericDocument document) {
    public AppSearchPerson(@NonNull GenericDocument document) {
        super(document);
    }

+177 −52

File changed.

Preview size limit exceeded, changes collapsed.

+5 −1
Original line number Diff line number Diff line
@@ -68,7 +68,8 @@ public final class ShortcutInfo implements Parcelable {

    private static final int IMPLICIT_RANK_MASK = 0x7fffffff;

    private static final int RANK_CHANGED_BIT = ~IMPLICIT_RANK_MASK;
    /** @hide */
    public static final int RANK_CHANGED_BIT = ~IMPLICIT_RANK_MASK;

    /** @hide */
    public static final int RANK_NOT_SET = Integer.MAX_VALUE;
@@ -1595,6 +1596,9 @@ public final class ShortcutInfo implements Parcelable {
     */
    @Nullable
    public Intent[] getIntents() {
        if (mIntents == null) {
            return null;
        }
        final Intent[] ret = new Intent[mIntents.length];

        for (int i = 0; i < ret.length; i++) {
+3 −2
Original line number Diff line number Diff line
@@ -47,15 +47,16 @@ public class AppSearchShortcutInfoTest {
        final Intent shortcutIntent = new Intent(Intent.ACTION_VIEW);
        final ShortcutInfo shortcut = new AppSearchShortcutInfo.Builder(id)
                .setActivity(activity)
                .setText(id)
                .setLongLabel(id)
                .setIconResName(shortcutIconResName)
                .setIntent(shortcutIntent)
                .setPerson(person)
                .setCategories(categorySet)
                .setFlags(ShortcutInfo.FLAG_LONG_LIVED)
                .build()
                .toShortcutInfo();
                .toShortcutInfo(0);

        assertThat(shortcut.getUserId()).isEqualTo(0);
        assertThat(shortcut.getId()).isEqualTo(id);
        assertThat(shortcut.getShortLabel()).isEqualTo(id);
        assertThat(shortcut.getIconResName()).isEqualTo(shortcutIconResName);