diff options
author | 2024-01-12 20:10:14 +0000 | |
---|---|---|
committer | 2024-01-15 17:32:46 +0000 | |
commit | 3623aa1323e4eedd836db7a7ceafb19343295a46 (patch) | |
tree | edf1150d86373e33382375f7c562b1925e625b1a | |
parent | f0a31e107973f3bde7dd54cd7610082b104922db (diff) |
Add visibility attributes in runtime/native
Don't add visibility attributes in dalvik_system_VMRuntime.{h,cc} for
now, because it breaks some apps.
Bug: 260881207
Test: launch app from b/319255249
Test: presubmit
Test: abtd app_compat_drm
Test: abtd app_compat_top_100
Test: abtd app_compat_banking
Change-Id: I538c4f82a753c71fb9d008762d09ada5e1273427
70 files changed, 140 insertions, 68 deletions
diff --git a/runtime/native/dalvik_system_BaseDexClassLoader.cc b/runtime/native/dalvik_system_BaseDexClassLoader.cc index a4f702c28d..f9a1aba022 100644 --- a/runtime/native/dalvik_system_BaseDexClassLoader.cc +++ b/runtime/native/dalvik_system_BaseDexClassLoader.cc @@ -25,7 +25,7 @@ #include "nativehelper/jni_macros.h" #include "thread-inl.h" -namespace art { +namespace art HIDDEN { static bool append_string(Thread* self, Handle<mirror::ObjectArray<mirror::String>> array, diff --git a/runtime/native/dalvik_system_BaseDexClassLoader.h b/runtime/native/dalvik_system_BaseDexClassLoader.h index 4ec03ef7a6..5a18b18b50 100644 --- a/runtime/native/dalvik_system_BaseDexClassLoader.h +++ b/runtime/native/dalvik_system_BaseDexClassLoader.h @@ -20,7 +20,9 @@ #include <jni.h> #include <unistd.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_dalvik_system_BaseDexClassLoader(JNIEnv* env); diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc index f602f73630..f1c5d541a9 100644 --- a/runtime/native/dalvik_system_DexFile.cc +++ b/runtime/native/dalvik_system_DexFile.cc @@ -62,7 +62,7 @@ #include <sys/system_properties.h> #endif // ART_TARGET_ANDROID -namespace art { +namespace art HIDDEN { // Should be the same as dalvik.system.DexFile.ENFORCE_READ_ONLY_JAVA_DCL static constexpr uint64_t kEnforceReadOnlyJavaDcl = 218865702; diff --git a/runtime/native/dalvik_system_DexFile.h b/runtime/native/dalvik_system_DexFile.h index 77d219dfad..c22b83d6e8 100644 --- a/runtime/native/dalvik_system_DexFile.h +++ b/runtime/native/dalvik_system_DexFile.h @@ -20,7 +20,9 @@ #include <jni.h> #include <unistd.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { constexpr size_t kOatFileIndex = 0; constexpr size_t kDexFileIndexStart = 1; diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc index cf2b25d6a2..137b04fede 100644 --- a/runtime/native/dalvik_system_VMDebug.cc +++ b/runtime/native/dalvik_system_VMDebug.cc @@ -51,7 +51,7 @@ #include "thread-inl.h" #include "trace.h" -namespace art { +namespace art HIDDEN { static jobjectArray VMDebug_getVmFeatureList(JNIEnv* env, jclass) { ScopedObjectAccess soa(Thread::ForEnv(env)); diff --git a/runtime/native/dalvik_system_VMDebug.h b/runtime/native/dalvik_system_VMDebug.h index b7eb8a8379..6d53fbea9d 100644 --- a/runtime/native/dalvik_system_VMDebug.h +++ b/runtime/native/dalvik_system_VMDebug.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_dalvik_system_VMDebug(JNIEnv* env); diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc index f1561a2530..e774f07dc9 100644 --- a/runtime/native/dalvik_system_VMRuntime.cc +++ b/runtime/native/dalvik_system_VMRuntime.cc @@ -66,6 +66,8 @@ extern "C" void android_set_application_target_sdk_version(uint32_t version); #include "thread-inl.h" #include "thread_list.h" +// TODO(260881207): should be HIDDEN, but some apps fail to launch +// (e.g. b/319255249) namespace art { using android::base::StringPrintf; diff --git a/runtime/native/dalvik_system_VMRuntime.h b/runtime/native/dalvik_system_VMRuntime.h index 795caa5ec6..d66c107a30 100644 --- a/runtime/native/dalvik_system_VMRuntime.h +++ b/runtime/native/dalvik_system_VMRuntime.h @@ -19,6 +19,10 @@ #include <jni.h> +#include "base/macros.h" + +// TODO(260881207): should be HIDDEN, but some apps fail to launch +// (e.g. b/319255249) namespace art { void register_dalvik_system_VMRuntime(JNIEnv* env); diff --git a/runtime/native/dalvik_system_VMStack.cc b/runtime/native/dalvik_system_VMStack.cc index 596b2eb435..599bdb9e4b 100644 --- a/runtime/native/dalvik_system_VMStack.cc +++ b/runtime/native/dalvik_system_VMStack.cc @@ -32,7 +32,7 @@ #include "scoped_thread_state_change-inl.h" #include "thread_list.h" -namespace art { +namespace art HIDDEN { template <typename T, typename ResultT = diff --git a/runtime/native/dalvik_system_VMStack.h b/runtime/native/dalvik_system_VMStack.h index 5638f99ec1..c7a62ad46a 100644 --- a/runtime/native/dalvik_system_VMStack.h +++ b/runtime/native/dalvik_system_VMStack.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_dalvik_system_VMStack(JNIEnv* env); diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc index dd44e2ec4b..cc47032bd4 100644 --- a/runtime/native/dalvik_system_ZygoteHooks.cc +++ b/runtime/native/dalvik_system_ZygoteHooks.cc @@ -47,7 +47,7 @@ #include <sys/resource.h> -namespace art { +namespace art HIDDEN { // Set to true to always determine the non-debuggable classes even if we would not allow a debugger // to actually attach. diff --git a/runtime/native/dalvik_system_ZygoteHooks.h b/runtime/native/dalvik_system_ZygoteHooks.h index ca0658d318..fbd14c0fcc 100644 --- a/runtime/native/dalvik_system_ZygoteHooks.h +++ b/runtime/native/dalvik_system_ZygoteHooks.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_dalvik_system_ZygoteHooks(JNIEnv* env); diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc index 2abc4935e0..1dc74e0db2 100644 --- a/runtime/native/java_lang_Class.cc +++ b/runtime/native/java_lang_Class.cc @@ -56,7 +56,7 @@ #include "scoped_thread_state_change-inl.h" #include "well_known_classes-inl.h" -namespace art { +namespace art HIDDEN { static std::function<hiddenapi::AccessContext()> GetHiddenapiAccessContextFunction(Thread* self) { return [=]() REQUIRES_SHARED(Locks::mutator_lock_) { diff --git a/runtime/native/java_lang_Class.h b/runtime/native/java_lang_Class.h index 8f769c39e9..aaa9b669d0 100644 --- a/runtime/native/java_lang_Class.h +++ b/runtime/native/java_lang_Class.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_Class(JNIEnv* env); diff --git a/runtime/native/java_lang_Object.cc b/runtime/native/java_lang_Object.cc index 8fc10d1114..5649b2cc5b 100644 --- a/runtime/native/java_lang_Object.cc +++ b/runtime/native/java_lang_Object.cc @@ -24,7 +24,7 @@ #include "native_util.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { static jobject Object_internalClone(JNIEnv* env, jobject java_this) { ScopedFastNativeObjectAccess soa(env); diff --git a/runtime/native/java_lang_Object.h b/runtime/native/java_lang_Object.h index c860571904..1ea2c05d19 100644 --- a/runtime/native/java_lang_Object.h +++ b/runtime/native/java_lang_Object.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_Object(JNIEnv* env); diff --git a/runtime/native/java_lang_StackStreamFactory.cc b/runtime/native/java_lang_StackStreamFactory.cc index f876c1014b..24d903047d 100644 --- a/runtime/native/java_lang_StackStreamFactory.cc +++ b/runtime/native/java_lang_StackStreamFactory.cc @@ -23,7 +23,7 @@ #include "scoped_fast_native_object_access-inl.h" #include "thread.h" -namespace art { +namespace art HIDDEN { static jobject StackStreamFactory_nativeGetStackAnchor(JNIEnv* env, jclass) { ScopedFastNativeObjectAccess soa(env); diff --git a/runtime/native/java_lang_StackStreamFactory.h b/runtime/native/java_lang_StackStreamFactory.h index 2216871ebf..31b3c9528d 100644 --- a/runtime/native/java_lang_StackStreamFactory.h +++ b/runtime/native/java_lang_StackStreamFactory.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_StackStreamFactory(JNIEnv* env); diff --git a/runtime/native/java_lang_String.cc b/runtime/native/java_lang_String.cc index f70a188e79..1ba0028fd3 100644 --- a/runtime/native/java_lang_String.cc +++ b/runtime/native/java_lang_String.cc @@ -31,7 +31,7 @@ #include "scoped_thread_state_change-inl.h" #include "verify_object.h" -namespace art { +namespace art HIDDEN { static jchar String_charAt(JNIEnv* env, jobject java_this, jint index) { ScopedFastNativeObjectAccess soa(env); diff --git a/runtime/native/java_lang_String.h b/runtime/native/java_lang_String.h index 357eb3daf9..a78fdcec72 100644 --- a/runtime/native/java_lang_String.h +++ b/runtime/native/java_lang_String.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_String(JNIEnv* env); diff --git a/runtime/native/java_lang_StringFactory.cc b/runtime/native/java_lang_StringFactory.cc index 2fbebc0941..e6c03dbcf2 100644 --- a/runtime/native/java_lang_StringFactory.cc +++ b/runtime/native/java_lang_StringFactory.cc @@ -28,7 +28,7 @@ #include "scoped_fast_native_object_access-inl.h" #include "scoped_thread_state_change-inl.h" -namespace art { +namespace art HIDDEN { static jstring StringFactory_newStringFromBytes(JNIEnv* env, jclass, jbyteArray java_data, jint high, jint offset, jint byte_count) { diff --git a/runtime/native/java_lang_StringFactory.h b/runtime/native/java_lang_StringFactory.h index c476ad3db9..cdc19df87d 100644 --- a/runtime/native/java_lang_StringFactory.h +++ b/runtime/native/java_lang_StringFactory.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_StringFactory(JNIEnv* env); diff --git a/runtime/native/java_lang_System.cc b/runtime/native/java_lang_System.cc index 63cbd2c815..203d98dc4c 100644 --- a/runtime/native/java_lang_System.cc +++ b/runtime/native/java_lang_System.cc @@ -29,7 +29,7 @@ #include "native_util.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { /* * We make guarantees about the atomicity of accesses to primitive variables. These guarantees diff --git a/runtime/native/java_lang_System.h b/runtime/native/java_lang_System.h index e371fa5db4..a52972711d 100644 --- a/runtime/native/java_lang_System.h +++ b/runtime/native/java_lang_System.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_System(JNIEnv* env); diff --git a/runtime/native/java_lang_Thread.cc b/runtime/native/java_lang_Thread.cc index fd67a0a7fa..65e3009c0f 100644 --- a/runtime/native/java_lang_Thread.cc +++ b/runtime/native/java_lang_Thread.cc @@ -29,7 +29,7 @@ #include "thread_list.h" #include "verify_object.h" -namespace art { +namespace art HIDDEN { static jobject Thread_currentThread(JNIEnv* env, jclass) { ScopedFastNativeObjectAccess soa(env); diff --git a/runtime/native/java_lang_Thread.h b/runtime/native/java_lang_Thread.h index 7700ce29a8..ef880a9904 100644 --- a/runtime/native/java_lang_Thread.h +++ b/runtime/native/java_lang_Thread.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_Thread(JNIEnv* env); diff --git a/runtime/native/java_lang_Throwable.cc b/runtime/native/java_lang_Throwable.cc index b89e287481..091ad03bb2 100644 --- a/runtime/native/java_lang_Throwable.cc +++ b/runtime/native/java_lang_Throwable.cc @@ -23,7 +23,7 @@ #include "scoped_fast_native_object_access-inl.h" #include "thread.h" -namespace art { +namespace art HIDDEN { static jobject Throwable_nativeFillInStackTrace(JNIEnv* env, jclass) { ScopedFastNativeObjectAccess soa(env); diff --git a/runtime/native/java_lang_Throwable.h b/runtime/native/java_lang_Throwable.h index f9aea84abe..6758e48951 100644 --- a/runtime/native/java_lang_Throwable.h +++ b/runtime/native/java_lang_Throwable.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_Throwable(JNIEnv* env); diff --git a/runtime/native/java_lang_VMClassLoader.cc b/runtime/native/java_lang_VMClassLoader.cc index 4dad46fb8c..ba1fde00d3 100644 --- a/runtime/native/java_lang_VMClassLoader.cc +++ b/runtime/native/java_lang_VMClassLoader.cc @@ -38,7 +38,7 @@ #include "thread-inl.h" #include "well_known_classes-inl.h" -namespace art { +namespace art HIDDEN { // A class so we can be friends with ClassLinker and access internal methods. class VMClassLoader { diff --git a/runtime/native/java_lang_VMClassLoader.h b/runtime/native/java_lang_VMClassLoader.h index bf8d94f5a9..adf0c0aeac 100644 --- a/runtime/native/java_lang_VMClassLoader.h +++ b/runtime/native/java_lang_VMClassLoader.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_VMClassLoader(JNIEnv* env); diff --git a/runtime/native/java_lang_invoke_MethodHandle.cc b/runtime/native/java_lang_invoke_MethodHandle.cc index 5309a28a09..819656fd05 100644 --- a/runtime/native/java_lang_invoke_MethodHandle.cc +++ b/runtime/native/java_lang_invoke_MethodHandle.cc @@ -27,7 +27,7 @@ #include "native_util.h" #include "scoped_thread_state_change-inl.h" -namespace art { +namespace art HIDDEN { static void MethodHandle_invokeExactWithFrame(JNIEnv* env, jobject thiz, jobject arguments) { ScopedObjectAccess soa(env); diff --git a/runtime/native/java_lang_invoke_MethodHandle.h b/runtime/native/java_lang_invoke_MethodHandle.h index 1f38ac7b27..f46f32426b 100644 --- a/runtime/native/java_lang_invoke_MethodHandle.h +++ b/runtime/native/java_lang_invoke_MethodHandle.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_invoke_MethodHandle(JNIEnv* env); diff --git a/runtime/native/java_lang_invoke_MethodHandleImpl.cc b/runtime/native/java_lang_invoke_MethodHandleImpl.cc index 00ce01f11a..ccd3370ff7 100644 --- a/runtime/native/java_lang_invoke_MethodHandleImpl.cc +++ b/runtime/native/java_lang_invoke_MethodHandleImpl.cc @@ -28,7 +28,7 @@ #include "runtime.h" #include "scoped_thread_state_change-inl.h" -namespace art { +namespace art HIDDEN { static jobject MethodHandleImpl_getMemberInternal(JNIEnv* env, jobject thiz) { ScopedObjectAccess soa(env); diff --git a/runtime/native/java_lang_invoke_MethodHandleImpl.h b/runtime/native/java_lang_invoke_MethodHandleImpl.h index 0e50371697..49d4c2c9ec 100644 --- a/runtime/native/java_lang_invoke_MethodHandleImpl.h +++ b/runtime/native/java_lang_invoke_MethodHandleImpl.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_invoke_MethodHandleImpl(JNIEnv* env); diff --git a/runtime/native/java_lang_ref_FinalizerReference.cc b/runtime/native/java_lang_ref_FinalizerReference.cc index 535b243411..52f6f734d9 100644 --- a/runtime/native/java_lang_ref_FinalizerReference.cc +++ b/runtime/native/java_lang_ref_FinalizerReference.cc @@ -26,7 +26,7 @@ #include "native_util.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { static jboolean FinalizerReference_makeCircularListIfUnenqueued(JNIEnv* env, jobject javaThis) { ScopedFastNativeObjectAccess soa(env); diff --git a/runtime/native/java_lang_ref_FinalizerReference.h b/runtime/native/java_lang_ref_FinalizerReference.h index 848a7aded6..13d1a12c34 100644 --- a/runtime/native/java_lang_ref_FinalizerReference.h +++ b/runtime/native/java_lang_ref_FinalizerReference.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_ref_FinalizerReference(JNIEnv* env); diff --git a/runtime/native/java_lang_ref_Reference.cc b/runtime/native/java_lang_ref_Reference.cc index bd7235e14f..4c411c8db4 100644 --- a/runtime/native/java_lang_ref_Reference.cc +++ b/runtime/native/java_lang_ref_Reference.cc @@ -26,7 +26,7 @@ #include "native_util.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { static jobject Reference_getReferent(JNIEnv* env, jobject javaThis) { ScopedFastNativeObjectAccess soa(env); diff --git a/runtime/native/java_lang_ref_Reference.h b/runtime/native/java_lang_ref_Reference.h index 0cbf11646d..cc75069657 100644 --- a/runtime/native/java_lang_ref_Reference.h +++ b/runtime/native/java_lang_ref_Reference.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_ref_Reference(JNIEnv* env); diff --git a/runtime/native/java_lang_reflect_Array.cc b/runtime/native/java_lang_reflect_Array.cc index ff94593cdf..9ac6e614b6 100644 --- a/runtime/native/java_lang_reflect_Array.cc +++ b/runtime/native/java_lang_reflect_Array.cc @@ -29,7 +29,7 @@ #include "native_util.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { static jobject Array_createMultiArray( JNIEnv* env, jclass, jclass javaElementClass, jintArray javaDimArray) { diff --git a/runtime/native/java_lang_reflect_Array.h b/runtime/native/java_lang_reflect_Array.h index 805bf7992a..35b87b7af4 100644 --- a/runtime/native/java_lang_reflect_Array.h +++ b/runtime/native/java_lang_reflect_Array.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_reflect_Array(JNIEnv* env); diff --git a/runtime/native/java_lang_reflect_Constructor.cc b/runtime/native/java_lang_reflect_Constructor.cc index 98afddc260..f9278ab0d6 100644 --- a/runtime/native/java_lang_reflect_Constructor.cc +++ b/runtime/native/java_lang_reflect_Constructor.cc @@ -34,7 +34,7 @@ #include "reflection.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { static jobjectArray Constructor_getExceptionTypes(JNIEnv* env, jobject javaMethod) { ScopedFastNativeObjectAccess soa(env); diff --git a/runtime/native/java_lang_reflect_Constructor.h b/runtime/native/java_lang_reflect_Constructor.h index 7baae978e6..9c36ef4fed 100644 --- a/runtime/native/java_lang_reflect_Constructor.h +++ b/runtime/native/java_lang_reflect_Constructor.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_reflect_Constructor(JNIEnv* env); diff --git a/runtime/native/java_lang_reflect_Executable.cc b/runtime/native/java_lang_reflect_Executable.cc index 87c9f6c341..3f3b648ecf 100644 --- a/runtime/native/java_lang_reflect_Executable.cc +++ b/runtime/native/java_lang_reflect_Executable.cc @@ -35,7 +35,7 @@ #include "scoped_fast_native_object_access-inl.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/native/java_lang_reflect_Executable.h b/runtime/native/java_lang_reflect_Executable.h index 0cfed62e49..05b0a234e0 100644 --- a/runtime/native/java_lang_reflect_Executable.h +++ b/runtime/native/java_lang_reflect_Executable.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_reflect_Executable(JNIEnv* env); diff --git a/runtime/native/java_lang_reflect_Field.cc b/runtime/native/java_lang_reflect_Field.cc index f2603d4c48..622b514ea3 100644 --- a/runtime/native/java_lang_reflect_Field.cc +++ b/runtime/native/java_lang_reflect_Field.cc @@ -37,7 +37,7 @@ #include "scoped_fast_native_object_access-inl.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/native/java_lang_reflect_Field.h b/runtime/native/java_lang_reflect_Field.h index 1739711de8..b5368b97f0 100644 --- a/runtime/native/java_lang_reflect_Field.h +++ b/runtime/native/java_lang_reflect_Field.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_reflect_Field(JNIEnv* env); diff --git a/runtime/native/java_lang_reflect_Method.cc b/runtime/native/java_lang_reflect_Method.cc index 5f02ad0fd9..8cbc070eee 100644 --- a/runtime/native/java_lang_reflect_Method.cc +++ b/runtime/native/java_lang_reflect_Method.cc @@ -32,7 +32,7 @@ #include "reflection.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { static jobject Method_getDefaultValue(JNIEnv* env, jobject javaMethod) { ScopedFastNativeObjectAccess soa(env); diff --git a/runtime/native/java_lang_reflect_Method.h b/runtime/native/java_lang_reflect_Method.h index 3a93cd05d9..4b48ced9f4 100644 --- a/runtime/native/java_lang_reflect_Method.h +++ b/runtime/native/java_lang_reflect_Method.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_reflect_Method(JNIEnv* env); diff --git a/runtime/native/java_lang_reflect_Parameter.cc b/runtime/native/java_lang_reflect_Parameter.cc index 263a56796f..fe9e4e3cbf 100644 --- a/runtime/native/java_lang_reflect_Parameter.cc +++ b/runtime/native/java_lang_reflect_Parameter.cc @@ -28,7 +28,7 @@ #include "native_util.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/native/java_lang_reflect_Parameter.h b/runtime/native/java_lang_reflect_Parameter.h index f6322b146f..97873fbfaf 100644 --- a/runtime/native/java_lang_reflect_Parameter.h +++ b/runtime/native/java_lang_reflect_Parameter.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_reflect_Parameter(JNIEnv* env); diff --git a/runtime/native/java_lang_reflect_Proxy.cc b/runtime/native/java_lang_reflect_Proxy.cc index f723ed223d..a89f8274f8 100644 --- a/runtime/native/java_lang_reflect_Proxy.cc +++ b/runtime/native/java_lang_reflect_Proxy.cc @@ -27,7 +27,7 @@ #include "scoped_fast_native_object_access-inl.h" #include "verify_object.h" -namespace art { +namespace art HIDDEN { static jclass Proxy_generateProxy(JNIEnv* env, jclass, jstring name, jobjectArray interfaces, jobject loader, jobjectArray methods, jobjectArray throws) { diff --git a/runtime/native/java_lang_reflect_Proxy.h b/runtime/native/java_lang_reflect_Proxy.h index e25f0f76b6..e6b3f241c7 100644 --- a/runtime/native/java_lang_reflect_Proxy.h +++ b/runtime/native/java_lang_reflect_Proxy.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_lang_reflect_Proxy(JNIEnv* env); diff --git a/runtime/native/java_util_concurrent_atomic_AtomicLong.cc b/runtime/native/java_util_concurrent_atomic_AtomicLong.cc index fa288edcb8..3f4c609432 100644 --- a/runtime/native/java_util_concurrent_atomic_AtomicLong.cc +++ b/runtime/native/java_util_concurrent_atomic_AtomicLong.cc @@ -24,7 +24,7 @@ #include "jni/jni_internal.h" #include "native_util.h" -namespace art { +namespace art HIDDEN { static jboolean AtomicLong_VMSupportsCS8(JNIEnv*, jclass) { return QuasiAtomic::LongAtomicsUseMutexes(kRuntimeISA) ? JNI_FALSE : JNI_TRUE; diff --git a/runtime/native/java_util_concurrent_atomic_AtomicLong.h b/runtime/native/java_util_concurrent_atomic_AtomicLong.h index 990dc861ff..de442ed39b 100644 --- a/runtime/native/java_util_concurrent_atomic_AtomicLong.h +++ b/runtime/native/java_util_concurrent_atomic_AtomicLong.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_java_util_concurrent_atomic_AtomicLong(JNIEnv* env); diff --git a/runtime/native/jdk_internal_misc_Unsafe.cc b/runtime/native/jdk_internal_misc_Unsafe.cc index 9b2021d176..10c6b2da4f 100644 --- a/runtime/native/jdk_internal_misc_Unsafe.cc +++ b/runtime/native/jdk_internal_misc_Unsafe.cc @@ -36,7 +36,7 @@ #include "scoped_fast_native_object_access-inl.h" #include "well_known_classes-inl.h" -namespace art { +namespace art HIDDEN { namespace { // Checks a JNI argument `size` fits inside a size_t and throws a RuntimeException if not (see diff --git a/runtime/native/jdk_internal_misc_Unsafe.h b/runtime/native/jdk_internal_misc_Unsafe.h index 779cd5fb3e..61b377bbfa 100644 --- a/runtime/native/jdk_internal_misc_Unsafe.h +++ b/runtime/native/jdk_internal_misc_Unsafe.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_jdk_internal_misc_Unsafe(JNIEnv* env); diff --git a/runtime/native/libcore_io_Memory.cc b/runtime/native/libcore_io_Memory.cc index 5e38280259..66a16ed0ad 100644 --- a/runtime/native/libcore_io_Memory.cc +++ b/runtime/native/libcore_io_Memory.cc @@ -25,7 +25,7 @@ #include "nativehelper/scoped_primitive_array.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { // Use packed structures for access to unaligned data on targets with alignment restrictions. // The compiler will generate appropriate code to access these structures without diff --git a/runtime/native/libcore_io_Memory.h b/runtime/native/libcore_io_Memory.h index 8c8a2ec17c..bf60986be4 100644 --- a/runtime/native/libcore_io_Memory.h +++ b/runtime/native/libcore_io_Memory.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_libcore_io_Memory(JNIEnv* env); diff --git a/runtime/native/libcore_util_CharsetUtils.cc b/runtime/native/libcore_util_CharsetUtils.cc index 46f8993a10..b497f1092d 100644 --- a/runtime/native/libcore_util_CharsetUtils.cc +++ b/runtime/native/libcore_util_CharsetUtils.cc @@ -28,7 +28,7 @@ #include "nativehelper/jni_macros.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { static void CharsetUtils_asciiBytesToChars(JNIEnv* env, jclass, jbyteArray javaBytes, jint offset, jint length, jcharArray javaChars) { diff --git a/runtime/native/libcore_util_CharsetUtils.h b/runtime/native/libcore_util_CharsetUtils.h index 3518bdb6f7..eaafcab30e 100644 --- a/runtime/native/libcore_util_CharsetUtils.h +++ b/runtime/native/libcore_util_CharsetUtils.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_libcore_util_CharsetUtils(JNIEnv* env); diff --git a/runtime/native/native_util.h b/runtime/native/native_util.h index 784dba319e..f399359b11 100644 --- a/runtime/native/native_util.h +++ b/runtime/native/native_util.h @@ -23,7 +23,7 @@ #include "base/macros.h" #include "nativehelper/scoped_local_ref.h" -namespace art { +namespace art HIDDEN { ALWAYS_INLINE inline void RegisterNativeMethodsInternal(JNIEnv* env, const char* jni_class_name, diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc index 419aed8578..b2e94f90cc 100644 --- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc +++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc @@ -26,7 +26,7 @@ #include "nativehelper/scoped_primitive_array.h" #include "scoped_fast_native_object_access-inl.h" -namespace art { +namespace art HIDDEN { static void DdmServer_nativeSendChunk(JNIEnv* env, jclass, jint type, jbyteArray javaData, jint offset, jint length) { diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.h b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.h index 9a4645c1aa..fc5cfc9b59 100644 --- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.h +++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_org_apache_harmony_dalvik_ddmc_DdmServer(JNIEnv* env); diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc index f20cd281e8..6da4529289 100644 --- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc +++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc @@ -31,7 +31,7 @@ #include "scoped_fast_native_object_access-inl.h" #include "thread_list.h" -namespace art { +namespace art HIDDEN { static void DdmVmInternal_setRecentAllocationsTrackingEnabled(JNIEnv*, jclass, jboolean enable) { Dbg::SetAllocTrackingEnabled(enable); diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.h b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.h index 736e4c8793..5484f3682c 100644 --- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.h +++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_org_apache_harmony_dalvik_ddmc_DdmVmInternal(JNIEnv* env); diff --git a/runtime/native/scoped_fast_native_object_access-inl.h b/runtime/native/scoped_fast_native_object_access-inl.h index 0b8ad117d2..cd1a0b26d7 100644 --- a/runtime/native/scoped_fast_native_object_access-inl.h +++ b/runtime/native/scoped_fast_native_object_access-inl.h @@ -22,7 +22,7 @@ #include "art_method.h" #include "scoped_thread_state_change-inl.h" -namespace art { +namespace art HIDDEN { inline ScopedFastNativeObjectAccess::ScopedFastNativeObjectAccess(JNIEnv* env) : ScopedObjectAccessAlreadyRunnable(env) { diff --git a/runtime/native/scoped_fast_native_object_access.h b/runtime/native/scoped_fast_native_object_access.h index 6a9365d517..a3b01d7701 100644 --- a/runtime/native/scoped_fast_native_object_access.h +++ b/runtime/native/scoped_fast_native_object_access.h @@ -19,9 +19,10 @@ #include <jni.h> +#include "base/macros.h" #include "scoped_thread_state_change.h" -namespace art { +namespace art HIDDEN { // Variant of ScopedObjectAccess that does no runnable transitions. Should only be used by "fast" // JNI methods. diff --git a/runtime/native/string_array_utils.h b/runtime/native/string_array_utils.h index 41d50933f9..f1fbe540f5 100644 --- a/runtime/native/string_array_utils.h +++ b/runtime/native/string_array_utils.h @@ -17,13 +17,14 @@ #ifndef ART_RUNTIME_NATIVE_STRING_ARRAY_UTILS_H_ #define ART_RUNTIME_NATIVE_STRING_ARRAY_UTILS_H_ +#include "base/macros.h" #include "base/locks.h" #include "class_root-inl.h" #include "handle_scope-inl.h" #include "mirror/object_array-alloc-inl.h" #include "mirror/string.h" -namespace art { +namespace art HIDDEN { namespace detail { diff --git a/runtime/native/sun_misc_Unsafe.cc b/runtime/native/sun_misc_Unsafe.cc index f1e47ee100..573b5a9db2 100644 --- a/runtime/native/sun_misc_Unsafe.cc +++ b/runtime/native/sun_misc_Unsafe.cc @@ -36,7 +36,7 @@ #include "scoped_fast_native_object_access-inl.h" #include "well_known_classes-inl.h" -namespace art { +namespace art HIDDEN { static jboolean Unsafe_compareAndSwapInt(JNIEnv* env, jobject, jobject javaObj, jlong offset, jint expectedValue, jint newValue) { diff --git a/runtime/native/sun_misc_Unsafe.h b/runtime/native/sun_misc_Unsafe.h index 93194f4fad..fe120b5a9b 100644 --- a/runtime/native/sun_misc_Unsafe.h +++ b/runtime/native/sun_misc_Unsafe.h @@ -19,7 +19,9 @@ #include <jni.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { void register_sun_misc_Unsafe(JNIEnv* env); |