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

Commit a379f499 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow assistant app to access any shortcuts"

parents 60303333 35559d61
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10574,6 +10574,7 @@ package android.content.pm {
    field public static final int FLAG_MATCH_DYNAMIC = 1; // 0x1
    field public static final int FLAG_MATCH_MANIFEST = 8; // 0x8
    field public static final int FLAG_MATCH_PINNED = 2; // 0x2
    field public static final int FLAG_MATCH_PINNED_BY_ANY_LAUNCHER = 1024; // 0x400
  }
  public class PackageInfo implements android.os.Parcelable {
+1 −0
Original line number Diff line number Diff line
@@ -11192,6 +11192,7 @@ package android.content.pm {
    field public static final int FLAG_MATCH_DYNAMIC = 1; // 0x1
    field public static final int FLAG_MATCH_MANIFEST = 8; // 0x8
    field public static final int FLAG_MATCH_PINNED = 2; // 0x2
    field public static final int FLAG_MATCH_PINNED_BY_ANY_LAUNCHER = 1024; // 0x400
  }
  public class PackageInfo implements android.os.Parcelable {
+1 −1
Original line number Diff line number Diff line
@@ -10653,10 +10653,10 @@ package android.content.pm {
    method public android.content.pm.LauncherApps.ShortcutQuery setQueryFlags(int);
    method public android.content.pm.LauncherApps.ShortcutQuery setShortcutIds(java.util.List<java.lang.String>);
    field public static final int FLAG_GET_KEY_FIELDS_ONLY = 4; // 0x4
    field public static final int FLAG_MATCH_ALL_PINNED = 1024; // 0x400
    field public static final int FLAG_MATCH_DYNAMIC = 1; // 0x1
    field public static final int FLAG_MATCH_MANIFEST = 8; // 0x8
    field public static final int FLAG_MATCH_PINNED = 2; // 0x2
    field public static final int FLAG_MATCH_PINNED_BY_ANY_LAUNCHER = 1024; // 0x400
  }
  public class PackageInfo implements android.os.Parcelable {
+6 −6
Original line number Diff line number Diff line
@@ -282,13 +282,13 @@ public class LauncherApps {
        public static final int FLAG_GET_MANIFEST = FLAG_MATCH_MANIFEST;

        /**
         * @hide include all pinned shortcuts by any launchers, not just by the caller,
         * Include all pinned shortcuts by any launchers, not just by the caller,
         * in the result.
         * If the caller doesn't havve the {@link android.Manifest.permission#ACCESS_SHORTCUTS}
         * permission, this flag will be ignored.
         *
         * The caller must be the selected assistant app to use this flag, or have the system
         * {@code ACCESS_SHORTCUTS} permission.
         */
        @TestApi
        public static final int FLAG_MATCH_ALL_PINNED = 1 << 10;
        public static final int FLAG_MATCH_PINNED_BY_ANY_LAUNCHER = 1 << 10;

        /**
         * FLAG_MATCH_DYNAMIC | FLAG_MATCH_PINNED | FLAG_MATCH_MANIFEST
@@ -302,7 +302,7 @@ public class LauncherApps {
         * @hide
         */
        public static final int FLAG_MATCH_ALL_KINDS_WITH_ALL_PINNED =
                FLAG_MATCH_ALL_KINDS | FLAG_MATCH_ALL_PINNED;
                FLAG_MATCH_ALL_KINDS | FLAG_MATCH_PINNED_BY_ANY_LAUNCHER;

        /** @hide kept for unit tests */
        @Deprecated
+8 −2
Original line number Diff line number Diff line
@@ -615,10 +615,16 @@ class ShortcutPackage extends ShortcutPackageItem {

            // Fix up isPinned for the caller.  Note we need to do it before the "test" callback,
            // since it may check isPinned.
            // However, if getPinnedByAnyLauncher is set, we do it after the test.
            if (!getPinnedByAnyLauncher) {
                if (!isPinnedByCaller) {
                    clone.clearFlags(ShortcutInfo.FLAG_PINNED);
                }
            }
            if (query == null || query.test(clone)) {
                if (!isPinnedByCaller) {
                    clone.clearFlags(ShortcutInfo.FLAG_PINNED);
                }
                result.add(clone);
            }
        }
Loading