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
(cherry picked from commit e693b797bc)
This commit is contained in:
committed by
android-build-team Robot
parent
8d0ae5c65c
commit
f98e1086f5
@@ -21228,8 +21228,13 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
if (packageName == null) {
|
||||
return null;
|
||||
}
|
||||
if (getPackageInfo(packageName, MATCH_FACTORY_ONLY, UserHandle.USER_SYSTEM) == 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user