Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Commit

Permalink
constify JNINativeMethod tables
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Jun 1, 2020
1 parent 906df07 commit a48ba29
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_a2dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ static jboolean setCodecConfigPreferenceNative(JNIEnv* env, jobject object,
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initNative", "(I[Landroid/bluetooth/BluetoothCodecConfig;)V",
(void*)initNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_a2dp_sink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static void informAudioTrackGainNative(JNIEnv* env, jobject object,
sBluetoothA2dpInterface->set_audio_track_gain((float)gain);
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initNative", "()V", (void*)initNative},
{"cleanupNative", "()V", (void*)cleanupNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_avrcp_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ static void playItemNative(JNIEnv* env, jobject object, jbyteArray address,
env->ReleaseByteArrayElements(address, addr, 0);
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initNative", "()V", (void*)initNative},
{"cleanupNative", "()V", (void*)cleanupNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_avrcp_target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ static void setVolume(int8_t volume) {
sCallbackEnv->CallVoidMethod(mJavaInterface, method_setVolume, volume);
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initNative", "()V", (void*)initNative},
{"sendMediaUpdateNative", "(ZZZ)V", (void*)sendMediaUpdateNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_btservice_AdapterService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ static jbyteArray obfuscateAddressNative(JNIEnv* env, jobject obj,
return output_bytes;
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{"classInitNative", "()V", (void*)classInitNative},
{"initNative", "(ZZ)Z", (void*)initNative},
Expand Down
8 changes: 4 additions & 4 deletions jni/com_android_bluetooth_gatt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,7 @@ static void gattTestNative(JNIEnv* env, jobject object, jint command,
*/

// JNI functions defined in AdvertiseManager class.
static JNINativeMethod sAdvertiseMethods[] = {
static const JNINativeMethod sAdvertiseMethods[] = {
{"classInitNative", "()V", (void*)advertiseClassInitNative},
{"initializeNative", "()V", (void*)advertiseInitializeNative},
{"cleanupNative", "()V", (void*)advertiseCleanupNative},
Expand All @@ -2092,7 +2092,7 @@ static JNINativeMethod sAdvertiseMethods[] = {
};

// JNI functions defined in PeriodicScanManager class.
static JNINativeMethod sPeriodicScanMethods[] = {
static const JNINativeMethod sPeriodicScanMethods[] = {
{"classInitNative", "()V", (void*)periodicScanClassInitNative},
{"initializeNative", "()V", (void*)periodicScanInitializeNative},
{"cleanupNative", "()V", (void*)periodicScanCleanupNative},
Expand All @@ -2101,7 +2101,7 @@ static JNINativeMethod sPeriodicScanMethods[] = {
};

// JNI functions defined in ScanManager class.
static JNINativeMethod sScanMethods[] = {
static const JNINativeMethod sScanMethods[] = {
{"registerScannerNative", "(JJ)V", (void*)registerScannerNative},
{"unregisterScannerNative", "(I)V", (void*)unregisterScannerNative},
{"gattClientScanNative", "(Z)V", (void*)gattClientScanNative},
Expand Down Expand Up @@ -2134,7 +2134,7 @@ static JNINativeMethod sScanMethods[] = {
};

// JNI functions defined in GattService class.
static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initializeNative", "()V", (void*)initializeNative},
{"cleanupNative", "()V", (void*)cleanupNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_hearing_aid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static void setVolumeNative(JNIEnv* env, jclass clazz, jint volume) {
sHearingAidInterface->SetVolume(volume);
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initNative", "()V", (void*)initNative},
{"cleanupNative", "()V", (void*)cleanupNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_hfp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ static jboolean setActiveDeviceNative(JNIEnv* env, jobject object,
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initializeNative", "(IZ)V", (void*)initializeNative},
{"cleanupNative", "()V", (void*)cleanupNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_hfpclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ static jboolean sendATCmdNative(JNIEnv* env, jobject object, jbyteArray address,
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initializeNative", "()V", (void*)initializeNative},
{"cleanupNative", "()V", (void*)cleanupNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_hid_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ static jboolean disconnectNative(JNIEnv* env, jobject thiz) {
return result;
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initNative", "()V", (void*)initNative},
{"cleanupNative", "()V", (void*)cleanupNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_hid_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ static jboolean setIdleTimeNative(JNIEnv* env, jobject object,
return status == BT_STATUS_SUCCESS ? JNI_TRUE : JNI_FALSE;
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initializeNative", "()V", (void*)initializeNative},
{"cleanupNative", "()V", (void*)cleanupNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_pan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ static jboolean disconnectPanNative(JNIEnv* env, jobject object,
return ret;
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void*)classInitNative},
{"initializeNative", "()V", (void*)initializeNative},
{"cleanupNative", "()V", (void*)cleanupNative},
Expand Down
2 changes: 1 addition & 1 deletion jni/com_android_bluetooth_sdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static void cleanupNative(JNIEnv* env, jobject object) {
}
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{"classInitNative", "()V", (void*)classInitNative},
{"initializeNative", "()V", (void*)initializeNative},
Expand Down

0 comments on commit a48ba29

Please sign in to comment.