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

Commit 71418947 authored by Jackal Guo's avatar Jackal Guo Committed by Android (Google) Code Review
Browse files

Merge "Rename pmInternal#getPackageUidInternal (1/4)"

parents a321b3fe a478dfcc
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -301,25 +301,12 @@ public abstract class PackageManagerInternal {
    public abstract @PackageManager.DistractionRestriction int getDistractingPackageRestrictions(
            String packageName, int userId);

    /**
     * Do a straight uid lookup for the given package/application in the given user. This enforces
     * app visibility rules and permissions. Call {@link #getPackageUidInternal} for the internal
     * implementation.
     * @deprecated Use {@link PackageManager#getPackageUid(String, int)}
     * @return The app's uid, or < 0 if the package was not found in that user
     */
    @Deprecated
    public abstract int getPackageUid(String packageName,
            @PackageInfoFlags int flags, int userId);

    /**
     * Do a straight uid lookup for the given package/application in the given user.
     * @see PackageManager#getPackageUidAsUser(String, int, int)
     * @return The app's uid, or < 0 if the package was not found in that user
     * TODO(b/148235092): rename this to getPackageUid
     */
    public abstract int getPackageUidInternal(String packageName,
            @PackageInfoFlags int flags, int userId);
    public abstract int getPackageUid(String packageName, @PackageInfoFlags int flags, int userId);

    /**
     * Retrieve all of the information we know about a particular package/application.
+1 −1
Original line number Diff line number Diff line
@@ -2160,7 +2160,7 @@ class StorageManagerService extends IStorageManager.Stub
            Slog.i(TAG, "Remounting storage for pid: " + pid);
            final String[] sharedPackages =
                    mPmInternal.getSharedUserPackagesForPackage(packageName, userId);
            final int uid = mPmInternal.getPackageUidInternal(packageName, 0, userId);
            final int uid = mPmInternal.getPackageUid(packageName, 0 /* flags */, userId);
            final String[] packages =
                    sharedPackages.length != 0 ? sharedPackages : new String[]{packageName};
            try {
+1 −1
Original line number Diff line number Diff line
@@ -605,7 +605,7 @@ public class CrossProfileAppsServiceImpl extends ICrossProfileApps.Stub {
    private boolean isPlatformSignedAppWithAutomaticProfilesPermission(
            String packageName, int[] profileIds) {
        for (int userId : profileIds) {
            final int uid = mInjector.getPackageManagerInternal().getPackageUidInternal(
            final int uid = mInjector.getPackageManagerInternal().getPackageUid(
                    packageName, /* flags= */ 0, userId);
            if (uid == -1) {
                continue;
+0 −6
Original line number Diff line number Diff line
@@ -24603,12 +24603,6 @@ public class PackageManagerService extends IPackageManager.Stub
        @Override
        public int getPackageUid(String packageName, int flags, int userId) {
            return PackageManagerService.this
                    .getPackageUid(packageName, flags, userId);
        }
        @Override
        public int getPackageUidInternal(String packageName, int flags, int userId) {
            return PackageManagerService.this
                    .getPackageUidInternal(packageName, flags, userId, Process.SYSTEM_UID);
        }
+1 −1
Original line number Diff line number Diff line
@@ -3301,7 +3301,7 @@ public class ShortcutService extends IShortcutService.Stub {

                final long token = Binder.clearCallingIdentity();
                try {
                    int packageUid = mPackageManagerInternal.getPackageUidInternal(packageName,
                    int packageUid = mPackageManagerInternal.getPackageUid(packageName,
                            PackageManager.MATCH_DIRECT_BOOT_AUTO, userId);
                    // Grant read uri permission to the caller on behalf of the shortcut owner. All
                    // granted permissions are revoked when the default launcher changes, or when
Loading