diff options
| author | 2022-12-01 22:02:50 +0000 | |
|---|---|---|
| committer | 2022-12-27 00:12:07 +0000 | |
| commit | ba2336ca909aa999272f3751c7f7f22093f59712 (patch) | |
| tree | 3fbb9e82a1816bfb105fbd5c0e6f26094611ed27 /libs/androidfw/ConfigDescription.cpp | |
| parent | 2c533174522b62a72fc2432de9f3c575324a39e3 (diff) | |
SimpleManualPermissionEnforcementDetector: Handle anyOf
Handle "anyOf" style checks. @PermissionMethod now takes a parameter
indicating that, if multiple permissions are checked, any ONE of them
being granted means the permission check passes. This equates to the
same "anyOf" parameter on the @EnforcePermission annotation, so generate
fixes accordingly.
The "anyOf" logic also includes some sanity checking to prevent
suggesting a fix if "anyOf" and "allOf" checks are mixed, as we don't
know what to do if that is the case.
This change also enhances the linter's ability to pull out
permission values (annotated with @PermissionName).
- it reads hard coded values provided as parameters to the
@PermissionMethod annotation
- it reads multiple @PermissionName values passed as varargs to a
method
Bug: 232058525
Test: SimpleManualPermissionEnforcementDetectorTest
Change-Id: I4e6a54a2820d54726725ea1e4a4b208e337e34c5
Diffstat (limited to 'libs/androidfw/ConfigDescription.cpp')
0 files changed, 0 insertions, 0 deletions