Add explicit dependencies on jni_headers

Bug: 152482542
Test: lunch aosp_x86_64 && m checkbuild
Change-Id: I1859a5b15d7e1a4939968908d862d27b2345acc4
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp
index 96a947a..d9e1ada 100644
--- a/libdexfile/Android.bp
+++ b/libdexfile/Android.bp
@@ -37,7 +37,8 @@
         "dex/type_lookup_table.cc",
         "dex/utf.cc",
     ],
-
+    header_libs: ["jni_headers"],
+    export_header_lib_headers: ["jni_headers"],
     target: {
         android: {
             static_libs: [
@@ -245,6 +246,7 @@
         "dex/type_lookup_table_test.cc",
         "dex/utf_test.cc",
     ],
+    header_libs: ["jni_headers"],
     shared_libs: [
         "libbacktrace",
         "libziparchive",
@@ -280,7 +282,10 @@
     srcs: [
         "external/dex_file_ext.cc",
     ],
-    header_libs: ["libdexfile_external_headers"],
+    header_libs: [
+        "jni_headers",
+        "libdexfile_external_headers",
+    ],
     shared_libs: [
         "libbase",
     ],
@@ -288,7 +293,10 @@
         symbol_file: "external/libdexfile_external.map.txt",
         versions: ["1"],
     },
-    export_header_lib_headers: ["libdexfile_external_headers"],
+    export_header_lib_headers: [
+        "jni_headers",
+        "libdexfile_external_headers",
+    ],
 }
 
 cc_library {
@@ -342,7 +350,10 @@
     srcs: [
         "external/dex_file_ext_c_test.c",
     ],
-    header_libs: ["libdexfile_external_headers"],
+    header_libs: [
+        "jni_headers",
+        "libdexfile_external_headers",
+    ],
 }
 
 // Support library with a C++ API for accessing the libdexfile API for external
diff --git a/libnativebridge/Android.bp b/libnativebridge/Android.bp
index b5dc324..ae04612 100644
--- a/libnativebridge/Android.bp
+++ b/libnativebridge/Android.bp
@@ -4,8 +4,14 @@
     cppflags: [
         "-fvisibility=protected",
     ],
-    header_libs: ["libnativebridge-headers"],
-    export_header_lib_headers: ["libnativebridge-headers"],
+    header_libs: [
+        "jni_headers",
+        "libnativebridge-headers",
+    ],
+    export_header_lib_headers: [
+        "jni_headers",
+        "libnativebridge-headers",
+    ],
 }
 
 cc_library_headers {
diff --git a/libnativebridge/tests/Android.bp b/libnativebridge/tests/Android.bp
index 4ccf35e..50bf0ab 100644
--- a/libnativebridge/tests/Android.bp
+++ b/libnativebridge/tests/Android.bp
@@ -32,7 +32,10 @@
             ],
         },
     },
-    header_libs: ["libnativebridge-headers"],
+    header_libs: [
+        "jni_headers",
+        "libnativebridge-headers",
+    ],
     cppflags: ["-fvisibility=protected"],
 }
 
@@ -159,5 +162,8 @@
     srcs: [
         "NativeBridgeApi.c",
     ],
-    header_libs: ["libnativebridge-headers"],
+    header_libs: [
+        "jni_headers",
+        "libnativebridge-headers",
+    ],
 }
diff --git a/libnativeloader/Android.bp b/libnativeloader/Android.bp
index a732276..4024d48 100644
--- a/libnativeloader/Android.bp
+++ b/libnativeloader/Android.bp
@@ -26,7 +26,9 @@
     srcs: [
         "native_loader.cpp",
     ],
-    header_libs: ["libnativehelper_header_only"],
+    header_libs: [
+        "libnativehelper_header_only",
+    ],
     shared_libs: [
         "liblog",
         "libnativebridge",
@@ -78,6 +80,8 @@
     ],
     host_supported: true,
     export_include_dirs: ["include"],
