2022-03-15 17:07:25 -04:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2022-03-15 14:57:53 -04:00
|
|
|
From: Daniel Micay <danielmicay@gmail.com>
|
|
|
|
Date: Sun, 17 Mar 2019 20:12:52 -0400
|
|
|
|
Subject: [PATCH] constify JNINativeMethod tables
|
|
|
|
|
|
|
|
---
|
|
|
|
cmds/hid/jni/com_android_commands_hid_Device.cpp | 2 +-
|
|
|
|
core/jni/android_app_ActivityThread.cpp | 2 +-
|
|
|
|
core/jni/android_os_HwBinder.cpp | 2 +-
|
|
|
|
core/jni/android_os_HwBlob.cpp | 2 +-
|
|
|
|
core/jni/android_os_HwParcel.cpp | 2 +-
|
|
|
|
core/jni/android_os_HwRemoteBinder.cpp | 2 +-
|
|
|
|
core/jni/android_util_jar_StrictJarFile.cpp | 2 +-
|
|
|
|
core/jni/android_view_DisplayListCanvas.cpp | 2 +-
|
|
|
|
media/jni/android_media_ImageWriter.cpp | 4 ++--
|
|
|
|
media/jni/android_media_MediaSync.cpp | 2 +-
|
|
|
|
media/jni/soundpool/android_media_SoundPool.cpp | 2 +-
|
|
|
|
services/core/jni/com_android_server_UsbMidiDevice.cpp | 2 +-
|
|
|
|
services/core/jni/com_android_server_tv_TvUinputBridge.cpp | 2 +-
|
|
|
|
tests/net/jni/apf_jni.cpp | 2 +-
|
|
|
|
14 files changed, 15 insertions(+), 15 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/cmds/hid/jni/com_android_commands_hid_Device.cpp b/cmds/hid/jni/com_android_commands_hid_Device.cpp
|
|
|
|
index 5cc4fc4c16b2..cbe454290048 100644
|
|
|
|
--- a/cmds/hid/jni/com_android_commands_hid_Device.cpp
|
|
|
|
+++ b/cmds/hid/jni/com_android_commands_hid_Device.cpp
|
|
|
|
@@ -237,7 +237,7 @@ static void closeDevice(JNIEnv* /* env */, jclass /* clazz */, jlong ptr) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-static JNINativeMethod sMethods[] = {
|
|
|
|
+static const JNINativeMethod sMethods[] = {
|
|
|
|
{ "nativeOpenDevice",
|
|
|
|
"(Ljava/lang/String;III[B"
|
|
|
|
"Lcom/android/commands/hid/Device$DeviceCallback;)J",
|
|
|
|
diff --git a/core/jni/android_app_ActivityThread.cpp b/core/jni/android_app_ActivityThread.cpp
|
|
|
|
index d56e4c51124d..693c4a27a0c0 100644
|
|
|
|
--- a/core/jni/android_app_ActivityThread.cpp
|
|
|
|
+++ b/core/jni/android_app_ActivityThread.cpp
|
|
|
|
@@ -39,7 +39,7 @@ android_app_ActivityThread_dumpGraphics(JNIEnv* env, jobject clazz, jobject java
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-static JNINativeMethod gActivityThreadMethods[] = {
|
|
|
|
+static const JNINativeMethod gActivityThreadMethods[] = {
|
|
|
|
// ------------ Regular JNI ------------------
|
|
|
|
{ "nPurgePendingResources", "()V",
|
|
|
|
(void*) android_app_ActivityThread_purgePendingResources },
|
|
|
|
diff --git a/core/jni/android_os_HwBinder.cpp b/core/jni/android_os_HwBinder.cpp
|
|
|
|
index 08d952791ef6..cbcb95e454be 100644
|
|
|
|
--- a/core/jni/android_os_HwBinder.cpp
|
|
|
|
+++ b/core/jni/android_os_HwBinder.cpp
|
|
|
|
@@ -349,7 +349,7 @@ static void JHwBinder_report_sysprop_change(JNIEnv * /*env*/, jclass /*clazz*/)
|
|
|
|
report_sysprop_change();
|
|
|
|
}
|
|
|
|
|
|
|
|
-static JNINativeMethod gMethods[] = {
|
|
|
|
+static const JNINativeMethod gMethods[] = {
|
|
|
|
{ "native_init", "()J", (void *)JHwBinder_native_init },
|
|
|
|
{ "native_setup", "()V", (void *)JHwBinder_native_setup },
|
|
|
|
|
|
|
|
diff --git a/core/jni/android_os_HwBlob.cpp b/core/jni/android_os_HwBlob.cpp
|
|
|
|
index 09589cdb0801..8d281d5b3470 100644
|
|
|
|
--- a/core/jni/android_os_HwBlob.cpp
|
|
|
|
+++ b/core/jni/android_os_HwBlob.cpp
|
|
|
|
@@ -534,7 +534,7 @@ static jlong JHwBlob_native_handle(JNIEnv *env, jobject thiz) {
|
|
|
|
return handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static JNINativeMethod gMethods[] = {
|
|
|
|
+static const JNINativeMethod gMethods[] = {
|
|
|
|
{ "native_init", "()J", (void *)JHwBlob_native_init },
|
|
|
|
{ "native_setup", "(I)V", (void *)JHwBlob_native_setup },
|
|
|
|
|
|
|
|
diff --git a/core/jni/android_os_HwParcel.cpp b/core/jni/android_os_HwParcel.cpp
|
|
|
|
index 061349aee96f..5d570054952f 100644
|
|
|
|
--- a/core/jni/android_os_HwParcel.cpp
|
|
|
|
+++ b/core/jni/android_os_HwParcel.cpp
|
|
|
|
@@ -872,7 +872,7 @@ static void JHwParcel_native_writeBuffer(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-static JNINativeMethod gMethods[] = {
|
|
|
|
+static const JNINativeMethod gMethods[] = {
|
|
|
|
{ "native_init", "()J", (void *)JHwParcel_native_init },
|
|
|
|
{ "native_setup", "(Z)V", (void *)JHwParcel_native_setup },
|
|
|
|
|
|
|
|
diff --git a/core/jni/android_os_HwRemoteBinder.cpp b/core/jni/android_os_HwRemoteBinder.cpp
|
|
|
|
index ca5e1e45dcdc..344c904d89f4 100644
|
|
|
|
--- a/core/jni/android_os_HwRemoteBinder.cpp
|
|
|
|
+++ b/core/jni/android_os_HwRemoteBinder.cpp
|
|
|
|
@@ -455,7 +455,7 @@ static jint JHwRemoteBinder_hashCode(JNIEnv* env, jobject thiz) {
|
|
|
|
return static_cast<jint>(longHash ^ (longHash >> 32)); // See Long.hashCode()
|
|
|
|
}
|
|
|
|
|
|
|
|
-static JNINativeMethod gMethods[] = {
|
|
|
|
+static const JNINativeMethod gMethods[] = {
|
|
|
|
{ "native_init", "()J", (void *)JHwRemoteBinder_native_init },
|
|
|
|
|
|
|
|
{ "native_setup_empty", "()V",
|
|
|
|
diff --git a/core/jni/android_util_jar_StrictJarFile.cpp b/core/jni/android_util_jar_StrictJarFile.cpp
|
|
|
|
index 4ab8db4395f6..3de94cd34e78 100644
|
|
|
|
--- a/core/jni/android_util_jar_StrictJarFile.cpp
|
|
|
|
+++ b/core/jni/android_util_jar_StrictJarFile.cpp
|
|
|
|
@@ -156,7 +156,7 @@ static void StrictJarFile_nativeClose(JNIEnv*, jobject, jlong nativeHandle) {
|
|
|
|
CloseArchive(reinterpret_cast<ZipArchiveHandle>(nativeHandle));
|
|
|
|
}
|
|
|
|
|
|
|
|
-static JNINativeMethod gMethods[] = {
|
|
|
|
+static const JNINativeMethod gMethods[] = {
|
|
|
|
NATIVE_METHOD(StrictJarFile, nativeOpenJarFile, "(Ljava/lang/String;I)J"),
|
|
|
|
NATIVE_METHOD(StrictJarFile, nativeStartIteration, "(JLjava/lang/String;)J"),
|
|
|
|
NATIVE_METHOD(StrictJarFile, nativeNextEntry, "(J)Ljava/util/zip/ZipEntry;"),
|
|
|
|
diff --git a/core/jni/android_view_DisplayListCanvas.cpp b/core/jni/android_view_DisplayListCanvas.cpp
|
|
|
|
index 5197e7d481eb..d594f188eae3 100644
|
|
|
|
--- a/core/jni/android_view_DisplayListCanvas.cpp
|
|
|
|
+++ b/core/jni/android_view_DisplayListCanvas.cpp
|
|
|
|
@@ -184,7 +184,7 @@ static void android_view_DisplayListCanvas_drawCircleProps(jlong canvasPtr,
|
|
|
|
|
|
|
|
const char* const kClassPathName = "android/view/DisplayListCanvas";
|
|
|
|
|
|
|
|
-static JNINativeMethod gMethods[] = {
|
|
|
|
+static const JNINativeMethod gMethods[] = {
|
|
|
|
|
|
|
|
// ------------ @FastNative ------------------
|
|
|
|
|
|
|
|
diff --git a/media/jni/android_media_ImageWriter.cpp b/media/jni/android_media_ImageWriter.cpp
|
|
|
|
index 031e373241cb..2ad9dbe458ae 100644
|
|
|
|
--- a/media/jni/android_media_ImageWriter.cpp
|
|
|
|
+++ b/media/jni/android_media_ImageWriter.cpp
|
|
|
|
@@ -829,7 +829,7 @@ static jobjectArray Image_createSurfacePlanes(JNIEnv* env, jobject thiz,
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
-static JNINativeMethod gImageWriterMethods[] = {
|
|
|
|
+static const JNINativeMethod gImageWriterMethods[] = {
|
|
|
|
{"nativeClassInit", "()V", (void*)ImageWriter_classInit },
|
|
|
|
{"nativeInit", "(Ljava/lang/Object;Landroid/view/Surface;II)J",
|
|
|
|
(void*)ImageWriter_init },
|
|
|
|
@@ -840,7 +840,7 @@ static JNINativeMethod gImageWriterMethods[] = {
|
|
|
|
{"cancelImage", "(JLandroid/media/Image;)V", (void*)ImageWriter_cancelImage },
|
|
|
|
};
|
|
|
|
|
|
|
|
-static JNINativeMethod gImageMethods[] = {
|
|
|
|
+static const JNINativeMethod gImageMethods[] = {
|
|
|
|
{"nativeCreatePlanes", "(II)[Landroid/media/ImageWriter$WriterSurfaceImage$SurfacePlane;",
|
|
|
|
(void*)Image_createSurfacePlanes },
|
|
|
|
{"nativeGetWidth", "()I", (void*)Image_getWidth },
|
|
|
|
diff --git a/media/jni/android_media_MediaSync.cpp b/media/jni/android_media_MediaSync.cpp
|
|
|
|
index f75200868a0d..994997f7c132 100644
|
|
|
|
--- a/media/jni/android_media_MediaSync.cpp
|
|
|
|
+++ b/media/jni/android_media_MediaSync.cpp
|
|
|
|
@@ -514,7 +514,7 @@ static void android_media_MediaSync_native_finalize(JNIEnv *env, jobject thiz) {
|
|
|
|
android_media_MediaSync_release(env, thiz);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static JNINativeMethod gMethods[] = {
|
|
|
|
+static const JNINativeMethod gMethods[] = {
|
|
|
|
{ "native_setSurface",
|
|
|
|
"(Landroid/view/Surface;)V",
|
|
|
|
(void *)android_media_MediaSync_native_setSurface },
|
|
|
|
diff --git a/media/jni/soundpool/android_media_SoundPool.cpp b/media/jni/soundpool/android_media_SoundPool.cpp
|
|
|
|
index f6706369f379..7032b4bf7ef9 100644
|
|
|
|
--- a/media/jni/soundpool/android_media_SoundPool.cpp
|
|
|
|
+++ b/media/jni/soundpool/android_media_SoundPool.cpp
|
|
|
|
@@ -242,7 +242,7 @@ android_media_SoundPool_release(JNIEnv *env, jobject thiz)
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Dalvik VM type signatures
|
|
|
|
-static JNINativeMethod gMethods[] = {
|
|
|
|
+static const JNINativeMethod gMethods[] = {
|
|
|
|
{ "_load",
|
|
|
|
"(Ljava/io/FileDescriptor;JJI)I",
|
|
|
|
(void *)android_media_SoundPool_load_FD
|
|
|
|
diff --git a/services/core/jni/com_android_server_UsbMidiDevice.cpp b/services/core/jni/com_android_server_UsbMidiDevice.cpp
|
|
|
|
index 79d935fe610c..86b43fcae705 100644
|
|
|
|
--- a/services/core/jni/com_android_server_UsbMidiDevice.cpp
|
|
|
|
+++ b/services/core/jni/com_android_server_UsbMidiDevice.cpp
|
|
|
|
@@ -135,7 +135,7 @@ android_server_UsbMidiDevice_close(JNIEnv *env, jobject thiz, jobjectArray fds)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-static JNINativeMethod method_table[] = {
|
|
|
|
+static const JNINativeMethod method_table[] = {
|
|
|
|
{ "nativeGetSubdeviceCount", "(II)I", (void*)android_server_UsbMidiDevice_get_subdevice_count },
|
|
|
|
{ "nativeOpen", "(III)[Ljava/io/FileDescriptor;", (void*)android_server_UsbMidiDevice_open },
|
|
|
|
{ "nativeClose", "([Ljava/io/FileDescriptor;)V", (void*)android_server_UsbMidiDevice_close },
|
|
|
|
diff --git a/services/core/jni/com_android_server_tv_TvUinputBridge.cpp b/services/core/jni/com_android_server_tv_TvUinputBridge.cpp
|
|
|
|
index 980922a806f5..84d6f3d83156 100644
|
|
|
|
--- a/services/core/jni/com_android_server_tv_TvUinputBridge.cpp
|
|
|
|
+++ b/services/core/jni/com_android_server_tv_TvUinputBridge.cpp
|
|
|
|
@@ -276,7 +276,7 @@ static void nativeClear(JNIEnv* env, jclass clazz, jlong ptr) {
|
|
|
|
* JNI registration
|
|
|
|
*/
|
|
|
|
|
|
|
|
-static JNINativeMethod gUinputBridgeMethods[] = {
|
|
|
|
+static const JNINativeMethod gUinputBridgeMethods[] = {
|
|
|
|
{ "nativeOpen", "(Ljava/lang/String;Ljava/lang/String;III)J",
|
|
|
|
(void*)nativeOpen },
|
|
|
|
{ "nativeClose", "(J)V",
|
|
|
|
diff --git a/tests/net/jni/apf_jni.cpp b/tests/net/jni/apf_jni.cpp
|
|
|
|
index 1ea9e274ab9e..f4b61a7ca80a 100644
|
|
|
|
--- a/tests/net/jni/apf_jni.cpp
|
|
|
|
+++ b/tests/net/jni/apf_jni.cpp
|
|
|
|
@@ -185,7 +185,7 @@ extern "C" jint JNI_OnLoad(JavaVM* vm, void*) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
- static JNINativeMethod gMethods[] = {
|
|
|
|
+ static const JNINativeMethod gMethods[] = {
|
|
|
|
{ "apfSimulate", "([B[B[BI)I",
|
|
|
|
(void*)com_android_server_ApfTest_apfSimulate },
|
|
|
|
{ "compileToBpf", "(Ljava/lang/String;)Ljava/lang/String;",
|