Pre-grant the location permission to the system Maps app on AAOS for Android T and after

BUG=206403774

Change-Id: I713293dba649d412b41432eb0571e11973c063d4
This commit is contained in:
Wen Zhang
2021-11-17 04:10:35 +00:00
parent 01fa40ba0c
commit 2c155d5ff8

View File

@@ -702,6 +702,14 @@ final class DefaultPermissionGrantPolicy {
DevicePolicyManager.ACTION_PROVISION_MANAGED_DEVICE, userId),
userId, CONTACTS_PERMISSIONS);
// Maps
if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE, 0)) {
grantPermissionsToSystemPackage(pm,
getDefaultSystemHandlerActivityPackageForCategory(pm,
Intent.CATEGORY_APP_MAPS, userId),
userId, FOREGROUND_LOCATION_PERMISSIONS);
}
// Email
grantPermissionsToSystemPackage(pm,
getDefaultSystemHandlerActivityPackageForCategory(pm,