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

Commit df0a90be authored by Joel Galenson's avatar Joel Galenson
Browse files

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
parent ce7357ad
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1225,7 +1225,6 @@ package android.content.pm {
    method public abstract java.util.List<android.content.pm.InstantAppInfo> getInstantApps();
    method public abstract java.util.List<android.content.pm.IntentFilterVerificationInfo> 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;
+0 −27
Original line number Diff line number Diff line
@@ -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.