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

Commit 4a08dabf authored by Pinyao Ting's avatar Pinyao Ting Committed by Android (Google) Code Review
Browse files

Merge "Shortcut integration with AppSearch (Part 2)" into sc-dev

parents 77beac00 47d1a022
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);