From df0a90befd21a418e0dac52f5a2e25ee06828668 Mon Sep 17 00:00:00 2001 From: Joel Galenson Date: Mon, 26 Nov 2018 13:36:06 -0800 Subject: [PATCH] Remove unneeded API. jsharkey pointed out that this functionality can be replicated through Context.createPackageContextAsUser().getPackageManager().getPackageInfo(), so this isn't needed anymore. Bug: 119811056 Test: Replace callers of this API. Change-Id: I72b54b9dbe6b66f360bd5105a8628c28d92f9ed2 --- api/system-current.txt | 1 - .../android/content/pm/PackageManager.java | 27 ------------------- 2 files changed, 28 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 75a2cc45f3fa5..4760de790e454 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -1225,7 +1225,6 @@ package android.content.pm { method public abstract java.util.List getInstantApps(); method public abstract java.util.List getIntentFilterVerifications(java.lang.String); method public abstract int getIntentVerificationStatusAsUser(java.lang.String, int); - method public android.content.pm.PackageInfo getPackageInfoAsUser(java.lang.String, int, android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException; method public abstract int getPermissionFlags(java.lang.String, java.lang.String, android.os.UserHandle); method public abstract void grantRuntimePermission(java.lang.String, java.lang.String, android.os.UserHandle); method public abstract int installExistingPackage(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException; diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index ad06be3b026b2..361bebaec3a2b 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -3142,33 +3142,6 @@ public abstract class PackageManager { public abstract PackageInfo getPackageInfoAsUser(String packageName, @PackageInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; - /** - * Retrieve overall information about an application package that is - * installed on the system. - * - * @param packageName The full name (i.e. com.google.apps.contacts) of the - * desired package. - * @param flags Additional option flags to modify the data returned. - * @param userHandle The user. - * @return A PackageInfo object containing information about the package. If - * flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the package - * is not found in the list of installed applications, the package - * information is retrieved from the list of uninstalled - * applications (which includes installed applications as well as - * applications with data directory i.e. applications which had been - * deleted with {@code DONT_DELETE_DATA} flag set). - * @throws NameNotFoundException if a package with the given name cannot be - * found on the system. - * @hide - */ - @RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS) - @SystemApi - public @NonNull PackageInfo getPackageInfoAsUser(@NonNull String packageName, - @PackageInfoFlags int flags, - @NonNull UserHandle userHandle) throws NameNotFoundException { - return getPackageInfoAsUser(packageName, flags, userHandle.getIdentifier()); - } - /** * Map from the current package names in use on the device to whatever * the current canonical name of that package is.