Add instructions on how to annotate an AIDL interface

Fixes: 209500346
Test: m RUN_ERROR_PRONE=true framework |& grep -A 5 AndroidFrameworkRequiresPermission
Change-Id: If73e7c41543f3e8512e5ffe75e7620a6c4b0632b
This commit is contained in:
Cole Faust 2021-12-06 17:25:28 -08:00
parent afd5a827a7
commit c546b3f7a6

View File

@ -187,7 +187,10 @@ public final class RequiresPermissionChecker extends BugChecker
if (!actualPerm.containsAll(expectedPerm)) { if (!actualPerm.containsAll(expectedPerm)) {
return buildDescription(tree) return buildDescription(tree)
.setMessage("Method " + method.name.toString() + "() annotated " + expectedPerm .setMessage("Method " + method.name.toString() + "() annotated " + expectedPerm
+ " but too wide; only invokes methods requiring " + actualPerm) + " but too wide; only invokes methods requiring " + actualPerm
+ "\n If calling an AIDL interface, it can be annotated by adding:"
+ "\n @JavaPassthrough(annotation=\""
+ "@android.annotation.RequiresPermission(...)\")")
.build(); .build();
} }