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

Commit 031d138d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clear calling identity when calling getPackageInfo in AMS.isSystemUid"

parents 62bc5f84 81a47cd6
Loading
Loading
Loading
Loading
+16 −15
Original line number Diff line number Diff line
@@ -5595,13 +5595,11 @@ public class AccountManagerService
        long ident = Binder.clearCallingIdentity();
        try {
            packages = mPackageManager.getPackagesForUid(callingUid);
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
            if (packages != null) {
                for (String name : packages) {
                    try {
                    PackageInfo packageInfo = mPackageManager.getPackageInfo(name, 0 /* flags */);
                        PackageInfo packageInfo =
                                mPackageManager.getPackageInfo(name, 0 /* flags */);
                        if (packageInfo != null
                                && (packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM)
                                != 0) {
@@ -5614,6 +5612,9 @@ public class AccountManagerService
            } else {
                Log.w(TAG, "No known packages with uid " + callingUid);
            }
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
        return false;
    }