gn2bp: add javacflag to skip GEN_JNI stub generation

This conflicts as the fully-featured GEN_JNI is already generated by
another genrule.

Test: none
Change-Id: I522501444b02d2a304e81d86d86b0c8f3589035c
diff --git a/tools/gn2bp/Android.bp.swp b/tools/gn2bp/Android.bp.swp
index 3d32f0a..84eab9b 100644
--- a/tools/gn2bp/Android.bp.swp
+++ b/tools/gn2bp/Android.bp.swp
@@ -4760,6 +4760,9 @@
         "cronet_aml_java_jni_annotation_preprocessor",
     ],
     sdk_version: "module_current",
+    javacflags: [
+        "-Aorg.chromium.chrome.skipGenJni",
+    ],
 }
 
 // GN: //base/android/jni_generator:jni_processor
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index f7eb30f..17a9608 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -385,6 +385,7 @@
     self.plugins = set()
     self.processor_class = None
     self.sdk_version = None
+    self.javacflags = set()
 
   def to_string(self, output):
     if self.comment:
@@ -439,6 +440,7 @@
     self._output_field(output, 'plugins')
     self._output_field(output, 'processor_class')
     self._output_field(output, 'sdk_version')
+    self._output_field(output, 'javacflags')
     if self.rtti:
       self._output_field(output, 'rtti')
 
@@ -1495,6 +1497,12 @@
   module.aidl["local_include_dirs"] = {"base/android/java/src/"}
   module.sdk_version = "module_current"
   module.apex_available.add(tethering_apex)
+  # TODO: support for this flag is removed upstream in crrev/c/4062652.
+  # Consider reverting this change upstream, or worst-case downstream.  As an
+  # alternative hack, we could rename the generated file to not conflict. This
+  # would be less likely to conflict with upstream changes if the revert is not
+  # accepted.
+  module.javacflags.add("-Aorg.chromium.chrome.skipGenJni")
   # TODO: remove following workaround required to make this module visible to make (b/203203405)
   module.apex_available.add("//apex_available:platform")
   for dep in gn.java_actions: