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

Commit d5309237 authored by Pinyao Ting's avatar Pinyao Ting Committed by Automerger Merge Worker
Browse files

Merge "Shortcut integration with AppSearch (Part 2)" into sc-dev am: 4a08dabf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13554654

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6e2e7e66077d949700ce909ab5d4dd06516e3e0b
parents 45a15e2d 4a08dabf
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);