diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2011-02-22 10:53:29 -0800 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2011-02-22 10:53:29 -0800 |
commit | 2653a1e7ca55b03f5230dffa85dfe2705757e2b7 (patch) | |
tree | b98777073df6bed7fd5a3d41c00a30495ff1bb0c /core/jni | |
parent | 4ab0e7746fe74a9e4d75d374f73b7af87420b2f6 (diff) | |
download | frameworks_base-2653a1e7ca55b03f5230dffa85dfe2705757e2b7.zip frameworks_base-2653a1e7ca55b03f5230dffa85dfe2705757e2b7.tar.gz frameworks_base-2653a1e7ca55b03f5230dffa85dfe2705757e2b7.tar.bz2 |
Fix compiler errors when compiled with debug option.
The Logv statement was missing the format specifier.
Change-Id: Ibf986d28dabfdbb3fbfd75381cb349448c6e57e7
Diffstat (limited to 'core/jni')
-rwxr-xr-x | core/jni/android_bluetooth_BluetoothAudioGateway.cpp | 64 | ||||
-rw-r--r-- | core/jni/android_bluetooth_BluetoothSocket.cpp | 20 | ||||
-rw-r--r-- | core/jni/android_bluetooth_HeadsetBase.cpp | 14 | ||||
-rw-r--r-- | core/jni/android_server_BluetoothA2dpService.cpp | 20 | ||||
-rw-r--r-- | core/jni/android_server_BluetoothEventLoop.cpp | 22 | ||||
-rw-r--r-- | core/jni/android_server_BluetoothService.cpp | 94 |
6 files changed, 117 insertions, 117 deletions
diff --git a/core/jni/android_bluetooth_BluetoothAudioGateway.cpp b/core/jni/android_bluetooth_BluetoothAudioGateway.cpp index bf23650..acf858a 100755 --- a/core/jni/android_bluetooth_BluetoothAudioGateway.cpp +++ b/core/jni/android_bluetooth_BluetoothAudioGateway.cpp @@ -89,40 +89,40 @@ static int setup_listening_socket(int dev, int channel); #endif static void classInitNative(JNIEnv* env, jclass clazz) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH /* in */ field_mNativeData = get_field(env, clazz, "mNativeData", "I"); - field_mHandsfreeAgRfcommChannel = + field_mHandsfreeAgRfcommChannel = get_field(env, clazz, "mHandsfreeAgRfcommChannel", "I"); - field_mHeadsetAgRfcommChannel = + field_mHeadsetAgRfcommChannel = get_field(env, clazz, "mHeadsetAgRfcommChannel", "I"); /* out */ - field_mConnectingHeadsetAddress = - get_field(env, clazz, + field_mConnectingHeadsetAddress = + get_field(env, clazz, "mConnectingHeadsetAddress", "Ljava/lang/String;"); - field_mConnectingHeadsetRfcommChannel = + field_mConnectingHeadsetRfcommChannel = get_field(env, clazz, "mConnectingHeadsetRfcommChannel", "I"); - field_mConnectingHeadsetSocketFd = + field_mConnectingHeadsetSocketFd = get_field(env, clazz, "mConnectingHeadsetSocketFd", "I"); - field_mConnectingHandsfreeAddress = - get_field(env, clazz, + field_mConnectingHandsfreeAddress = + get_field(env, clazz, "mConnectingHandsfreeAddress", "Ljava/lang/String;"); - field_mConnectingHandsfreeRfcommChannel = + field_mConnectingHandsfreeRfcommChannel = get_field(env, clazz, "mConnectingHandsfreeRfcommChannel", "I"); - field_mConnectingHandsfreeSocketFd = + field_mConnectingHandsfreeSocketFd = get_field(env, clazz, "mConnectingHandsfreeSocketFd", "I"); - field_mTimeoutRemainingMs = + field_mTimeoutRemainingMs = get_field(env, clazz, "mTimeoutRemainingMs", "I"); #endif } static void initializeNativeDataNative(JNIEnv* env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)calloc(1, sizeof(native_data_t)); if (NULL == nat) { @@ -150,7 +150,7 @@ static void initializeNativeDataNative(JNIEnv* env, jobject object) { } static void cleanupNativeDataNative(JNIEnv* env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); if (nat) { @@ -165,7 +165,7 @@ static void cleanupNativeDataNative(JNIEnv* env, jobject object) { static int set_nb(int sk, bool nb) { int flags = fcntl(sk, F_GETFL); if (flags < 0) { - LOGE("Can't get socket flags with fcntl(): %s (%d)", + LOGE("Can't get socket flags with fcntl(): %s (%d)", strerror(errno), errno); close(sk); return -1; @@ -255,7 +255,7 @@ static inline int on_accept_set_fields(JNIEnv* env, jobject object, static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, jint timeout_ms) { -// LOGV(__FUNCTION__); +// LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH env->SetIntField(object, field_mTimeoutRemainingMs, timeout_ms); @@ -264,11 +264,11 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, native_data_t *nat = get_native_data(env, object); #if USE_ACCEPT_DIRECTLY if (nat->hf_ag_rfcomm_channel > 0) { - LOGI("Setting HF AG server socket to RFCOMM port %d!", + LOGI("Setting HF AG server socket to RFCOMM port %d!", nat->hf_ag_rfcomm_channel); struct timeval tv; int len = sizeof(tv); - if (getsockopt(nat->hf_ag_rfcomm_channel, + if (getsockopt(nat->hf_ag_rfcomm_channel, SOL_SOCKET, SO_RCVTIMEO, &tv, &len) < 0) { LOGE("getsockopt(%d, SOL_SOCKET, SO_RCVTIMEO): %s (%d)", nat->hf_ag_rfcomm_channel, @@ -276,12 +276,12 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, errno); return JNI_FALSE; } - LOGI("Current HF AG server socket RCVTIMEO is (%d(s), %d(us))!", + LOGI("Current HF AG server socket RCVTIMEO is (%d(s), %d(us))!", (int)tv.tv_sec, (int)tv.tv_usec); if (timeout_ms >= 0) { tv.tv_sec = timeout_ms / 1000; tv.tv_usec = 1000 * (timeout_ms % 1000); - if (setsockopt(nat->hf_ag_rfcomm_channel, + if (setsockopt(nat->hf_ag_rfcomm_channel, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0) { LOGE("setsockopt(%d, SOL_SOCKET, SO_RCVTIMEO): %s (%d)", nat->hf_ag_rfcomm_channel, @@ -289,11 +289,11 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, errno); return JNI_FALSE; } - LOGI("Changed HF AG server socket RCVTIMEO to (%d(s), %d(us))!", + LOGI("Changed HF AG server socket RCVTIMEO to (%d(s), %d(us))!", (int)tv.tv_sec, (int)tv.tv_usec); } - if (!do_accept(env, object, nat->hf_ag_rfcomm_sock, + if (!do_accept(env, object, nat->hf_ag_rfcomm_sock, field_mConnectingHandsfreeSocketFd, field_mConnectingHandsfreeAddress, field_mConnectingHandsfreeRfcommChannel)) @@ -309,13 +309,13 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, FD_ZERO(&rset); int cnt = 0; if (nat->hf_ag_rfcomm_channel > 0) { - LOGI("Setting HF AG server socket to RFCOMM port %d!", + LOGI("Setting HF AG server socket to RFCOMM port %d!", nat->hf_ag_rfcomm_channel); cnt++; FD_SET(nat->hf_ag_rfcomm_sock, &rset); } if (nat->hs_ag_rfcomm_channel > 0) { - LOGI("Setting HS AG server socket to RFCOMM port %d!", + LOGI("Setting HS AG server socket to RFCOMM port %d!", nat->hs_ag_rfcomm_channel); cnt++; FD_SET(nat->hs_ag_rfcomm_sock, &rset); @@ -330,7 +330,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, to.tv_sec = timeout_ms / 1000; to.tv_usec = 1000 * (timeout_ms % 1000); } - n = select(MAX(nat->hf_ag_rfcomm_sock, + n = select(MAX(nat->hf_ag_rfcomm_sock, nat->hs_ag_rfcomm_sock) + 1, &rset, NULL, @@ -354,7 +354,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, return JNI_FALSE; } - n = on_accept_set_fields(env, object, + n = on_accept_set_fields(env, object, &rset, nat->hf_ag_rfcomm_sock, field_mConnectingHandsfreeSocketFd, field_mConnectingHandsfreeAddress, @@ -371,7 +371,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, struct pollfd fds[2]; int cnt = 0; if (nat->hf_ag_rfcomm_channel > 0) { -// LOGI("Setting HF AG server socket %d to RFCOMM port %d!", +// LOGI("Setting HF AG server socket %d to RFCOMM port %d!", // nat->hf_ag_rfcomm_sock, // nat->hf_ag_rfcomm_channel); fds[cnt].fd = nat->hf_ag_rfcomm_sock; @@ -379,7 +379,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, cnt++; } if (nat->hs_ag_rfcomm_channel > 0) { -// LOGI("Setting HS AG server socket %d to RFCOMM port %d!", +// LOGI("Setting HS AG server socket %d to RFCOMM port %d!", // nat->hs_ag_rfcomm_sock, // nat->hs_ag_rfcomm_channel); fds[cnt].fd = nat->hs_ag_rfcomm_sock; @@ -411,7 +411,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, if (fds[cnt].fd == nat->hf_ag_rfcomm_sock) { if (fds[cnt].revents & (POLLIN | POLLPRI | POLLOUT)) { LOGI("Accepting HF connection.\n"); - err += do_accept(env, object, fds[cnt].fd, + err += do_accept(env, object, fds[cnt].fd, field_mConnectingHandsfreeSocketFd, field_mConnectingHandsfreeAddress, field_mConnectingHandsfreeRfcommChannel); @@ -421,7 +421,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, else if (fds[cnt].fd == nat->hs_ag_rfcomm_sock) { if (fds[cnt].revents & (POLLIN | POLLPRI | POLLOUT)) { LOGI("Accepting HS connection.\n"); - err += do_accept(env, object, fds[cnt].fd, + err += do_accept(env, object, fds[cnt].fd, field_mConnectingHeadsetSocketFd, field_mConnectingHeadsetAddress, field_mConnectingHeadsetRfcommChannel); @@ -444,7 +444,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, } static jboolean setUpListeningSocketsNative(JNIEnv* env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); @@ -509,7 +509,7 @@ static int setup_listening_socket(int dev, int channel) { private native void tearDownListeningSocketsNative(); */ static void tearDownListeningSocketsNative(JNIEnv *env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); diff --git a/core/jni/android_bluetooth_BluetoothSocket.cpp b/core/jni/android_bluetooth_BluetoothSocket.cpp index 31ebf8c..b87f7c4 100644 --- a/core/jni/android_bluetooth_BluetoothSocket.cpp +++ b/core/jni/android_bluetooth_BluetoothSocket.cpp @@ -66,7 +66,7 @@ static struct asocket *get_socketData(JNIEnv *env, jobject obj) { static void initSocketFromFdNative(JNIEnv *env, jobject obj, jint fd) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); struct asocket *s = asocket_init(fd); @@ -85,7 +85,7 @@ static void initSocketFromFdNative(JNIEnv *env, jobject obj, jint fd) { static void initSocketNative(JNIEnv *env, jobject obj) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); int fd; int lm = 0; @@ -161,7 +161,7 @@ static void initSocketNative(JNIEnv *env, jobject obj) { static void connectNative(JNIEnv *env, jobject obj) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); int ret; jint type; @@ -240,7 +240,7 @@ static void connectNative(JNIEnv *env, jobject obj) { /* Returns errno instead of throwing, so java can check errno */ static int bindListenNative(JNIEnv *env, jobject obj) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); jint type; socklen_t addr_sz; @@ -307,7 +307,7 @@ static int bindListenNative(JNIEnv *env, jobject obj) { static jobject acceptNative(JNIEnv *env, jobject obj, int timeout) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); int fd; jint type; @@ -380,7 +380,7 @@ static jobject acceptNative(JNIEnv *env, jobject obj, int timeout) { static jint availableNative(JNIEnv *env, jobject obj) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); int available; struct asocket *s = get_socketData(env, obj); @@ -403,7 +403,7 @@ static jint availableNative(JNIEnv *env, jobject obj) { static jint readNative(JNIEnv *env, jobject obj, jbyteArray jb, jint offset, jint length) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); int ret; jbyte *b; @@ -446,7 +446,7 @@ static jint readNative(JNIEnv *env, jobject obj, jbyteArray jb, jint offset, static jint writeNative(JNIEnv *env, jobject obj, jbyteArray jb, jint offset, jint length) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); int ret; jbyte *b; @@ -488,7 +488,7 @@ static jint writeNative(JNIEnv *env, jobject obj, jbyteArray jb, jint offset, static void abortNative(JNIEnv *env, jobject obj) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); struct asocket *s = get_socketData(env, obj); if (!s) @@ -504,7 +504,7 @@ static void abortNative(JNIEnv *env, jobject obj) { static void destroyNative(JNIEnv *env, jobject obj) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); struct asocket *s = get_socketData(env, obj); int fd = s->fd; diff --git a/core/jni/android_bluetooth_HeadsetBase.cpp b/core/jni/android_bluetooth_HeadsetBase.cpp index 4e9fbaf..bbf1ae5 100644 --- a/core/jni/android_bluetooth_HeadsetBase.cpp +++ b/core/jni/android_bluetooth_HeadsetBase.cpp @@ -180,7 +180,7 @@ again: #endif static void classInitNative(JNIEnv* env, jclass clazz) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH field_mNativeData = get_field(env, clazz, "mNativeData", "I"); field_mAddress = get_field(env, clazz, "mAddress", "Ljava/lang/String;"); @@ -191,7 +191,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) { static void initializeNativeDataNative(JNIEnv* env, jobject object, jint socketFd) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)calloc(1, sizeof(native_data_t)); if (NULL == nat) { @@ -213,7 +213,7 @@ static void initializeNativeDataNative(JNIEnv* env, jobject object, } static void cleanupNativeDataNative(JNIEnv* env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)env->GetIntField(object, field_mNativeData); @@ -226,7 +226,7 @@ static void cleanupNativeDataNative(JNIEnv* env, jobject object) { static jboolean connectNative(JNIEnv *env, jobject obj) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH int lm; struct sockaddr_rc addr; @@ -278,7 +278,7 @@ static jboolean connectNative(JNIEnv *env, jobject obj) } static jint connectAsyncNative(JNIEnv *env, jobject obj) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH struct sockaddr_rc addr; native_data_t *nat = get_native_data(env, obj); @@ -357,7 +357,7 @@ static jint connectAsyncNative(JNIEnv *env, jobject obj) { static jint waitForAsyncConnectNative(JNIEnv *env, jobject obj, jint timeout_ms) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH struct sockaddr_rc addr; native_data_t *nat = get_native_data(env, obj); @@ -463,7 +463,7 @@ static jint waitForAsyncConnectNative(JNIEnv *env, jobject obj, } static void disconnectNative(JNIEnv *env, jobject obj) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, obj); if (nat->rfcomm_sock >= 0) { diff --git a/core/jni/android_server_BluetoothA2dpService.cpp b/core/jni/android_server_BluetoothA2dpService.cpp index 8c795af..1851ad6 100644 --- a/core/jni/android_server_BluetoothA2dpService.cpp +++ b/core/jni/android_server_BluetoothA2dpService.cpp @@ -61,7 +61,7 @@ static Properties sink_properties[] = { * Return false if dbus is down, or another serious error (out of memory) */ static bool initNative(JNIEnv* env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH nat = (native_data_t *)calloc(1, sizeof(native_data_t)); if (NULL == nat) { @@ -88,7 +88,7 @@ static bool initNative(JNIEnv* env, jobject object) { static void cleanupNative(JNIEnv* env, jobject object) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); if (nat) { dbus_connection_close(nat->conn); env->DeleteGlobalRef(nat->me); @@ -101,7 +101,7 @@ static void cleanupNative(JNIEnv* env, jobject object) { static jobjectArray getSinkPropertiesNative(JNIEnv *env, jobject object, jstring path) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); if (nat) { DBusMessage *msg, *reply; DBusError err; @@ -132,7 +132,7 @@ static jobjectArray getSinkPropertiesNative(JNIEnv *env, jobject object, static jboolean connectSinkNative(JNIEnv *env, jobject object, jstring path) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); if (nat) { const char *c_path = env->GetStringUTFChars(path, NULL); int len = env->GetStringLength(path) + 1; @@ -153,7 +153,7 @@ static jboolean connectSinkNative(JNIEnv *env, jobject object, jstring path) { static jboolean disconnectSinkNative(JNIEnv *env, jobject object, jstring path) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); if (nat) { const char *c_path = env->GetStringUTFChars(path, NULL); @@ -171,7 +171,7 @@ static jboolean disconnectSinkNative(JNIEnv *env, jobject object, static jboolean suspendSinkNative(JNIEnv *env, jobject object, jstring path) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); if (nat) { const char *c_path = env->GetStringUTFChars(path, NULL); bool ret = dbus_func_args_async(env, nat->conn, -1, NULL, NULL, nat, @@ -187,7 +187,7 @@ static jboolean suspendSinkNative(JNIEnv *env, jobject object, static jboolean resumeSinkNative(JNIEnv *env, jobject object, jstring path) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); if (nat) { const char *c_path = env->GetStringUTFChars(path, NULL); bool ret = dbus_func_args_async(env, nat->conn, -1, NULL, NULL, nat, @@ -203,7 +203,7 @@ static jboolean resumeSinkNative(JNIEnv *env, jobject object, static jboolean avrcpVolumeUpNative(JNIEnv *env, jobject object, jstring path) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); if (nat) { const char *c_path = env->GetStringUTFChars(path, NULL); bool ret = dbus_func_args_async(env, nat->conn, -1, NULL, NULL, nat, @@ -219,7 +219,7 @@ static jboolean avrcpVolumeUpNative(JNIEnv *env, jobject object, static jboolean avrcpVolumeDownNative(JNIEnv *env, jobject object, jstring path) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); if (nat) { const char *c_path = env->GetStringUTFChars(path, NULL); bool ret = dbus_func_args_async(env, nat->conn, -1, NULL, NULL, nat, @@ -278,7 +278,7 @@ DBusHandlerResult a2dp_event_filter(DBusMessage *msg, JNIEnv *env) { } void onConnectSinkResult(DBusMessage *msg, void *user, void *n) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = (native_data_t *)n; const char *path = (const char *)user; diff --git a/core/jni/android_server_BluetoothEventLoop.cpp b/core/jni/android_server_BluetoothEventLoop.cpp index fd12c2d..afaade8 100644 --- a/core/jni/android_server_BluetoothEventLoop.cpp +++ b/core/jni/android_server_BluetoothEventLoop.cpp @@ -88,7 +88,7 @@ native_data_t *get_EventLoop_native_data(JNIEnv *env, jobject object) { #endif static void classInitNative(JNIEnv* env, jclass clazz) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH method_onPropertyChanged = env->GetMethodID(clazz, "onPropertyChanged", @@ -147,7 +147,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) { } static void initializeNativeDataNative(JNIEnv* env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)calloc(1, sizeof(native_data_t)); if (NULL == nat) { @@ -175,7 +175,7 @@ static void initializeNativeDataNative(JNIEnv* env, jobject object) { } static void cleanupNativeDataNative(JNIEnv* env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)env->GetIntField(object, field_mNativeData); @@ -216,7 +216,7 @@ static short dbus_flags_to_unix_events(unsigned int flags) { } static jboolean setUpEventLoop(native_data_t *nat) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); if (nat != NULL && nat->conn != NULL) { dbus_threads_init_default(); @@ -395,7 +395,7 @@ static int register_agent(native_data_t *nat, } static void tearDownEventLoop(native_data_t *nat) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); if (nat != NULL && nat->conn != NULL) { DBusMessage *msg, *reply; @@ -1229,7 +1229,7 @@ success: #ifdef HAVE_BLUETOOTH void onCreatePairedDeviceResult(DBusMessage *msg, void *user, void *n) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = (native_data_t *)n; const char *address = (const char *)user; @@ -1298,7 +1298,7 @@ done: } void onCreateDeviceResult(DBusMessage *msg, void *user, void *n) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = (native_data_t *)n; const char *address= (const char *)user; @@ -1328,7 +1328,7 @@ void onCreateDeviceResult(DBusMessage *msg, void *user, void *n) { } void onDiscoverServicesResult(DBusMessage *msg, void *user, void *n) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = (native_data_t *)n; const char *path = (const char *)user; @@ -1354,7 +1354,7 @@ void onDiscoverServicesResult(DBusMessage *msg, void *user, void *n) { } void onGetDeviceServiceChannelResult(DBusMessage *msg, void *user, void *n) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); const char *address = (const char *) user; native_data_t *nat = (native_data_t *) n; @@ -1387,7 +1387,7 @@ done: } void onInputDeviceConnectionResult(DBusMessage *msg, void *user, void *n) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = (native_data_t *)n; const char *path = (const char *)user; @@ -1426,7 +1426,7 @@ void onInputDeviceConnectionResult(DBusMessage *msg, void *user, void *n) { } void onPanDeviceConnectionResult(DBusMessage *msg, void *user, void *n) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = (native_data_t *)n; const char *path = (const char *)user; diff --git a/core/jni/android_server_BluetoothService.cpp b/core/jni/android_server_BluetoothService.cpp index bf0504f..158e475 100644 --- a/core/jni/android_server_BluetoothService.cpp +++ b/core/jni/android_server_BluetoothService.cpp @@ -1,16 +1,16 @@ /* ** Copyright 2006, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ @@ -93,7 +93,7 @@ static inline native_data_t * get_native_data(JNIEnv *env, jobject object) { #endif static void classInitNative(JNIEnv* env, jclass clazz) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH field_mNativeData = get_field(env, clazz, "mNativeData", "I"); field_mEventLoop = get_field(env, clazz, "mEventLoop", @@ -105,7 +105,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) { * Return false if dbus is down, or another serious error (out of memory) */ static bool initializeNativeDataNative(JNIEnv* env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)calloc(1, sizeof(native_data_t)); if (NULL == nat) { @@ -144,7 +144,7 @@ static const char *get_adapter_path(JNIEnv* env, jobject object) { // This function is called when the adapter is enabled. static jboolean setupNativeDataNative(JNIEnv* env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)env->GetIntField(object, field_mNativeData); @@ -167,7 +167,7 @@ static jboolean setupNativeDataNative(JNIEnv* env, jobject object) { } static jboolean tearDownNativeDataNative(JNIEnv *env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)env->GetIntField(object, field_mNativeData); @@ -181,7 +181,7 @@ static jboolean tearDownNativeDataNative(JNIEnv *env, jobject object) { } static void cleanupNativeDataNative(JNIEnv* env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)env->GetIntField(object, field_mNativeData); @@ -193,7 +193,7 @@ static void cleanupNativeDataNative(JNIEnv* env, jobject object) { } static jstring getAdapterPathNative(JNIEnv *env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); if (nat) { @@ -205,7 +205,7 @@ static jstring getAdapterPathNative(JNIEnv *env, jobject object) { static jboolean startDiscoveryNative(JNIEnv *env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH DBusMessage *msg = NULL; DBusMessage *reply = NULL; @@ -251,7 +251,7 @@ done: } static void stopDiscoveryNative(JNIEnv *env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH DBusMessage *msg = NULL; DBusMessage *reply = NULL; @@ -297,7 +297,7 @@ done: } static jbyteArray readAdapterOutOfBandDataNative(JNIEnv *env, jobject object) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); DBusError err; @@ -338,7 +338,7 @@ static jbyteArray readAdapterOutOfBandDataNative(JNIEnv *env, jobject object) { static jboolean createPairedDeviceNative(JNIEnv *env, jobject object, jstring address, jint timeout_ms) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); @@ -374,7 +374,7 @@ static jboolean createPairedDeviceNative(JNIEnv *env, jobject object, static jboolean createPairedDeviceOutOfBandNative(JNIEnv *env, jobject object, jstring address, jint timeout_ms) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); @@ -411,7 +411,7 @@ static jint getDeviceServiceChannelNative(JNIEnv *env, jobject object, jstring path, jstring pattern, jint attr_id) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); struct event_loop_native_data_t *eventLoopNat = @@ -437,7 +437,7 @@ static jint getDeviceServiceChannelNative(JNIEnv *env, jobject object, static jboolean cancelDeviceCreationNative(JNIEnv *env, jobject object, jstring address) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); jboolean result = JNI_FALSE; #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); @@ -469,7 +469,7 @@ static jboolean cancelDeviceCreationNative(JNIEnv *env, jobject object, } static jboolean removeDeviceNative(JNIEnv *env, jobject object, jstring object_path) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); if (nat) { @@ -492,7 +492,7 @@ static jboolean removeDeviceNative(JNIEnv *env, jobject object, jstring object_p static jint enableNative(JNIEnv *env, jobject object) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); return bt_enable(); #endif return -1; @@ -500,7 +500,7 @@ static jint enableNative(JNIEnv *env, jobject object) { static jint disableNative(JNIEnv *env, jobject object) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); return bt_disable(); #endif return -1; @@ -508,7 +508,7 @@ static jint disableNative(JNIEnv *env, jobject object) { static jint isEnabledNative(JNIEnv *env, jobject object) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); return bt_is_enabled(); #endif return -1; @@ -518,7 +518,7 @@ static jboolean setPairingConfirmationNative(JNIEnv *env, jobject object, jstring address, bool confirm, int nativeData) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = get_native_data(env, object); if (nat) { DBusMessage *msg = (DBusMessage *)nativeData; @@ -549,7 +549,7 @@ static jboolean setPairingConfirmationNative(JNIEnv *env, jobject object, static jboolean setPasskeyNative(JNIEnv *env, jobject object, jstring address, int passkey, int nativeData) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = get_native_data(env, object); if (nat) { DBusMessage *msg = (DBusMessage *)nativeData; @@ -576,7 +576,7 @@ static jboolean setPasskeyNative(JNIEnv *env, jobject object, jstring address, static jboolean setRemoteOutOfBandDataNative(JNIEnv *env, jobject object, jstring address, jbyteArray hash, jbyteArray randomizer, int nativeData) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = get_native_data(env, object); if (nat) { DBusMessage *msg = (DBusMessage *)nativeData; @@ -610,7 +610,7 @@ static jboolean setRemoteOutOfBandDataNative(JNIEnv *env, jobject object, jstrin static jboolean setPinNative(JNIEnv *env, jobject object, jstring address, jstring pin, int nativeData) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = get_native_data(env, object); if (nat) { DBusMessage *msg = (DBusMessage *)nativeData; @@ -640,7 +640,7 @@ static jboolean setPinNative(JNIEnv *env, jobject object, jstring address, static jboolean cancelPairingUserInputNative(JNIEnv *env, jobject object, jstring address, int nativeData) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = get_native_data(env, object); if (nat) { DBusMessage *msg = (DBusMessage *)nativeData; @@ -666,7 +666,7 @@ static jobjectArray getDevicePropertiesNative(JNIEnv *env, jobject object, jstring path) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = get_native_data(env, object); if (nat) { DBusMessage *msg, *reply; @@ -705,7 +705,7 @@ static jobjectArray getDevicePropertiesNative(JNIEnv *env, jobject object, static jobjectArray getAdapterPropertiesNative(JNIEnv *env, jobject object) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = get_native_data(env, object); if (nat) { DBusMessage *msg, *reply; @@ -741,7 +741,7 @@ static jobjectArray getAdapterPropertiesNative(JNIEnv *env, jobject object) { static jboolean setAdapterPropertyNative(JNIEnv *env, jobject object, jstring key, void *value, jint type) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = get_native_data(env, object); if (nat) { DBusMessage *msg; @@ -808,7 +808,7 @@ static jboolean setAdapterPropertyBooleanNative(JNIEnv *env, jobject object, jst static jboolean setDevicePropertyNative(JNIEnv *env, jobject object, jstring path, jstring key, void *value, jint type) { #ifdef HAVE_BLUETOOTH - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); native_data_t *nat = get_native_data(env, object); if (nat) { DBusMessage *reply, *msg; @@ -863,7 +863,7 @@ static jboolean setDevicePropertyBooleanNative(JNIEnv *env, jobject object, static jboolean createDeviceNative(JNIEnv *env, jobject object, jstring address) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); @@ -894,7 +894,7 @@ static jboolean createDeviceNative(JNIEnv *env, jobject object, static jboolean discoverServicesNative(JNIEnv *env, jobject object, jstring path, jstring pattern) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); @@ -955,7 +955,7 @@ static jintArray extract_handles(JNIEnv *env, DBusMessage *reply) { static jintArray addReservedServiceRecordsNative(JNIEnv *env, jobject object, jintArray uuids) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH DBusMessage *reply = NULL; @@ -979,7 +979,7 @@ static jintArray addReservedServiceRecordsNative(JNIEnv *env, jobject object, static jboolean removeReservedServiceRecordsNative(JNIEnv *env, jobject object, jintArray handles) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); jint *values = env->GetIntArrayElements(handles, NULL); @@ -1002,7 +1002,7 @@ static jboolean removeReservedServiceRecordsNative(JNIEnv *env, jobject object, static jint addRfcommServiceRecordNative(JNIEnv *env, jobject object, jstring name, jlong uuidMsb, jlong uuidLsb, jshort channel) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); if (nat) { @@ -1027,7 +1027,7 @@ static jint addRfcommServiceRecordNative(JNIEnv *env, jobject object, } static jboolean removeServiceRecordNative(JNIEnv *env, jobject object, jint handle) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); if (nat) { @@ -1045,7 +1045,7 @@ static jboolean removeServiceRecordNative(JNIEnv *env, jobject object, jint hand static jboolean setLinkTimeoutNative(JNIEnv *env, jobject object, jstring object_path, jint num_slots) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); if (nat) { @@ -1064,7 +1064,7 @@ static jboolean setLinkTimeoutNative(JNIEnv *env, jobject object, jstring object } static jboolean connectInputDeviceNative(JNIEnv *env, jobject object, jstring path) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); @@ -1092,7 +1092,7 @@ static jboolean connectInputDeviceNative(JNIEnv *env, jobject object, jstring pa static jboolean disconnectInputDeviceNative(JNIEnv *env, jobject object, jstring path) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); @@ -1120,7 +1120,7 @@ static jboolean disconnectInputDeviceNative(JNIEnv *env, jobject object, static jboolean setBluetoothTetheringNative(JNIEnv *env, jobject object, jboolean value, jstring src_role, jstring bridge) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); if (nat) { @@ -1155,7 +1155,7 @@ static jboolean setBluetoothTetheringNative(JNIEnv *env, jobject object, jboolea static jboolean connectPanDeviceNative(JNIEnv *env, jobject object, jstring path, jstring dstRole) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH LOGE("connectPanDeviceNative"); native_data_t *nat = get_native_data(env, object); @@ -1187,7 +1187,7 @@ static jboolean connectPanDeviceNative(JNIEnv *env, jobject object, jstring path static jboolean disconnectPanDeviceNative(JNIEnv *env, jobject object, jstring path) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH LOGE("disconnectPanDeviceNative"); native_data_t *nat = get_native_data(env, object); @@ -1217,7 +1217,7 @@ static jboolean disconnectPanDeviceNative(JNIEnv *env, jobject object, static jboolean disconnectPanServerDeviceNative(JNIEnv *env, jobject object, jstring path, jstring address, jstring iface) { - LOGV(__FUNCTION__); + LOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH LOGE("disconnectPanServerDeviceNative"); native_data_t *nat = get_native_data(env, object); |