+    header_libs: ["jni_headers"],
+    export_header_lib_headers: ["jni_headers"],
 }
 
 cc_test {
diff --git a/runtime/Android.bp b/runtime/Android.bp
index 4f27854..db2579b 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -406,8 +406,8 @@
     header_libs: [
         "art_cmdlineparser_headers",
         "cpp-define-generator-definitions",
-        "libnativehelper_header_only",
         "jni_platform_headers",
+        "libnativehelper_header_only",
     ],
     shared_libs: [
         "libartpalette",
diff --git a/tools/cpp-define-generator/Android.bp b/tools/cpp-define-generator/Android.bp
index 65310b8..c0b236c 100644
--- a/tools/cpp-define-generator/Android.bp
+++ b/tools/cpp-define-generator/Android.bp
@@ -25,6 +25,7 @@
     ],
     header_libs: [
         "art_libartbase_headers", // For base/bit_utils.h
+        "jni_headers",
         "libart_runtime_headers_ndk",
         "libdexfile_all_headers", // For dex/modifiers.h
     ],
diff --git a/tools/jvmti-agents/breakpoint-logger/Android.bp b/tools/jvmti-agents/breakpoint-logger/Android.bp
index 57878cd..a18b298 100644
--- a/tools/jvmti-agents/breakpoint-logger/Android.bp
+++ b/tools/jvmti-agents/breakpoint-logger/Android.bp
@@ -36,6 +36,7 @@
         },
     },
     header_libs: [
+        "jni_headers",
         "libopenjdkjvmti_headers",
     ],
 }
diff --git a/tools/jvmti-agents/dump-jvmti-state/Android.bp b/tools/jvmti-agents/dump-jvmti-state/Android.bp
index 3a48941..7bbe062 100644
--- a/tools/jvmti-agents/dump-jvmti-state/Android.bp
+++ b/tools/jvmti-agents/dump-jvmti-state/Android.bp
@@ -29,6 +29,7 @@
         "libbase",
     ],
     header_libs: [
+        "jni_headers",
         "libopenjdkjvmti_headers",
     ],
 }
diff --git a/tools/jvmti-agents/field-counts/Android.bp b/tools/jvmti-agents/field-counts/Android.bp
index a91af99..ae4e0ef 100644
--- a/tools/jvmti-agents/field-counts/Android.bp
+++ b/tools/jvmti-agents/field-counts/Android.bp
@@ -24,9 +24,9 @@
     // to be same ISA as what it is attached to.
     compile_multilib: "both",
     header_libs: [
+        "jni_headers",
         "libopenjdkjvmti_headers",
         "libnativehelper_header_only",
-        "jni_headers",
     ],
 }
 
diff --git a/tools/jvmti-agents/field-null-percent/Android.bp b/tools/jvmti-agents/field-null-percent/Android.bp
index 4950b7f..31dbef9 100644
--- a/tools/jvmti-agents/field-null-percent/Android.bp
+++ b/tools/jvmti-agents/field-null-percent/Android.bp
@@ -24,6 +24,7 @@
     // to be same ISA as what it is attached to.
     compile_multilib: "both",
     header_libs: [
+        "jni_headers",
         "libopenjdkjvmti_headers",
     ],
 }
diff --git a/tools/jvmti-agents/jit-load/Android.bp b/tools/jvmti-agents/jit-load/Android.bp
index 5adf98c..8d53d18 100644
--- a/tools/jvmti-agents/jit-load/Android.bp
+++ b/tools/jvmti-agents/jit-load/Android.bp
@@ -38,6 +38,7 @@
         },
     },
     header_libs: [
+        "jni_headers",
         "libopenjdkjvmti_headers",
     ],
 }
diff --git a/tools/jvmti-agents/list-extensions/Android.bp b/tools/jvmti-agents/list-extensions/Android.bp
index 09ba5aa..1a07345 100644
--- a/tools/jvmti-agents/list-extensions/Android.bp
+++ b/tools/jvmti-agents/list-extensions/Android.bp
@@ -29,6 +29,7 @@
         "libbase",
     ],
     header_libs: [
+        "jni_headers",
         "libopenjdkjvmti_headers",
     ],
 }
diff --git a/tools/jvmti-agents/titrace/Android.bp b/tools/jvmti-agents/titrace/Android.bp
index 21c2bf0..0720a6a 100644
--- a/tools/jvmti-agents/titrace/Android.bp
+++ b/tools/jvmti-agents/titrace/Android.bp
@@ -39,6 +39,7 @@
         },
     },
     header_libs: [
+        "jni_headers",
         "libopenjdkjvmti_headers",
         "libdexfile_all_headers", // for dex_instruction_list.h only
     ],
diff --git a/tools/jvmti-agents/wrapagentproperties/Android.bp b/tools/jvmti-agents/wrapagentproperties/Android.bp
index 88b1e67..1c808c1 100644
--- a/tools/jvmti-agents/wrapagentproperties/Android.bp
+++ b/tools/jvmti-agents/wrapagentproperties/Android.bp
@@ -36,6 +36,7 @@
         },
     },
     header_libs: [
+        "jni_headers",
         "libopenjdkjvmti_headers",
     ],
 }