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

Commit e693b797 authored by Hai Zhang's avatar Hai Zhang
Browse files

Call getPackageInfo() with cleared calling identity in ensureSystemPackageName().

Otherwise non-primary users might get a SecurityException.

Bug: 145981139
Bug: 148763415
Test: manual
Change-Id: I5883e296a0d753e43075cbf0abc5dc4da91e2fca
parent 25f9b23c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -21231,9 +21231,14 @@ public class PackageManagerService extends IPackageManager.Stub
        if (packageName == null) {
            return null;
        }
        long token = Binder.clearCallingIdentity();
        try {
            if (getPackageInfo(packageName, MATCH_FACTORY_ONLY, UserHandle.USER_SYSTEM) == null) {
                return null;
            }
        } finally {
            Binder.restoreCallingIdentity(token);
        }
        return packageName;
    }