Propagate whitelisted perms during install

Before there were only two choices: All or none

Fixes: 135618953
Test: atest CtsPermission2TestCases:android.permission2.cts.RestrictedPermissionsTest
Change-Id: I0989cb2c303bf508674042a2a07fbddec3e5be64
This commit is contained in:
Philip P. Moltmann
2019-06-19 12:58:48 -07:00
parent 61a878126c
commit c0aebc6ba1

View File

@@ -1507,7 +1507,8 @@ public class PackageManagerService extends IPackageManager.Stub
final List<String> whitelistedRestrictedPermissions = ((args.installFlags
& PackageManager.INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS) != 0
&& parentRes.pkg != null)
? parentRes.pkg.requestedPermissions : null;
? parentRes.pkg.requestedPermissions
: args.whitelistedRestrictedPermissions;
// Handle the parent package
handlePackagePostInstall(parentRes, grantPermissions,