Loading api/system-current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -2099,6 +2099,10 @@ package android.content.pm { field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.LauncherApps.AppUsageLimit> CREATOR; field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.LauncherApps.AppUsageLimit> CREATOR; } } public static class LauncherApps.ShortcutQuery { method @NonNull public android.content.pm.LauncherApps.ShortcutQuery setLocusIds(@Nullable java.util.List<android.content.LocusId>); } public class PackageInstaller { public class PackageInstaller { method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean); method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean); field public static final int DATA_LOADER_TYPE_INCREMENTAL = 2; // 0x2 field public static final int DATA_LOADER_TYPE_INCREMENTAL = 2; // 0x2 Loading core/java/android/content/pm/ILauncherApps.aidl +6 −3 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.IApplicationThread; import android.content.ComponentName; import android.content.ComponentName; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.LocusId; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo; import android.content.pm.IOnAppsChangedListener; import android.content.pm.IOnAppsChangedListener; Loading Loading @@ -67,7 +68,8 @@ interface ILauncherApps { in UserHandle user); in UserHandle user); ParceledListSlice getShortcuts(String callingPackage, long changedSince, String packageName, ParceledListSlice getShortcuts(String callingPackage, long changedSince, String packageName, in List shortcutIds, in ComponentName componentName, int flags, in UserHandle user); in List shortcutIds, in List<LocusId> locusIds, in ComponentName componentName, int flags, in UserHandle user); void pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, void pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, in UserHandle user); in UserHandle user); boolean startShortcut(String callingPackage, String packageName, String id, boolean startShortcut(String callingPackage, String packageName, String id, Loading @@ -92,7 +94,8 @@ interface ILauncherApps { ParceledListSlice getAllSessions(String callingPackage); ParceledListSlice getAllSessions(String callingPackage); void registerShortcutChangeCallback(String callingPackage, long changedSince, void registerShortcutChangeCallback(String callingPackage, long changedSince, String packageName, in List shortcutIds, in ComponentName componentName, int flags, String packageName, in List shortcutIds, in List<LocusId> locusIds, in IShortcutChangeCallback callback, int callbackId); in ComponentName componentName, int flags, in IShortcutChangeCallback callback, int callbackId); void unregisterShortcutChangeCallback(String callingPackage, int callbackId); void unregisterShortcutChangeCallback(String callingPackage, int callbackId); } } core/java/android/content/pm/LauncherApps.java +22 −4 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.LocusId; import android.content.pm.PackageInstaller.SessionCallback; import android.content.pm.PackageInstaller.SessionCallback; import android.content.pm.PackageInstaller.SessionCallbackDelegate; import android.content.pm.PackageInstaller.SessionCallbackDelegate; import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageInstaller.SessionInfo; Loading Loading @@ -414,6 +415,9 @@ public class LauncherApps { @Nullable @Nullable List<String> mShortcutIds; List<String> mShortcutIds; @Nullable List<LocusId> mLocusIds; @Nullable @Nullable ComponentName mActivity; ComponentName mActivity; Loading Loading @@ -450,6 +454,19 @@ public class LauncherApps { return this; return this; } } /** * If non-null, return only the specified shortcuts by locus ID. When setting this field, * a package name must also be set with {@link #setPackage}. * * @hide */ @SystemApi @NonNull public ShortcutQuery setLocusIds(@Nullable List<LocusId> locusIds) { mLocusIds = locusIds; return this; } /** /** * If non-null, returns only shortcuts associated with the activity; i.e. * If non-null, returns only shortcuts associated with the activity; i.e. * {@link ShortcutInfo}s whose {@link ShortcutInfo#getActivity()} are equal * {@link ShortcutInfo}s whose {@link ShortcutInfo#getActivity()} are equal Loading Loading @@ -1022,8 +1039,8 @@ public class LauncherApps { // changed callback, but that only returns shortcuts with the "key" information, so // changed callback, but that only returns shortcuts with the "key" information, so // that won't return disabled message. // that won't return disabled message. return maybeUpdateDisabledMessage(mService.getShortcuts(mContext.getPackageName(), return maybeUpdateDisabledMessage(mService.getShortcuts(mContext.getPackageName(), query.mChangedSince, query.mPackage, query.mShortcutIds, query.mActivity, query.mChangedSince, query.mPackage, query.mShortcutIds, query.mLocusIds, query.mQueryFlags, user) query.mActivity, query.mQueryFlags, user) .getList()); .getList()); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); Loading Loading @@ -1680,8 +1697,9 @@ public class LauncherApps { mShortcutChangeCallbacks.put(callbackId, state); mShortcutChangeCallbacks.put(callbackId, state); try { try { mService.registerShortcutChangeCallback(mContext.getPackageName(), mService.registerShortcutChangeCallback(mContext.getPackageName(), query.mChangedSince, query.mPackage, query.mShortcutIds, query.mActivity, query.mChangedSince, query.mPackage, query.mShortcutIds, query.mLocusIds, query.mQueryFlags, new ShortcutChangeCallbackProxy(state), callbackId); query.mActivity, query.mQueryFlags, new ShortcutChangeCallbackProxy(state), callbackId); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading core/java/android/content/pm/ShortcutServiceInternal.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.appwidget.AppWidgetProviderInfo; import android.content.ComponentName; import android.content.ComponentName; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.LocusId; import android.content.pm.LauncherApps.ShortcutQuery; import android.content.pm.LauncherApps.ShortcutQuery; import android.os.Bundle; import android.os.Bundle; import android.os.ParcelFileDescriptor; import android.os.ParcelFileDescriptor; Loading @@ -45,8 +46,8 @@ public abstract class ShortcutServiceInternal { getShortcuts(int launcherUserId, getShortcuts(int launcherUserId, @NonNull String callingPackage, long changedSince, @NonNull String callingPackage, long changedSince, @Nullable String packageName, @Nullable List<String> shortcutIds, @Nullable String packageName, @Nullable List<String> shortcutIds, @Nullable ComponentName componentName, @ShortcutQuery.QueryFlags int flags, @Nullable List<LocusId> locusIds, @Nullable ComponentName componentName, int userId, int callingPid, int callingUid); @ShortcutQuery.QueryFlags int flags, int userId, int callingPid, int callingUid); public abstract boolean public abstract boolean isPinnedByCaller(int launcherUserId, @NonNull String callingPackage, isPinnedByCaller(int launcherUserId, @NonNull String callingPackage, Loading services/core/java/com/android/server/pm/LauncherAppsService.java +12 −6 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.LocusId; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo; import android.content.pm.ILauncherApps; import android.content.pm.ILauncherApps; Loading Loading @@ -662,8 +663,8 @@ public class LauncherAppsService extends SystemService { @Override @Override public ParceledListSlice getShortcuts(String callingPackage, long changedSince, public ParceledListSlice getShortcuts(String callingPackage, long changedSince, String packageName, List shortcutIds, ComponentName componentName, int flags, String packageName, List shortcutIds, List<LocusId> locusIds, UserHandle targetUser) { ComponentName componentName, int flags, UserHandle targetUser) { ensureShortcutPermission(callingPackage); ensureShortcutPermission(callingPackage); if (!canAccessProfile(targetUser.getIdentifier(), "Cannot get shortcuts")) { if (!canAccessProfile(targetUser.getIdentifier(), "Cannot get shortcuts")) { return new ParceledListSlice<>(Collections.EMPTY_LIST); return new ParceledListSlice<>(Collections.EMPTY_LIST); Loading @@ -672,19 +673,24 @@ public class LauncherAppsService extends SystemService { throw new IllegalArgumentException( throw new IllegalArgumentException( "To query by shortcut ID, package name must also be set"); "To query by shortcut ID, package name must also be set"); } } if (locusIds != null && packageName == null) { throw new IllegalArgumentException( "To query by locus ID, package name must also be set"); } // TODO(b/29399275): Eclipse compiler requires explicit List<ShortcutInfo> cast below. // TODO(b/29399275): Eclipse compiler requires explicit List<ShortcutInfo> cast below. return new ParceledListSlice<>((List<ShortcutInfo>) return new ParceledListSlice<>((List<ShortcutInfo>) mShortcutServiceInternal.getShortcuts(getCallingUserId(), mShortcutServiceInternal.getShortcuts(getCallingUserId(), callingPackage, changedSince, packageName, shortcutIds, callingPackage, changedSince, packageName, shortcutIds, locusIds, componentName, flags, targetUser.getIdentifier(), componentName, flags, targetUser.getIdentifier(), injectBinderCallingPid(), injectBinderCallingUid())); injectBinderCallingPid(), injectBinderCallingUid())); } } @Override @Override public void registerShortcutChangeCallback(String callingPackage, long changedSince, public void registerShortcutChangeCallback(String callingPackage, long changedSince, String packageName, List shortcutIds, ComponentName componentName, int flags, String packageName, List shortcutIds, List<LocusId> locusIds, IShortcutChangeCallback callback, int callbackId) { ComponentName componentName, int flags, IShortcutChangeCallback callback, int callbackId) { } } @Override @Override Loading Loading @@ -1148,7 +1154,7 @@ public class LauncherAppsService extends SystemService { mShortcutServiceInternal.getShortcuts(launcherUserId, mShortcutServiceInternal.getShortcuts(launcherUserId, cookie.packageName, cookie.packageName, /* changedSince= */ 0, packageName, /* shortcutIds=*/ null, /* changedSince= */ 0, packageName, /* shortcutIds=*/ null, /* component= */ null, /* locusIds=*/ null, /* component= */ null, ShortcutQuery.FLAG_GET_KEY_FIELDS_ONLY ShortcutQuery.FLAG_GET_KEY_FIELDS_ONLY | ShortcutQuery.FLAG_MATCH_ALL_KINDS_WITH_ALL_PINNED | ShortcutQuery.FLAG_MATCH_ALL_KINDS_WITH_ALL_PINNED , userId, cookie.callingPid, cookie.callingUid); , userId, cookie.callingPid, cookie.callingUid); Loading Loading
api/system-current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -2099,6 +2099,10 @@ package android.content.pm { field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.LauncherApps.AppUsageLimit> CREATOR; field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.LauncherApps.AppUsageLimit> CREATOR; } } public static class LauncherApps.ShortcutQuery { method @NonNull public android.content.pm.LauncherApps.ShortcutQuery setLocusIds(@Nullable java.util.List<android.content.LocusId>); } public class PackageInstaller { public class PackageInstaller { method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean); method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean); field public static final int DATA_LOADER_TYPE_INCREMENTAL = 2; // 0x2 field public static final int DATA_LOADER_TYPE_INCREMENTAL = 2; // 0x2 Loading
core/java/android/content/pm/ILauncherApps.aidl +6 −3 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.IApplicationThread; import android.content.ComponentName; import android.content.ComponentName; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.LocusId; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo; import android.content.pm.IOnAppsChangedListener; import android.content.pm.IOnAppsChangedListener; Loading Loading @@ -67,7 +68,8 @@ interface ILauncherApps { in UserHandle user); in UserHandle user); ParceledListSlice getShortcuts(String callingPackage, long changedSince, String packageName, ParceledListSlice getShortcuts(String callingPackage, long changedSince, String packageName, in List shortcutIds, in ComponentName componentName, int flags, in UserHandle user); in List shortcutIds, in List<LocusId> locusIds, in ComponentName componentName, int flags, in UserHandle user); void pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, void pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, in UserHandle user); in UserHandle user); boolean startShortcut(String callingPackage, String packageName, String id, boolean startShortcut(String callingPackage, String packageName, String id, Loading @@ -92,7 +94,8 @@ interface ILauncherApps { ParceledListSlice getAllSessions(String callingPackage); ParceledListSlice getAllSessions(String callingPackage); void registerShortcutChangeCallback(String callingPackage, long changedSince, void registerShortcutChangeCallback(String callingPackage, long changedSince, String packageName, in List shortcutIds, in ComponentName componentName, int flags, String packageName, in List shortcutIds, in List<LocusId> locusIds, in IShortcutChangeCallback callback, int callbackId); in ComponentName componentName, int flags, in IShortcutChangeCallback callback, int callbackId); void unregisterShortcutChangeCallback(String callingPackage, int callbackId); void unregisterShortcutChangeCallback(String callingPackage, int callbackId); } }
core/java/android/content/pm/LauncherApps.java +22 −4 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.LocusId; import android.content.pm.PackageInstaller.SessionCallback; import android.content.pm.PackageInstaller.SessionCallback; import android.content.pm.PackageInstaller.SessionCallbackDelegate; import android.content.pm.PackageInstaller.SessionCallbackDelegate; import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageInstaller.SessionInfo; Loading Loading @@ -414,6 +415,9 @@ public class LauncherApps { @Nullable @Nullable List<String> mShortcutIds; List<String> mShortcutIds; @Nullable List<LocusId> mLocusIds; @Nullable @Nullable ComponentName mActivity; ComponentName mActivity; Loading Loading @@ -450,6 +454,19 @@ public class LauncherApps { return this; return this; } } /** * If non-null, return only the specified shortcuts by locus ID. When setting this field, * a package name must also be set with {@link #setPackage}. * * @hide */ @SystemApi @NonNull public ShortcutQuery setLocusIds(@Nullable List<LocusId> locusIds) { mLocusIds = locusIds; return this; } /** /** * If non-null, returns only shortcuts associated with the activity; i.e. * If non-null, returns only shortcuts associated with the activity; i.e. * {@link ShortcutInfo}s whose {@link ShortcutInfo#getActivity()} are equal * {@link ShortcutInfo}s whose {@link ShortcutInfo#getActivity()} are equal Loading Loading @@ -1022,8 +1039,8 @@ public class LauncherApps { // changed callback, but that only returns shortcuts with the "key" information, so // changed callback, but that only returns shortcuts with the "key" information, so // that won't return disabled message. // that won't return disabled message. return maybeUpdateDisabledMessage(mService.getShortcuts(mContext.getPackageName(), return maybeUpdateDisabledMessage(mService.getShortcuts(mContext.getPackageName(), query.mChangedSince, query.mPackage, query.mShortcutIds, query.mActivity, query.mChangedSince, query.mPackage, query.mShortcutIds, query.mLocusIds, query.mQueryFlags, user) query.mActivity, query.mQueryFlags, user) .getList()); .getList()); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); Loading Loading @@ -1680,8 +1697,9 @@ public class LauncherApps { mShortcutChangeCallbacks.put(callbackId, state); mShortcutChangeCallbacks.put(callbackId, state); try { try { mService.registerShortcutChangeCallback(mContext.getPackageName(), mService.registerShortcutChangeCallback(mContext.getPackageName(), query.mChangedSince, query.mPackage, query.mShortcutIds, query.mActivity, query.mChangedSince, query.mPackage, query.mShortcutIds, query.mLocusIds, query.mQueryFlags, new ShortcutChangeCallbackProxy(state), callbackId); query.mActivity, query.mQueryFlags, new ShortcutChangeCallbackProxy(state), callbackId); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading
core/java/android/content/pm/ShortcutServiceInternal.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.appwidget.AppWidgetProviderInfo; import android.content.ComponentName; import android.content.ComponentName; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.LocusId; import android.content.pm.LauncherApps.ShortcutQuery; import android.content.pm.LauncherApps.ShortcutQuery; import android.os.Bundle; import android.os.Bundle; import android.os.ParcelFileDescriptor; import android.os.ParcelFileDescriptor; Loading @@ -45,8 +46,8 @@ public abstract class ShortcutServiceInternal { getShortcuts(int launcherUserId, getShortcuts(int launcherUserId, @NonNull String callingPackage, long changedSince, @NonNull String callingPackage, long changedSince, @Nullable String packageName, @Nullable List<String> shortcutIds, @Nullable String packageName, @Nullable List<String> shortcutIds, @Nullable ComponentName componentName, @ShortcutQuery.QueryFlags int flags, @Nullable List<LocusId> locusIds, @Nullable ComponentName componentName, int userId, int callingPid, int callingUid); @ShortcutQuery.QueryFlags int flags, int userId, int callingPid, int callingUid); public abstract boolean public abstract boolean isPinnedByCaller(int launcherUserId, @NonNull String callingPackage, isPinnedByCaller(int launcherUserId, @NonNull String callingPackage, Loading
services/core/java/com/android/server/pm/LauncherAppsService.java +12 −6 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.LocusId; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo; import android.content.pm.ILauncherApps; import android.content.pm.ILauncherApps; Loading Loading @@ -662,8 +663,8 @@ public class LauncherAppsService extends SystemService { @Override @Override public ParceledListSlice getShortcuts(String callingPackage, long changedSince, public ParceledListSlice getShortcuts(String callingPackage, long changedSince, String packageName, List shortcutIds, ComponentName componentName, int flags, String packageName, List shortcutIds, List<LocusId> locusIds, UserHandle targetUser) { ComponentName componentName, int flags, UserHandle targetUser) { ensureShortcutPermission(callingPackage); ensureShortcutPermission(callingPackage); if (!canAccessProfile(targetUser.getIdentifier(), "Cannot get shortcuts")) { if (!canAccessProfile(targetUser.getIdentifier(), "Cannot get shortcuts")) { return new ParceledListSlice<>(Collections.EMPTY_LIST); return new ParceledListSlice<>(Collections.EMPTY_LIST); Loading @@ -672,19 +673,24 @@ public class LauncherAppsService extends SystemService { throw new IllegalArgumentException( throw new IllegalArgumentException( "To query by shortcut ID, package name must also be set"); "To query by shortcut ID, package name must also be set"); } } if (locusIds != null && packageName == null) { throw new IllegalArgumentException( "To query by locus ID, package name must also be set"); } // TODO(b/29399275): Eclipse compiler requires explicit List<ShortcutInfo> cast below. // TODO(b/29399275): Eclipse compiler requires explicit List<ShortcutInfo> cast below. return new ParceledListSlice<>((List<ShortcutInfo>) return new ParceledListSlice<>((List<ShortcutInfo>) mShortcutServiceInternal.getShortcuts(getCallingUserId(), mShortcutServiceInternal.getShortcuts(getCallingUserId(), callingPackage, changedSince, packageName, shortcutIds, callingPackage, changedSince, packageName, shortcutIds, locusIds, componentName, flags, targetUser.getIdentifier(), componentName, flags, targetUser.getIdentifier(), injectBinderCallingPid(), injectBinderCallingUid())); injectBinderCallingPid(), injectBinderCallingUid())); } } @Override @Override public void registerShortcutChangeCallback(String callingPackage, long changedSince, public void registerShortcutChangeCallback(String callingPackage, long changedSince, String packageName, List shortcutIds, ComponentName componentName, int flags, String packageName, List shortcutIds, List<LocusId> locusIds, IShortcutChangeCallback callback, int callbackId) { ComponentName componentName, int flags, IShortcutChangeCallback callback, int callbackId) { } } @Override @Override Loading Loading @@ -1148,7 +1154,7 @@ public class LauncherAppsService extends SystemService { mShortcutServiceInternal.getShortcuts(launcherUserId, mShortcutServiceInternal.getShortcuts(launcherUserId, cookie.packageName, cookie.packageName, /* changedSince= */ 0, packageName, /* shortcutIds=*/ null, /* changedSince= */ 0, packageName, /* shortcutIds=*/ null, /* component= */ null, /* locusIds=*/ null, /* component= */ null, ShortcutQuery.FLAG_GET_KEY_FIELDS_ONLY ShortcutQuery.FLAG_GET_KEY_FIELDS_ONLY | ShortcutQuery.FLAG_MATCH_ALL_KINDS_WITH_ALL_PINNED | ShortcutQuery.FLAG_MATCH_ALL_KINDS_WITH_ALL_PINNED , userId, cookie.callingPid, cookie.callingUid); , userId, cookie.callingPid, cookie.callingUid); Loading