diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/content/pm/ILauncherApps.aidl | 2 | ||||
| -rw-r--r-- | core/java/android/content/pm/LauncherApps.java | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/core/java/android/content/pm/ILauncherApps.aidl b/core/java/android/content/pm/ILauncherApps.aidl index d688614f6caa..37fd3ffdeafa 100644 --- a/core/java/android/content/pm/ILauncherApps.aidl +++ b/core/java/android/content/pm/ILauncherApps.aidl @@ -90,6 +90,8 @@ interface ILauncherApps { String callingPackage, String packageName, in UserHandle user); IntentSender getShortcutConfigActivityIntent(String callingPackage, in ComponentName component, in UserHandle user); + PendingIntent getShortcutIntent(String callingPackage, String packageName, String shortcutId, + in Bundle opts, in UserHandle user); // Unregister is performed using package installer void registerPackageInstallerCallback(String callingPackage, diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java index 80fecc1a3195..8b9b73683575 100644 --- a/core/java/android/content/pm/LauncherApps.java +++ b/core/java/android/content/pm/LauncherApps.java @@ -843,6 +843,30 @@ public class LauncherApps { } /** + * Returns PendingIntent associated with specified shortcut. + * + * @param packageName The packageName of the shortcut + * @param shortcutId The id of the shortcut + * @param opts Options to pass to the PendingIntent + * @param user The UserHandle of the profile + */ + @Nullable + public PendingIntent getShortcutIntent(@NonNull final String packageName, + @NonNull final String shortcutId, @Nullable final Bundle opts, + @NonNull final UserHandle user) { + logErrorForInvalidProfileAccess(user); + if (DEBUG) { + Log.i(TAG, "GetShortcutIntent " + packageName + "/" + shortcutId + " " + user); + } + try { + return mService.getShortcutIntent( + mContext.getPackageName(), packageName, shortcutId, opts, user); + } catch (RemoteException re) { + throw re.rethrowFromSystemServer(); + } + } + + /** * Retrieves a list of config activities for creating {@link ShortcutInfo}. * * @param packageName The specific package to query. If null, it checks all installed packages |
