aconfig: add @UnsupportedAppUsage to methods in generated flags

The java generated flags are marked as @hide which breaks CTS. To
unblock CTS test add @UnsupportedAppUsage to expose the methods.

Test: atest aconfig.test.flags
Bug: 301272559
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:64ad75f50ae96f9a8b57a9e8f88ae9a53d3c1044)
Merged-In: I897573c054e70fc6e093869ba6d416c38f81e28f
Change-Id: I897573c054e70fc6e093869ba6d416c38f81e28f
diff --git a/tools/aconfig/templates/Flags.java.template b/tools/aconfig/templates/Flags.java.template
index 39024a8..66c4c5a 100644
--- a/tools/aconfig/templates/Flags.java.template
+++ b/tools/aconfig/templates/Flags.java.template
@@ -1,5 +1,8 @@
 package {package_name};
 
+// TODO(b/303773055): Remove the annotation after access issue is resolved.
+import android.compat.annotation.UnsupportedAppUsage;
+
 /** @hide */
 public final class Flags \{
 {{- for item in class_elements}}
@@ -14,6 +17,7 @@
     @com.android.aconfig.annotations.AssumeFalseForR8
 {{ -endif- }}
 {{ endif }}
+    @UnsupportedAppUsage
     public static boolean {item.method_name}() \{
         return FEATURE_FLAGS.{item.method_name}();
     }