diff options
-rw-r--r-- | jni/com_android_bluetooth_a2dp.cpp | 18 | ||||
-rwxr-xr-x | jni/com_android_bluetooth_btservice_AdapterService.cpp | 26 | ||||
-rw-r--r-- | jni/com_android_bluetooth_hdp.cpp | 16 | ||||
-rw-r--r-- | jni/com_android_bluetooth_hfp.cpp | 16 | ||||
-rwxr-xr-x | jni/com_android_bluetooth_hid.cpp | 60 | ||||
-rw-r--r-- | jni/com_android_bluetooth_pan.cpp | 18 | ||||
-rwxr-xr-x | src/com/android/bluetooth/btservice/AdapterService.java | 5 | ||||
-rwxr-xr-x | src/com/android/bluetooth/pan/PanService.java | 11 |
8 files changed, 88 insertions, 82 deletions
diff --git a/jni/com_android_bluetooth_a2dp.cpp b/jni/com_android_bluetooth_a2dp.cpp index 1dbbd6149..10c69b8b9 100644 --- a/jni/com_android_bluetooth_a2dp.cpp +++ b/jni/com_android_bluetooth_a2dp.cpp @@ -60,15 +60,15 @@ static void bta2dp_connection_state_callback(btav_connection_state_t state, bt_b static void bta2dp_audio_state_callback(btav_audio_state_t state, bt_bdaddr_t* bd_addr) { jbyteArray addr; - LOGI("%s", __FUNCTION__); + ALOGI("%s", __FUNCTION__); if (!checkCallbackThread()) { \ - LOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__); \ + ALOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__); \ return; \ } addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { - LOGE("Fail to new jbyteArray bd addr for connection state"); + ALOGE("Fail to new jbyteArray bd addr for connection state"); checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__); return; } @@ -126,30 +126,30 @@ static void initNative(JNIEnv *env, jobject object) { bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { - LOGE("Bluetooth module is not loaded"); + ALOGE("Bluetooth module is not loaded"); return; } if (sBluetoothA2dpInterface !=NULL) { - LOGW("Cleaning up A2DP Interface before initializing..."); + ALOGW("Cleaning up A2DP Interface before initializing..."); sBluetoothA2dpInterface->cleanup(); sBluetoothA2dpInterface = NULL; } if (mCallbacksObj != NULL) { - LOGW("Cleaning up A2DP callback object"); + ALOGW("Cleaning up A2DP callback object"); env->DeleteGlobalRef(mCallbacksObj); mCallbacksObj = NULL; } if ( (sBluetoothA2dpInterface = (btav_interface_t *) btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_ID)) == NULL) { - LOGE("Failed to get Bluetooth A2DP Interface"); + ALOGE("Failed to get Bluetooth A2DP Interface"); return; } if ( (status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks)) != BT_STATUS_SUCCESS) { - LOGE("Failed to initialize Bluetooth A2DP, status: %d", status); + ALOGE("Failed to initialize Bluetooth A2DP, status: %d", status); sBluetoothA2dpInterface = NULL; return; } @@ -162,7 +162,7 @@ static void cleanupNative(JNIEnv *env, jobject object) { bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { - LOGE("Bluetooth module is not loaded"); + ALOGE("Bluetooth module is not loaded"); return; } diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp index 0d139c49d..c4ca767bd 100755 --- a/jni/com_android_bluetooth_btservice_AdapterService.cpp +++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp @@ -128,7 +128,7 @@ static void adapter_properties_callback(bt_status_t status, int num_properties, val = (jbyteArray) callbackEnv->NewByteArray(num_properties); if (val == NULL) { - LOGE("%s: Error allocating byteArray", __FUNCTION__); + ALOGE("%s: Error allocating byteArray", __FUNCTION__); return; } @@ -140,14 +140,14 @@ static void adapter_properties_callback(bt_status_t status, int num_properties, props = callbackEnv->NewObjectArray(num_properties, mclass, NULL); if (props == NULL) { - LOGE("%s: Error allocating object Array for properties", __FUNCTION__); + ALOGE("%s: Error allocating object Array for properties", __FUNCTION__); return; } types = (jintArray)callbackEnv->NewIntArray(num_properties); if (types == NULL) { - LOGE("%s: Error allocating int Array for values", __FUNCTION__); + ALOGE("%s: Error allocating int Array for values", __FUNCTION__); return; } // Delete the reference to val and mclass @@ -193,7 +193,7 @@ static void remote_device_properties_callback(bt_status_t status, bt_bdaddr_t *b val = (jbyteArray) callbackEnv->NewByteArray(num_properties); if (val == NULL) { - LOGE("%s: Error allocating byteArray", __FUNCTION__); + ALOGE("%s: Error allocating byteArray", __FUNCTION__); return; } @@ -205,14 +205,14 @@ static void remote_device_properties_callback(bt_status_t status, bt_bdaddr_t *b props = callbackEnv->NewObjectArray(num_properties, mclass, NULL); if (props == NULL) { - LOGE("%s: Error allocating object Array for properties", __FUNCTION__); + ALOGE("%s: Error allocating object Array for properties", __FUNCTION__); return; } types = (jintArray)callbackEnv->NewIntArray(num_properties); if (types == NULL) { - LOGE("%s: Error allocating int Array for values", __FUNCTION__); + ALOGE("%s: Error allocating int Array for values", __FUNCTION__); return; } // Delete the reference to val and mclass @@ -308,16 +308,16 @@ static void acl_state_changed_callback(bt_status_t status, bt_bdaddr_t *bd_addr, jbyteArray addr; int i; if (!checkCallbackThread()) { - LOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__); + ALOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__); return; } if (!bd_addr) { - LOGE("Address is null in %s", __FUNCTION__); + ALOGE("Address is null in %s", __FUNCTION__); return; } addr = callbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (addr == NULL) { - LOGE("Address allocation failed in %s", __FUNCTION__); + ALOGE("Address allocation failed in %s", __FUNCTION__); return; } callbackEnv->SetByteArrayRegion(addr, 0, sizeof(bt_bdaddr_t), (jbyte *)bd_addr); @@ -525,7 +525,7 @@ static bool cleanupNative(JNIEnv *env, jobject obj) { if (!sBluetoothInterface) return result; sBluetoothInterface->cleanup(); - LOGI("%s: return from cleanup",__FUNCTION__); + ALOGI("%s: return from cleanup",__FUNCTION__); env->DeleteGlobalRef(sJniCallbacksObj); return JNI_TRUE; @@ -792,7 +792,7 @@ static jboolean setDevicePropertyNative(JNIEnv *env, jobject obj, jbyteArray add } static jboolean getRemoteServicesNative(JNIEnv *env, jobject obj, jbyteArray address) { - LOGV("%s:",__FUNCTION__); + ALOGV("%s:",__FUNCTION__); jbyte *addr = NULL; jboolean result = JNI_FALSE; @@ -868,7 +868,7 @@ static int createSocketChannelNative(JNIEnv *env, jobject object, jint type, LOGE("failed to get uuid"); goto Fail; } - LOGE("SOCK FLAG = %x ***********************",flag); + ALOGE("SOCK FLAG = %x ***********************",flag); if ( (status = sBluetoothSocketInterface->listen((btsock_type_t) type, service_name, (const uint8_t*) uuid, channel, &socket_fd, flag)) != BT_STATUS_SUCCESS) { LOGE("Socket listen failed: %d", status); @@ -966,7 +966,7 @@ jint JNI_OnLoad(JavaVM *jvm, void *reserved) } if ((status = android::register_com_android_bluetooth_pan(e)) < 0) { - LOGE("jni pan registration failure: %d", status); + ALOGE("jni pan registration failure: %d", status); return JNI_ERR; } diff --git a/jni/com_android_bluetooth_hdp.cpp b/jni/com_android_bluetooth_hdp.cpp index 2389307e8..e42d8714c 100644 --- a/jni/com_android_bluetooth_hdp.cpp +++ b/jni/com_android_bluetooth_hdp.cpp @@ -123,30 +123,30 @@ static void initializeNative(JNIEnv *env, jobject object) { bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { - LOGE("Bluetooth module is not loaded"); + ALOGE("Bluetooth module is not loaded"); return; } if (sBluetoothHdpInterface !=NULL) { - LOGW("Cleaning up Bluetooth Health Interface before initializing..."); + ALOGW("Cleaning up Bluetooth Health Interface before initializing..."); sBluetoothHdpInterface->cleanup(); sBluetoothHdpInterface = NULL; } if (mCallbacksObj != NULL) { - LOGW("Cleaning up Bluetooth Health callback object"); + ALOGW("Cleaning up Bluetooth Health callback object"); env->DeleteGlobalRef(mCallbacksObj); mCallbacksObj = NULL; } if ( (sBluetoothHdpInterface = (bthl_interface_t *) btInf->get_profile_interface(BT_PROFILE_HEALTH_ID)) == NULL) { - LOGE("Failed to get Bluetooth Health Interface"); + ALOGE("Failed to get Bluetooth Health Interface"); return; } if ( (status = sBluetoothHdpInterface->init(&sBluetoothHdpCallbacks)) != BT_STATUS_SUCCESS) { - LOGE("Failed to initialize Bluetooth HDP, status: %d", status); + ALOGE("Failed to initialize Bluetooth HDP, status: %d", status); sBluetoothHdpInterface = NULL; return; } @@ -159,18 +159,18 @@ static void cleanupNative(JNIEnv *env, jobject object) { bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { - LOGE("Bluetooth module is not loaded"); + ALOGE("Bluetooth module is not loaded"); return; } if (sBluetoothHdpInterface !=NULL) { - LOGW("Cleaning up Bluetooth Health Interface..."); + ALOGW("Cleaning up Bluetooth Health Interface..."); sBluetoothHdpInterface->cleanup(); sBluetoothHdpInterface = NULL; } if (mCallbacksObj != NULL) { - LOGW("Cleaning up Bluetooth Health object"); + ALOGW("Cleaning up Bluetooth Health object"); env->DeleteGlobalRef(mCallbacksObj); mCallbacksObj = NULL; } diff --git a/jni/com_android_bluetooth_hfp.cpp b/jni/com_android_bluetooth_hfp.cpp index f73038275..749b51972 100644 --- a/jni/com_android_bluetooth_hfp.cpp +++ b/jni/com_android_bluetooth_hfp.cpp @@ -254,30 +254,30 @@ static void initializeNative(JNIEnv *env, jobject object) { bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { - LOGE("Bluetooth module is not loaded"); + ALOGE("Bluetooth module is not loaded"); return; } if (sBluetoothHfpInterface !=NULL) { - LOGW("Cleaning up Bluetooth Handsfree Interface before initializing..."); + ALOGW("Cleaning up Bluetooth Handsfree Interface before initializing..."); sBluetoothHfpInterface->cleanup(); sBluetoothHfpInterface = NULL; } if (mCallbacksObj != NULL) { - LOGW("Cleaning up Bluetooth Handsfree callback object"); + ALOGW("Cleaning up Bluetooth Handsfree callback object"); env->DeleteGlobalRef(mCallbacksObj); mCallbacksObj = NULL; } if ( (sBluetoothHfpInterface = (bthf_interface_t *) btInf->get_profile_interface(BT_PROFILE_HANDSFREE_ID)) == NULL) { - LOGE("Failed to get Bluetooth Handsfree Interface"); + ALOGE("Failed to get Bluetooth Handsfree Interface"); return; } if ( (status = sBluetoothHfpInterface->init(&sBluetoothHfpCallbacks)) != BT_STATUS_SUCCESS) { - LOGE("Failed to initialize Bluetooth HFP, status: %d", status); + ALOGE("Failed to initialize Bluetooth HFP, status: %d", status); sBluetoothHfpInterface = NULL; return; } @@ -290,18 +290,18 @@ static void cleanupNative(JNIEnv *env, jobject object) { bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { - LOGE("Bluetooth module is not loaded"); + ALOGE("Bluetooth module is not loaded"); return; } if (sBluetoothHfpInterface !=NULL) { - LOGW("Cleaning up Bluetooth Handsfree Interface..."); + ALOGW("Cleaning up Bluetooth Handsfree Interface..."); sBluetoothHfpInterface->cleanup(); sBluetoothHfpInterface = NULL; } if (mCallbacksObj != NULL) { - LOGW("Cleaning up Bluetooth Handsfree callback object"); + ALOGW("Cleaning up Bluetooth Handsfree callback object"); env->DeleteGlobalRef(mCallbacksObj); mCallbacksObj = NULL; } diff --git a/jni/com_android_bluetooth_hid.cpp b/jni/com_android_bluetooth_hid.cpp index b517ad05a..156ce0944 100755 --- a/jni/com_android_bluetooth_hid.cpp +++ b/jni/com_android_bluetooth_hid.cpp @@ -66,14 +66,14 @@ static void get_protocol_mode_callback(bt_bdaddr_t *bd_addr, bthh_status_t hh_st CHECK_CALLBACK_ENV if (hh_status != BTHH_OK) { - LOGE("BTHH Status is not OK!"); + ALOGE("BTHH Status is not OK!"); checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__); return; } addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { - LOGE("Fail to new jbyteArray bd addr for get protocal mode callback"); + ALOGE("Fail to new jbyteArray bd addr for get protocal mode callback"); checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__); return; } @@ -85,13 +85,13 @@ static void get_protocol_mode_callback(bt_bdaddr_t *bd_addr, bthh_status_t hh_st } static void virtual_unplug_callback(bt_bdaddr_t *bd_addr, bthh_status_t hh_status) { - LOGD("call to virtual_unplug_callback"); + ALOGD("call to virtual_unplug_callback"); jbyteArray addr; CHECK_CALLBACK_ENV addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { - LOGE("Fail to new jbyteArray bd addr for HID channel state"); + ALOGE("Fail to new jbyteArray bd addr for HID channel state"); checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__); return; } @@ -106,7 +106,7 @@ static void virtual_unplug_callback(bt_bdaddr_t *bd_addr, bthh_status_t hh_statu CHECK_CALLBACK_ENV addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { - LOGE("Fail to new jbyteArray bd addr for HID report"); + ALOGE("Fail to new jbyteArray bd addr for HID report"); checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__); return; } @@ -168,18 +168,18 @@ static void initializeNative(JNIEnv *env, jobject object) { bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { - LOGE("Bluetooth module is not loaded"); + ALOGE("Bluetooth module is not loaded"); return; } if (sBluetoothHidInterface !=NULL) { - LOGW("Cleaning up Bluetooth HID Interface before initializing..."); + ALOGW("Cleaning up Bluetooth HID Interface before initializing..."); sBluetoothHidInterface->cleanup(); sBluetoothHidInterface = NULL; } if (mCallbacksObj != NULL) { - LOGW("Cleaning up Bluetooth GID callback object"); + ALOGW("Cleaning up Bluetooth GID callback object"); env->DeleteGlobalRef(mCallbacksObj); mCallbacksObj = NULL; } @@ -187,12 +187,12 @@ static void initializeNative(JNIEnv *env, jobject object) { if ( (sBluetoothHidInterface = (bthh_interface_t *) btInf->get_profile_interface(BT_PROFILE_HIDHOST_ID)) == NULL) { - LOGE("Failed to get Bluetooth HID Interface"); + ALOGE("Failed to get Bluetooth HID Interface"); return; } if ( (status = sBluetoothHidInterface->init(&sBluetoothHidCallbacks)) != BT_STATUS_SUCCESS) { - LOGE("Failed to initialize Bluetooth HID, status: %d", status); + ALOGE("Failed to initialize Bluetooth HID, status: %d", status); sBluetoothHidInterface = NULL; return; } @@ -207,18 +207,18 @@ static void cleanupNative(JNIEnv *env, jobject object) { bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { - LOGE("Bluetooth module is not loaded"); + ALOGE("Bluetooth module is not loaded"); return; } if (sBluetoothHidInterface !=NULL) { - LOGW("Cleaning up Bluetooth HID Interface..."); + ALOGW("Cleaning up Bluetooth HID Interface..."); sBluetoothHidInterface->cleanup(); sBluetoothHidInterface = NULL; } if (mCallbacksObj != NULL) { - LOGW("Cleaning up Bluetooth GID callback object"); + ALOGW("Cleaning up Bluetooth GID callback object"); env->DeleteGlobalRef(mCallbacksObj); mCallbacksObj = NULL; } @@ -279,13 +279,13 @@ static jboolean getProtocolModeNative(JNIEnv *env, jobject object, jbyteArray ad addr = env->GetByteArrayElements(address, NULL); if (!addr) { - LOGE("Bluetooth device address null"); + ALOGE("Bluetooth device address null"); return JNI_FALSE; } if ( (status = sBluetoothHidInterface->get_protocol((bt_bdaddr_t *) addr, (bthh_protocol_mode_t) protocolMode)) != BT_STATUS_SUCCESS) { - LOGE("Failed get protocol mode, status: %d", status); + ALOGE("Failed get protocol mode, status: %d", status); ret = JNI_FALSE; } env->ReleaseByteArrayElements(address, addr, 0); @@ -301,12 +301,12 @@ static jboolean virtualUnPlugNative(JNIEnv *env, jobject object, jbyteArray addr addr = env->GetByteArrayElements(address, NULL); if (!addr) { - LOGE("Bluetooth device address null"); + ALOGE("Bluetooth device address null"); return JNI_FALSE; } if ( (status = sBluetoothHidInterface->virtual_unplug((bt_bdaddr_t *) addr)) != BT_STATUS_SUCCESS) { - LOGE("Failed virual unplug, status: %d", status); + ALOGE("Failed virual unplug, status: %d", status); ret = JNI_FALSE; } env->ReleaseByteArrayElements(address, addr, 0); @@ -321,11 +321,11 @@ static jboolean setProtocolModeNative(JNIEnv *env, jobject object, jbyteArray ad jboolean ret = JNI_TRUE; if (!sBluetoothHidInterface) return JNI_FALSE; - LOGD("%s: protocolMode = %d", __FUNCTION__, protocolMode); + ALOGD("%s: protocolMode = %d", __FUNCTION__, protocolMode); addr = env->GetByteArrayElements(address, NULL); if (!addr) { - LOGE("Bluetooth device address null"); + ALOGE("Bluetooth device address null"); return JNI_FALSE; } @@ -338,12 +338,12 @@ static jboolean setProtocolModeNative(JNIEnv *env, jobject object, jbyteArray ad mode = BTHH_BOOT_MODE; break; default: - LOGE("Unknown HID protocol mode"); + ALOGE("Unknown HID protocol mode"); return JNI_FALSE; } if ( (status = sBluetoothHidInterface->set_protocol((bt_bdaddr_t *) addr, mode)) != BT_STATUS_SUCCESS) { - LOGE("Failed set protocol mode, status: %d", status); + ALOGE("Failed set protocol mode, status: %d", status); ret = JNI_FALSE; } env->ReleaseByteArrayElements(address, addr, 0); @@ -352,7 +352,7 @@ static jboolean setProtocolModeNative(JNIEnv *env, jobject object, jbyteArray ad } static jboolean getReportNative(JNIEnv *env, jobject object, jbyteArray address, jbyte reportType, jbyte reportId, jint bufferSize) { - LOGD("%s: reportType = %d, reportId = %d, bufferSize = %d", __FUNCTION__, reportType, reportId, bufferSize); + ALOGD("%s: reportType = %d, reportId = %d, bufferSize = %d", __FUNCTION__, reportType, reportId, bufferSize); bt_status_t status; jbyte *addr; @@ -361,7 +361,7 @@ static jboolean getReportNative(JNIEnv *env, jobject object, jbyteArray address, addr = env->GetByteArrayElements(address, NULL); if (!addr) { - LOGE("Bluetooth device address null"); + ALOGE("Bluetooth device address null"); return JNI_FALSE; } @@ -370,7 +370,7 @@ static jboolean getReportNative(JNIEnv *env, jobject object, jbyteArray address, if ( (status = sBluetoothHidInterface->get_report((bt_bdaddr_t *) addr, (bthh_report_type_t) rType, (uint8_t) rId, bufferSize)) != BT_STATUS_SUCCESS) { - LOGE("Failed get report, status: %d", status); + ALOGE("Failed get report, status: %d", status); ret = JNI_FALSE; } env->ReleaseByteArrayElements(address, addr, 0); @@ -380,7 +380,7 @@ static jboolean getReportNative(JNIEnv *env, jobject object, jbyteArray address, static jboolean setReportNative(JNIEnv *env, jobject object, jbyteArray address, jbyte reportType, jstring report) { - LOGD("%s: reportType = %d", __FUNCTION__, reportType); + ALOGD("%s: reportType = %d", __FUNCTION__, reportType); bt_status_t status; jbyte *addr; jboolean ret = JNI_TRUE; @@ -388,7 +388,7 @@ static jboolean setReportNative(JNIEnv *env, jobject object, jbyteArray address, addr = env->GetByteArrayElements(address, NULL); if (!addr) { - LOGE("Bluetooth device address null"); + ALOGE("Bluetooth device address null"); return JNI_FALSE; } jint rType = reportType; @@ -396,7 +396,7 @@ static jboolean setReportNative(JNIEnv *env, jobject object, jbyteArray address, if ( (status = sBluetoothHidInterface->set_report((bt_bdaddr_t *) addr, (bthh_report_type_t)rType, (char*) c_report)) != BT_STATUS_SUCCESS) { - LOGE("Failed set report, status: %d", status); + ALOGE("Failed set report, status: %d", status); ret = JNI_FALSE; } env->ReleaseStringUTFChars(report, c_report); @@ -406,7 +406,7 @@ static jboolean setReportNative(JNIEnv *env, jobject object, jbyteArray address, } static jboolean sendDataNative(JNIEnv *env, jobject object, jbyteArray address, jstring report) { - LOGD("%s", __FUNCTION__); + ALOGD("%s", __FUNCTION__); bt_status_t status; jbyte *addr; jboolean ret = JNI_TRUE; @@ -414,13 +414,13 @@ static jboolean sendDataNative(JNIEnv *env, jobject object, jbyteArray address, addr = env->GetByteArrayElements(address, NULL); if (!addr) { - LOGE("Bluetooth device address null"); + ALOGE("Bluetooth device address null"); return JNI_FALSE; } const char *c_report = env->GetStringUTFChars(report, NULL); if ( (status = sBluetoothHidInterface->send_data((bt_bdaddr_t *) addr, (char*) c_report)) != BT_STATUS_SUCCESS) { - LOGE("Failed set report, status: %d", status); + ALOGE("Failed set report, status: %d", status); ret = JNI_FALSE; } env->ReleaseStringUTFChars(report, c_report); diff --git a/jni/com_android_bluetooth_pan.cpp b/jni/com_android_bluetooth_pan.cpp index 0d9c24052..176207cbb 100644 --- a/jni/com_android_bluetooth_pan.cpp +++ b/jni/com_android_bluetooth_pan.cpp @@ -20,11 +20,11 @@ #include <string.h> #include <cutils/log.h> -#define info(fmt, ...) LOGI ("%s(L%d): " fmt,__FUNCTION__, __LINE__, ## __VA_ARGS__) -#define debug(fmt, ...) LOGD ("%s(L%d): " fmt,__FUNCTION__, __LINE__, ## __VA_ARGS__) -#define warn(fmt, ...) LOGW ("## WARNING : %s(L%d): " fmt "##",__FUNCTION__, __LINE__, ## __VA_ARGS__) -#define error(fmt, ...) LOGE ("## ERROR : %s(L%d): " fmt "##",__FUNCTION__, __LINE__, ## __VA_ARGS__) -#define asrt(s) if(!(s)) LOGE ("## %s(L%d): ASSERT %s failed! ##",__FUNCTION__, __LINE__, #s) +#define info(fmt, ...) ALOGI ("%s(L%d): " fmt,__FUNCTION__, __LINE__, ## __VA_ARGS__) +#define debug(fmt, ...) ALOGD ("%s(L%d): " fmt,__FUNCTION__, __LINE__, ## __VA_ARGS__) +#define warn(fmt, ...) ALOGW ("## WARNING : %s(L%d): " fmt "##",__FUNCTION__, __LINE__, ## __VA_ARGS__) +#define error(fmt, ...) ALOGE ("## ERROR : %s(L%d): " fmt "##",__FUNCTION__, __LINE__, ## __VA_ARGS__) +#define asrt(s) if(!(s)) ALOGE ("## %s(L%d): ASSERT %s failed! ##",__FUNCTION__, __LINE__, #s) namespace android { @@ -104,13 +104,13 @@ static void initializeNative(JNIEnv *env, jobject object) { } if (sPanIf !=NULL) { - LOGW("Cleaning up Bluetooth PAN Interface before initializing..."); + ALOGW("Cleaning up Bluetooth PAN Interface before initializing..."); sPanIf->cleanup(); sPanIf = NULL; } if (mCallbacksObj != NULL) { - LOGW("Cleaning up Bluetooth PAN callback object"); + ALOGW("Cleaning up Bluetooth PAN callback object"); env->DeleteGlobalRef(mCallbacksObj); mCallbacksObj = NULL; } @@ -136,13 +136,13 @@ static void cleanupNative(JNIEnv *env, jobject object) { if (!btIf) return; if (sPanIf !=NULL) { - LOGW("Cleaning up Bluetooth PAN Interface..."); + ALOGW("Cleaning up Bluetooth PAN Interface..."); sPanIf->cleanup(); sPanIf = NULL; } if (mCallbacksObj != NULL) { - LOGW("Cleaning up Bluetooth PAN callback object"); + ALOGW("Cleaning up Bluetooth PAN callback object"); env->DeleteGlobalRef(mCallbacksObj); mCallbacksObj = NULL; } diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java index 2ea073afd..c4b97ebbd 100755 --- a/src/com/android/bluetooth/btservice/AdapterService.java +++ b/src/com/android/bluetooth/btservice/AdapterService.java @@ -561,6 +561,11 @@ public class AdapterService extends Service { return service.enable(); } + public boolean enableNoAutoConnect() { + // TODO(BT) + return false; + } + public boolean disable(boolean persist) { AdapterService service = getService(); if (service == null) return false; diff --git a/src/com/android/bluetooth/pan/PanService.java b/src/com/android/bluetooth/pan/PanService.java index 5ead7aa39..5184517b8 100755 --- a/src/com/android/bluetooth/pan/PanService.java +++ b/src/com/android/bluetooth/pan/PanService.java @@ -467,15 +467,16 @@ public class PanService extends ProfileService { ifcg = service.getInterfaceConfig(iface); if (ifcg != null) { InetAddress addr = null; - if (ifcg.addr == null || (addr = ifcg.addr.getAddress()) == null || + LinkAddress linkAddr = ifcg.getLinkAddress(); + if (linkAddr == null || (addr = linkAddr.getAddress()) == null || addr.equals(NetworkUtils.numericToInetAddress("0.0.0.0")) || addr.equals(NetworkUtils.numericToInetAddress("::0"))) { addr = NetworkUtils.numericToInetAddress(address); } - ifcg.interfaceFlags = ifcg.interfaceFlags.replace("down", "up"); - ifcg.addr = new LinkAddress(addr, BLUETOOTH_PREFIX_LENGTH); - ifcg.interfaceFlags = ifcg.interfaceFlags.replace("running", ""); - ifcg.interfaceFlags = ifcg.interfaceFlags.replace(" "," "); + ifcg.setInterfaceUp(); + ifcg.setLinkAddress(new LinkAddress(addr, BLUETOOTH_PREFIX_LENGTH)); + ifcg.clearFlag("running"); + // TODO(BT) ifcg.interfaceFlags = ifcg.interfaceFlags.replace(" "," "); service.setInterfaceConfig(iface, ifcg); if (cm.tether(iface) != ConnectivityManager.TETHER_ERROR_NO_ERROR) { Log.e(TAG, "Error tethering "+iface); |