[KeepAnno] Add user guide section about annotation patterns
Bug: b/319474935
Change-Id: I345dd72f5b853449fed21b53843fe3e7718a32bf
diff --git a/doc/keepanno-guide.template.md b/doc/keepanno-guide.template.md
index 104bf02..54d910c 100644
--- a/doc/keepanno-guide.template.md
+++ b/doc/keepanno-guide.template.md
@@ -83,6 +83,19 @@
[[[INCLUDE CODE:UsesReflectionFieldPrinter]]]
+### [Accessing annotations](using-reflection-annotations)
+
+[[[INCLUDE DOC:UsesReflectionOnAnnotations]]]
+
+[[[INCLUDE CODE:UsesReflectionOnAnnotations]]]
+
+If the annotations that need to be kept are not runtime
+visible annotations, then you must specify that by including the `RetentionPolicy.CLASS` value in the
+`@AnnotationPattern#retention` property.
+An annotation is runtime visible if its definition is explicitly annotated with
+`Retention(RetentionPolicy.RUNTIME)`.
+
+
## [Annotating code used by reflection (or via JNI)](used-by-reflection)