Merge "Don't check apex when granting priv permission unless needed" into rvc-dev am: 19f8283a01 am: c6dfff9043 am: f5a0a6a0ea
Change-Id: I3d4e7f461efba4f50f261d8b6f6872190ba4c2a5
This commit is contained in:
committed by
Automerger Merge Worker
commit
1592ff0631
@@ -3319,17 +3319,19 @@ public class PermissionManagerService extends IPermissionManager.Stub {
|
|||||||
if (!privappPermissionsDisable && privilegedPermission && pkg.isPrivileged()
|
if (!privappPermissionsDisable && privilegedPermission && pkg.isPrivileged()
|
||||||
&& !platformPackage && platformPermission) {
|
&& !platformPackage && platformPermission) {
|
||||||
if (!hasPrivappWhitelistEntry(perm, pkg)) {
|
if (!hasPrivappWhitelistEntry(perm, pkg)) {
|
||||||
ApexManager apexMgr = ApexManager.getInstance();
|
|
||||||
String apexContainingPkg = apexMgr.getActiveApexPackageNameContainingPackage(pkg);
|
|
||||||
|
|
||||||
// Only enforce whitelist this on boot
|
// Only enforce whitelist this on boot
|
||||||
if (!mSystemReady
|
if (!mSystemReady
|
||||||
// Updated system apps do not need to be whitelisted
|
// Updated system apps do not need to be whitelisted
|
||||||
&& !pkgSetting.getPkgState().isUpdatedSystemApp()
|
&& !pkgSetting.getPkgState().isUpdatedSystemApp()) {
|
||||||
|
ApexManager apexMgr = ApexManager.getInstance();
|
||||||
|
String apexContainingPkg = apexMgr.getActiveApexPackageNameContainingPackage(
|
||||||
|
pkg);
|
||||||
|
|
||||||
// Apps that are in updated apexs' do not need to be whitelisted
|
// Apps that are in updated apexs' do not need to be whitelisted
|
||||||
&& (apexContainingPkg == null || apexMgr.isFactory(
|
if (apexContainingPkg == null || apexMgr.isFactory(
|
||||||
apexMgr.getPackageInfo(apexContainingPkg, MATCH_ACTIVE_PACKAGE)))) {
|
apexMgr.getPackageInfo(apexContainingPkg, MATCH_ACTIVE_PACKAGE))) {
|
||||||
// it's only a reportable violation if the permission isn't explicitly denied
|
// it's only a reportable violation if the permission isn't explicitly
|
||||||
|
// denied
|
||||||
ArraySet<String> deniedPermissions = null;
|
ArraySet<String> deniedPermissions = null;
|
||||||
if (pkg.isVendor()) {
|
if (pkg.isVendor()) {
|
||||||
deniedPermissions = SystemConfig.getInstance()
|
deniedPermissions = SystemConfig.getInstance()
|
||||||
@@ -3356,12 +3358,14 @@ public class PermissionManagerService extends IPermissionManager.Stub {
|
|||||||
mPrivappPermissionsViolations = new ArraySet<>();
|
mPrivappPermissionsViolations = new ArraySet<>();
|
||||||
}
|
}
|
||||||
mPrivappPermissionsViolations.add(
|
mPrivappPermissionsViolations.add(
|
||||||
pkg.getPackageName() + " (" + pkg.getCodePath() + "): " + perm);
|
pkg.getPackageName() + " (" + pkg.getCodePath() + "): "
|
||||||
|
+ perm);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (RoSystemProperties.CONTROL_PRIVAPP_PERMISSIONS_ENFORCE) {
|
if (RoSystemProperties.CONTROL_PRIVAPP_PERMISSIONS_ENFORCE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user