Merge "Disallow disabling of the package installer" into nyc-dev

This commit is contained in:
Svetoslav Ganov
2016-03-16 23:32:25 +00:00
committed by Android (Google) Code Review

View File

@@ -151,10 +151,17 @@ public class Utils {
if (sSystemSignature == null) {
sSystemSignature = new Signature[]{ getSystemSignature(pm) };
}
return sSystemSignature[0] != null && sSystemSignature[0].equals(getFirstSignature(pkg));
if (sPermissionControllerPackageName == null) {
sPermissionControllerPackageName = pm.getPermissionControllerPackageName();
}
return (sSystemSignature[0] != null
&& sSystemSignature[0].equals(getFirstSignature(pkg)))
|| (sPermissionControllerPackageName != null
&& sPermissionControllerPackageName.equals(pkg.packageName));
}
private static Signature[] sSystemSignature;
private static String sPermissionControllerPackageName;
private static Signature getFirstSignature(PackageInfo pkg) {
if (pkg != null && pkg.signatures != null && pkg.signatures.length > 0) {