ART: Depend on libnativehelper headers only

Depend on header-only versions where possible. Move projects
excluding libart to libnativehelper_header_only.

Bug: 65522645
Test: mmma art
Change-Id: I53dd3b2a97e94ee685f72de007ed3858f7f5c6b6
diff --git a/runtime/Android.bp b/runtime/Android.bp
index cfdac1c..6d1667a 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -406,6 +406,7 @@
     ],
     header_libs: [
         "art_cmdlineparser_headers",
+        "libnativehelper_header_only",
     ],
     shared_libs: [
         "libnativehelper",
@@ -510,7 +511,9 @@
         "libartd",
         "libbase",
         "libbacktrace",
-        "libnativehelper",
+    ],
+    header_libs: [
+        "libnativehelper_header_only",
     ],
 }
 
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index cd7a94e..584176a 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -99,7 +99,7 @@
 #include "mirror/stack_trace_element.h"
 #include "mirror/string-inl.h"
 #include "native/dalvik_system_DexFile.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "oat.h"
 #include "oat_file-inl.h"
 #include "oat_file.h"
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index d35402f..149c33f 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -21,7 +21,7 @@
 #include <fcntl.h>
 #include <stdlib.h>
 #include <cstdio>
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 
 #include "../../external/icu/icu4c/source/common/unicode/uvernum.h"
 #include "android-base/stringprintf.h"
diff --git a/runtime/common_throws.cc b/runtime/common_throws.cc
index bf2e706..1e77753 100644
--- a/runtime/common_throws.cc
+++ b/runtime/common_throws.cc
@@ -31,7 +31,7 @@
 #include "mirror/method_type.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "obj_ptr-inl.h"
 #include "thread.h"
 #include "verifier/method_verifier.h"
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index b021ff1..85df14a 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -55,8 +55,8 @@
 #include "mirror/object_array-inl.h"
 #include "mirror/string-inl.h"
 #include "mirror/throwable.h"
-#include "nativehelper/ScopedLocalRef.h"
-#include "nativehelper/ScopedPrimitiveArray.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_primitive_array.h"
 #include "obj_ptr-inl.h"
 #include "reflection.h"
 #include "safe_map.h"
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 7328063..4f54582 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -77,7 +77,7 @@
 #include "mirror/object-refvisitor-inl.h"
 #include "mirror/object_array-inl.h"
 #include "mirror/reference-inl.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "obj_ptr-inl.h"
 #include "os.h"
 #include "reflection.h"
diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc
index 42b31ab..d58d09c 100644
--- a/runtime/gc/reference_processor.cc
+++ b/runtime/gc/reference_processor.cc
@@ -22,7 +22,7 @@
 #include "mirror/class-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/reference-inl.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "object_callbacks.h"
 #include "reference_processor-inl.h"
 #include "reflection.h"
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index 2deb3b7..038405e 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -29,7 +29,7 @@
 #include "jvalue-inl.h"
 #include "mirror/string-inl.h"
 #include "mterp/mterp.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
 #include "thread-inl.h"
diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc
index 74a7a66..7a8ae9a 100644
--- a/runtime/interpreter/unstarted_runtime.cc
+++ b/runtime/interpreter/unstarted_runtime.cc
@@ -47,7 +47,7 @@
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
 #include "mirror/string-inl.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "nth_caller_visitor.h"
 #include "reflection.h"
 #include "thread-inl.h"
diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc
index 73746e1..f8b82ed 100644
--- a/runtime/java_vm_ext.cc
+++ b/runtime/java_vm_ext.cc
@@ -36,8 +36,8 @@
 #include "mirror/class-inl.h"
 #include "mirror/class_loader.h"
 #include "nativebridge/native_bridge.h"
-#include "nativehelper/ScopedLocalRef.h"
-#include "nativehelper/ScopedUtfChars.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_utf_chars.h"
 #include "nativeloader/native_loader.h"
 #include "object_callbacks.h"
 #include "parsed_options.h"
