Remove manual pregrants for AttentionService (handled via roles)

AttentionService requires the CAMERA permission. This permission is
already managed via roles; specifically it is set in the
`SYSTEM_VISUAL_INTELLIGENCE` role in
PermissionController/res/xml/roles.xml. Therefore the code performing
the pre-grant manually in DefaultPermissionGrantPolicy can be removed.

Bug: 222231605
Test: adb shell dumpsys package com.google.android.as
Test: atest GtsPermissionTestCases:com.google.android.permission.gts.DefaultPermissionGrantPolicyTest#testDefaultGrantsWithRemoteExceptions
Change-Id: Ie5db64ef13a1b0258fa3f48f8d2cf05fffe7af66
This commit is contained in:
Nikita Dubrovsky
2022-03-14 17:02:33 -07:00
parent 3d790a1673
commit ed8831ed84

View File

@@ -903,14 +903,6 @@ final class DefaultPermissionGrantPolicy {
COARSE_BACKGROUND_LOCATION_PERMISSIONS, CONTACTS_PERMISSIONS);
}
// Attention Service
String attentionServicePackageName =
mContext.getPackageManager().getAttentionServicePackageName();
if (!TextUtils.isEmpty(attentionServicePackageName)) {
grantPermissionsToSystemPackage(pm, attentionServicePackageName, userId,
CAMERA_PERMISSIONS);
}
// There is no real "marker" interface to identify the shared storage backup, it is
// hardcoded in BackupManagerService.SHARED_BACKUP_AGENT_PACKAGE.
grantSystemFixedPermissionsToSystemPackage(pm, "com.android.sharedstoragebackup", userId,