diff options
Diffstat (limited to 'PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/LightAppPermGroup.kt')
-rw-r--r-- | PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/LightAppPermGroup.kt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/LightAppPermGroup.kt b/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/LightAppPermGroup.kt index 356f4e52f..64d63bd1a 100644 --- a/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/LightAppPermGroup.kt +++ b/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/LightAppPermGroup.kt @@ -189,11 +189,15 @@ data class LightAppPermGroup( val isGranted = specialLocationGrant ?: permissions.any { it.value.isGrantedIncludingAppOp } /** - * Whether any of this App Permission SubGroup's permissions are granted excluding - * auto granted permissions during install time with flag RevokeWhenRequested + * Whether this App Permission SubGroup should be treated as granted. This means either: + * 1) At least one permission was granted excluding auto-granted permissions (i.e., granted + * during install time with flag RevokeWhenRequested.) Or, + * 2) All permissions were auto-granted (all permissions are all granted and all + * RevokeWhenRequested.) */ - val isGrantedExcludeRevokeWhenRequestedPermissions = specialLocationGrant ?: permissions - .any { it.value.isGrantedIncludingAppOp && !it.value.isRevokeWhenRequested } + val isGrantedExcludingRWROrAllRWR = specialLocationGrant ?: (permissions + .any { it.value.isGrantedIncludingAppOp && !it.value.isRevokeWhenRequested } || + permissions.all { it.value.isGrantedIncludingAppOp && it.value.isRevokeWhenRequested }) /** * Whether any of this App Permission SubGroup's permissions are granted by default |