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
This commit is contained in:
@@ -21231,8 +21231,13 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
if (packageName == null) {
|
if (packageName == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (getPackageInfo(packageName, MATCH_FACTORY_ONLY, UserHandle.USER_SYSTEM) == null) {
|
long token = Binder.clearCallingIdentity();
|
||||||
return null;
|
try {
|
||||||
|
if (getPackageInfo(packageName, MATCH_FACTORY_ONLY, UserHandle.USER_SYSTEM) == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(token);
|
||||||
}
|
}
|
||||||
return packageName;
|
return packageName;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user