diff --git a/runtime/jni_internal.cc b/runtime/jni_internal.cc
index d74cec3..5164c85 100644
--- a/runtime/jni_internal.cc
+++ b/runtime/jni_internal.cc
@@ -49,7 +49,7 @@
 #include "mirror/object_array-inl.h"
 #include "mirror/string-inl.h"
 #include "mirror/throwable.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "parsed_options.h"
 #include "reflection.h"
 #include "runtime.h"
diff --git a/runtime/jni_internal_test.cc b/runtime/jni_internal_test.cc
index 3f00450..1ecfe7c 100644
--- a/runtime/jni_internal_test.cc
+++ b/runtime/jni_internal_test.cc
@@ -24,7 +24,7 @@
 #include "java_vm_ext.h"
 #include "jni_env_ext.h"
 #include "mirror/string-inl.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "scoped_thread_state_change-inl.h"
 
 namespace art {
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc
index e75d097..4ab8908 100644
--- a/runtime/native/dalvik_system_DexFile.cc
+++ b/runtime/native/dalvik_system_DexFile.cc
@@ -33,8 +33,8 @@
 #include "mirror/string.h"
 #include "native_util.h"
 #include "nativehelper/jni_macros.h"
-#include "nativehelper/ScopedLocalRef.h"
-#include "nativehelper/ScopedUtfChars.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_utf_chars.h"
 #include "oat_file.h"
 #include "oat_file_assistant.h"
 #include "oat_file_manager.h"
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc
index 70dd5cb..2663bea 100644
--- a/runtime/native/dalvik_system_VMDebug.cc
+++ b/runtime/native/dalvik_system_VMDebug.cc
@@ -40,8 +40,8 @@
 #include "mirror/class.h"
 #include "mirror/object_array-inl.h"
 #include "native_util.h"
-#include "nativehelper/ScopedLocalRef.h"
-#include "nativehelper/ScopedUtfChars.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_utf_chars.h"
 #include "scoped_fast_native_object_access-inl.h"
 #include "trace.h"
 #include "well_known_classes.h"
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc
index c5bc142..0bbd1ec 100644
--- a/runtime/native/dalvik_system_VMRuntime.cc
+++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -22,7 +22,7 @@
 extern "C" void android_set_application_target_sdk_version(uint32_t version);
 #endif
 #include <limits.h>
-#include "nativehelper/ScopedUtfChars.h"
+#include "nativehelper/scoped_utf_chars.h"
 
 #include "android-base/stringprintf.h"
 
@@ -48,7 +48,7 @@
 #include "mirror/object-inl.h"
 #include "native_util.h"
 #include "nativehelper/jni_macros.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "runtime.h"
 #include "scoped_fast_native_object_access-inl.h"
 #include "scoped_thread_state_change-inl.h"
diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc
index af78372..b436e0d 100644
--- a/runtime/native/dalvik_system_ZygoteHooks.cc
+++ b/runtime/native/dalvik_system_ZygoteHooks.cc
@@ -29,8 +29,7 @@
 #include "jni_internal.h"
 #include "native_util.h"
 #include "nativehelper/jni_macros.h"
-#include "nativehelper/JNIHelp.h"
-#include "nativehelper/ScopedUtfChars.h"
+#include "nativehelper/scoped_utf_chars.h"
 #include "non_debuggable_classes.h"
 #include "oat_file.h"
 #include "oat_file_manager.h"
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index 1a19940..9359ffc 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -35,8 +35,8 @@
 #include "mirror/string-inl.h"
 #include "native_util.h"
 #include "nativehelper/jni_macros.h"
-#include "nativehelper/ScopedLocalRef.h"
-#include "nativehelper/ScopedUtfChars.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_utf_chars.h"
 #include "nth_caller_visitor.h"
 #include "obj_ptr-inl.h"
 #include "reflection.h"
diff --git a/runtime/native/java_lang_String.cc b/runtime/native/java_lang_String.cc
index 67f7c51..9295ff7 100644
--- a/runtime/native/java_lang_String.cc
+++ b/runtime/native/java_lang_String.cc
@@ -25,7 +25,7 @@
 #include "mirror/string-inl.h"
 #include "mirror/string.h"
 #include "native_util.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "scoped_fast_native_object_access-inl.h"
 #include "scoped_thread_state_change-inl.h"
 #include "verify_object.h"
diff --git a/runtime/native/java_lang_StringFactory.cc b/runtime/native/java_lang_StringFactory.cc
index 2db9a5c..136a02f 100644
--- a/runtime/native/java_lang_StringFactory.cc
+++ b/runtime/native/java_lang_StringFactory.cc
@@ -22,8 +22,8 @@
 #include "mirror/string.h"
 #include "native_util.h"
 #include "nativehelper/jni_macros.h"
-#include "nativehelper/ScopedLocalRef.h"
-#include "nativehelper/ScopedPrimitiveArray.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_primitive_array.h"
 #include "scoped_fast_native_object_access-inl.h"
 #include "scoped_thread_state_change-inl.h"
 
diff --git a/runtime/native/java_lang_Thread.cc b/runtime/native/java_lang_Thread.cc
index 94007ff..a717264 100644
--- a/runtime/native/java_lang_Thread.cc
+++ b/runtime/native/java_lang_Thread.cc
@@ -22,7 +22,7 @@
 #include "monitor.h"
 #include "native_util.h"
 #include "nativehelper/jni_macros.h"
-#include "nativehelper/ScopedUtfChars.h"
+#include "nativehelper/scoped_utf_chars.h"
 #include "scoped_fast_native_object_access-inl.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
diff --git a/runtime/native/java_lang_VMClassLoader.cc b/runtime/native/java_lang_VMClassLoader.cc
index 413149c..5130ad5 100644
--- a/runtime/native/java_lang_VMClassLoader.cc
+++ b/runtime/native/java_lang_VMClassLoader.cc
@@ -23,8 +23,8 @@
 #include "mirror/object-inl.h"
 #include "native_util.h"
 #include "nativehelper/jni_macros.h"
-#include "nativehelper/ScopedLocalRef.h"
-#include "nativehelper/ScopedUtfChars.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_utf_chars.h"
 #include "obj_ptr.h"
 #include "scoped_fast_native_object_access-inl.h"
 #include "well_known_classes.h"
diff --git a/runtime/native/libcore_util_CharsetUtils.cc b/runtime/native/libcore_util_CharsetUtils.cc
index 9743c94..f3aba25 100644
--- a/runtime/native/libcore_util_CharsetUtils.cc
+++ b/runtime/native/libcore_util_CharsetUtils.cc
@@ -22,7 +22,7 @@
 #include "mirror/string-inl.h"
 #include "mirror/string.h"
 #include "native_util.h"
-#include "nativehelper/ScopedPrimitiveArray.h"
+#include "nativehelper/scoped_primitive_array.h"
 #include "nativehelper/jni_macros.h"
 #include "scoped_fast_native_object_access-inl.h"
 #include "unicode/utf16.h"
diff --git a/runtime/native/native_util.h b/runtime/native/native_util.h
index 593b3ca..784dba3 100644
--- a/runtime/native/native_util.h
+++ b/runtime/native/native_util.h
@@ -21,7 +21,7 @@
 
 #include "android-base/logging.h"
 #include "base/macros.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 
 namespace art {
 
diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
index c3e74bd..f8f4b1f 100644
--- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
+++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
@@ -21,7 +21,7 @@
 #include "jni_internal.h"
 #include "native_util.h"
 #include "nativehelper/jni_macros.h"
-#include "nativehelper/ScopedPrimitiveArray.h"
+#include "nativehelper/scoped_primitive_array.h"
 #include "scoped_fast_native_object_access-inl.h"
 
 namespace art {
diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
index 8c42973..dd98e25 100644
--- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
+++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
@@ -23,8 +23,8 @@
 #include "jni_internal.h"
 #include "native_util.h"
 #include "nativehelper/jni_macros.h"
-#include "nativehelper/ScopedLocalRef.h"
-#include "nativehelper/ScopedPrimitiveArray.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_primitive_array.h"
 #include "scoped_fast_native_object_access-inl.h"
 #include "thread_list.h"
 
diff --git a/runtime/non_debuggable_classes.cc b/runtime/non_debuggable_classes.cc
index 871ffba..7db199c 100644
--- a/runtime/non_debuggable_classes.cc
+++ b/runtime/non_debuggable_classes.cc
@@ -19,7 +19,7 @@
 #include "base/logging.h"
 #include "jni_internal.h"
 #include "mirror/class-inl.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "obj_ptr-inl.h"
 #include "thread-current-inl.h"
 
diff --git a/runtime/reflection.cc b/runtime/reflection.cc
index f28f0ca..9683ced 100644
--- a/runtime/reflection.cc
+++ b/runtime/reflection.cc
@@ -28,7 +28,7 @@
 #include "mirror/class-inl.h"
 #include "mirror/executable.h"
 #include "mirror/object_array-inl.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "nth_caller_visitor.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack_reference.h"
diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc
index fa2f1e5..7794872 100644
--- a/runtime/reflection_test.cc
+++ b/runtime/reflection_test.cc
@@ -24,7 +24,7 @@
 #include "common_compiler_test.h"
 #include "java_vm_ext.h"
 #include "jni_internal.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "scoped_thread_state_change-inl.h"
 
 namespace art {
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index ca65478..47f033f 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -136,7 +136,7 @@
 #include "native_stack_dump.h"
 #include "nativehelper/JniConstants.h"
 #include "nativehelper/JniConstants-priv.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "oat_file.h"
 #include "oat_file_manager.h"
 #include "object_callbacks.h"
diff --git a/runtime/runtime_callbacks_test.cc b/runtime/runtime_callbacks_test.cc
index ef17258..0b69851 100644
--- a/runtime/runtime_callbacks_test.cc
+++ b/runtime/runtime_callbacks_test.cc
@@ -38,7 +38,7 @@
 #include "mirror/class-inl.h"
 #include "mirror/class_loader.h"
 #include "monitor.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "obj_ptr.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 3355b10..47ffb4e 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -70,8 +70,8 @@
 #include "mirror/stack_trace_element.h"
 #include "monitor.h"
 #include "native_stack_dump.h"
-#include "nativehelper/ScopedLocalRef.h"
-#include "nativehelper/ScopedUtfChars.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_utf_chars.h"
 #include "nth_caller_visitor.h"
 #include "oat_quick_method_header.h"
 #include "obj_ptr-inl.h"
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index 488e4a6..cad164c 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -24,8 +24,8 @@
 
 #include "android-base/stringprintf.h"
 #include "backtrace/BacktraceMap.h"
-#include "nativehelper/ScopedLocalRef.h"
-#include "nativehelper/ScopedUtfChars.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_utf_chars.h"
 
 #include "base/histogram-inl.h"
 #include "base/mutex-inl.h"
diff --git a/runtime/trace.cc b/runtime/trace.cc
index 4c3fa20..4b5a761 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -39,7 +39,7 @@
 #include "mirror/dex_cache-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "os.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
diff --git a/runtime/well_known_classes.cc b/runtime/well_known_classes.cc
index 74d11a3..bfcd95c 100644
--- a/runtime/well_known_classes.cc
+++ b/runtime/well_known_classes.cc
@@ -27,7 +27,7 @@
 #include "jni_internal.h"
 #include "mirror/class.h"
 #include "mirror/throwable.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
 #include "obj_ptr-inl.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"