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
Loading
Please register or sign in to comment