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

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

Merge "Revise the IllegalArgumentException check" into sc-dev

parents 4c4c6d1b 30611ae5
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -26467,16 +26467,12 @@ public class PackageManagerService extends IPackageManager.Stub
        }
        synchronized(mLock) {
            final AndroidPackage pkg = mPackages.get(packageName);
            if (pkg == null) {
            if (pkg == null
                    || shouldFilterApplicationLocked(getPackageSetting(pkg.getPackageName()),
                    Binder.getCallingUid(), UserHandle.getCallingUserId())) {
                Slog.w(TAG, "KeySet requested for unknown package: " + packageName);
                throw new IllegalArgumentException("Unknown package: " + packageName);
            }
            final PackageSetting ps = getPackageSetting(pkg.getPackageName());
            if (shouldFilterApplicationLocked(
                    ps, Binder.getCallingUid(), UserHandle.getCallingUserId())) {
                Slog.w(TAG, "KeySet requested for filtered package: " + packageName);
                throw new IllegalArgumentException("Unknown package: " + packageName);
            }
            final KeySetManagerService ksms = mSettings.getKeySetManagerService();
            return new KeySet(ksms.getKeySetByAliasAndPackageNameLPr(packageName, alias));
        }