static void bta2dp_connection_state_callback(btav_connection_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;
}
env->GetMethodID(clazz, "onAudioStateChanged", "(I[B)V");
/*
if ( (btInf = getBluetoothInterface()) == NULL) {
- LOGE("Bluetooth module is not loaded");
+ ALOGE("Bluetooth module is not loaded");
return;
}
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;
}
*/
// Do we need to do this every time the BT reenables?
/*
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;
}*/
- LOGI("%s: succeeds", __FUNCTION__);
+ ALOGI("%s: succeeds", __FUNCTION__);
}
static void initNative(JNIEnv *env, jobject object) {
bt_bdaddr_t * btAddr;
bt_status_t status;
- LOGI("%s: sBluetoothA2dpInterface: %p", __FUNCTION__, sBluetoothA2dpInterface);
+ ALOGI("%s: sBluetoothA2dpInterface: %p", __FUNCTION__, sBluetoothA2dpInterface);
if (!sBluetoothA2dpInterface) return JNI_FALSE;
addr = env->GetByteArrayElements(address, NULL);
}
if ((status = sBluetoothA2dpInterface->connect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) {
- LOGE("Failed HF connection, status: %d", status);
+ ALOGE("Failed HF connection, status: %d", status);
}
env->ReleaseByteArrayElements(address, addr, 0);
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}
if ( (status = sBluetoothA2dpInterface->disconnect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) {
- LOGE("Failed HF disconnection, status: %d", status);
+ ALOGE("Failed HF disconnection, status: %d", status);
}
env->ReleaseByteArrayElements(address, addr, 0);
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
void checkAndClearExceptionFromCallback(JNIEnv* env,
const char* methodName) {
if (env->ExceptionCheck()) {
- LOGE("An exception was thrown by callback '%s'.", methodName);
+ ALOGE("An exception was thrown by callback '%s'.", methodName);
LOGE_EX(env);
env->ExceptionClear();
}
static bool checkCallbackThread() {
JNIEnv* env = AndroidRuntime::getJNIEnv();
if (callbackEnv != env || callbackEnv == NULL) {
- LOGE("Callback env check fail: env: %p, callback: %p", env, callbackEnv);
+ ALOGE("Callback env check fail: env: %p, callback: %p", env, callbackEnv);
return false;
}
return true;
static void adapter_state_change_callback(bt_state_t status) {
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;
}
- LOGV("%s: Status is: %d", __FUNCTION__, status);
+ ALOGV("%s: Status is: %d", __FUNCTION__, status);
callbackEnv->CallVoidMethod(sJniCallbacksObj, method_stateChangeCallback, (jint)status);
return 0;
Fail:
if (propVal) callbackEnv->DeleteLocalRef(propVal);
- LOGE("Error while allocation of array in %s", __FUNCTION__);
+ ALOGE("Error while allocation of array in %s", __FUNCTION__);
return -1;
}
jclass mclass;
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;
}
- LOGV("%s: Status is: %d, Properties: %d", __FUNCTION__, status, num_properties);
+ ALOGV("%s: Status is: %d, Properties: %d", __FUNCTION__, status, num_properties);
if (status != BT_STATUS_SUCCESS) {
- LOGE("%s: Status %d is incorrect", __FUNCTION__, status);
+ ALOGE("%s: Status %d is incorrect", __FUNCTION__, status);
return;
}
static void remote_device_properties_callback(bt_status_t status, bt_bdaddr_t *bd_addr,
int num_properties, bt_property_t *properties) {
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;
}
- LOGV("%s: Status is: %d, Properties: %d", __FUNCTION__, status, num_properties);
+ ALOGV("%s: Status is: %d, Properties: %d", __FUNCTION__, status, num_properties);
if (status != BT_STATUS_SUCCESS) {
- LOGE("%s: Status %d is incorrect", __FUNCTION__, status);
+ ALOGE("%s: Status %d is incorrect", __FUNCTION__, status);
return;
}
return;
Fail:
- LOGE("Error while allocation byte array in %s", __FUNCTION__);
+ ALOGE("Error while allocation byte array in %s", __FUNCTION__);
}
(jbyte*)properties[i].val);
addr_index = i;
} else {
- LOGE("Address is NULL (unable to allocate) in %s", __FUNCTION__);
+ ALOGE("Address is NULL (unable to allocate) in %s", __FUNCTION__);
return;
}
}
}
if (addr == NULL) {
- LOGE("Address is NULL in %s", __FUNCTION__);
+ ALOGE("Address is NULL in %s", __FUNCTION__);
return;
}
- LOGV("%s: Properties: %d, Address: %s", __FUNCTION__, num_properties,
+ ALOGV("%s: Properties: %d, Address: %s", __FUNCTION__, num_properties,
(const char *)properties[addr_index].val);
remote_device_properties_callback(BT_STATUS_SUCCESS, (bt_bdaddr_t *)properties[addr_index].val,
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);
static void discovery_state_changed_callback(bt_discovery_state_t state) {
jbyteArray addr;
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;
}
- LOGV("%s: DiscoveryState:%d ", __FUNCTION__, state);
+ ALOGV("%s: DiscoveryState:%d ", __FUNCTION__, state);
callbackEnv->CallVoidMethod(sJniCallbacksObj, method_discoveryStateChangeCallback,
(jint)state);
static void pin_request_callback(bt_bdaddr_t *bd_addr, bt_bdname_t *bdname, uint32_t cod) {
jbyteArray addr, devname;
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;
}
Fail:
if (addr) callbackEnv->DeleteLocalRef(addr);
if (devname) callbackEnv->DeleteLocalRef(devname);
- LOGE("Error while allocating in: %s", __FUNCTION__);
+ ALOGE("Error while allocating in: %s", __FUNCTION__);
}
static void ssp_request_callback(bt_bdaddr_t *bd_addr, bt_bdname_t *bdname, uint32_t cod,
bt_ssp_variant_t pairing_variant, uint32_t pass_key) {
jbyteArray addr, devname;
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;
}
if (addr) callbackEnv->DeleteLocalRef(addr);
if (devname) callbackEnv->DeleteLocalRef(devname);
- LOGE("Error while allocating in: %s", __FUNCTION__);
+ ALOGE("Error while allocating in: %s", __FUNCTION__);
}
static void callback_thread_event(bt_cb_thread_evt event) {
args.name = name;
args.group = NULL;
vm->AttachCurrentThread(&callbackEnv, &args);
- LOGV("Callback thread attached: %p", callbackEnv);
+ ALOGV("Callback thread attached: %p", callbackEnv);
} else if (event == DISASSOCIATE_JVM) {
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;
}
vm->DetachCurrentThread();
bluetooth_module_t* btStack = (bluetooth_module_t *)abstraction;
sBluetoothInterface = btStack->get_bluetooth_interface();
} else {
- LOGE("Error while opening Bluetooth library");
+ ALOGE("Error while opening Bluetooth library");
}
} else {
- LOGE("No Bluetooth Library found");
+ ALOGE("No Bluetooth Library found");
}
}
static bool initNative(JNIEnv* env, jobject obj) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
sJniCallbacksObj = env->NewGlobalRef(env->GetObjectField(obj, sJniCallbacksField));
if (sBluetoothInterface) {
int ret = sBluetoothInterface->init(&sBluetoothCallbacks);
if (ret != BT_STATUS_SUCCESS) {
- LOGE("Error while setting the callbacks \n");
+ ALOGE("Error while setting the callbacks \n");
sBluetoothInterface = NULL;
return JNI_FALSE;
}
if ( (sBluetoothSocketInterface = (btsock_interface_t *)
sBluetoothInterface->get_profile_interface(BT_PROFILE_SOCKETS_ID)) == NULL) {
- LOGE("Error getting socket interface");
+ ALOGE("Error getting socket interface");
}
return JNI_TRUE;
}
}
static bool cleanupNative(JNIEnv *env, jobject obj) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jboolean result = JNI_FALSE;
if (!sBluetoothInterface) return result;
}
static jboolean enableNative(JNIEnv* env, jobject obj) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jboolean result = JNI_FALSE;
if (!sBluetoothInterface) return result;
}
static jboolean disableNative(JNIEnv* env, jobject obj) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jboolean result = JNI_FALSE;
if (!sBluetoothInterface) return result;
}
static jboolean startDiscoveryNative(JNIEnv* env, jobject obj) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jboolean result = JNI_FALSE;
if (!sBluetoothInterface) return result;
}
static jboolean cancelDiscoveryNative(JNIEnv* env, jobject obj) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jboolean result = JNI_FALSE;
if (!sBluetoothInterface) return result;
}
static jboolean createBondNative(JNIEnv* env, jobject obj, jbyteArray address) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jbyte *addr;
jboolean result = JNI_FALSE;
}
static jboolean removeBondNative(JNIEnv* env, jobject obj, jbyteArray address) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jbyte *addr;
jboolean result;
}
static jboolean cancelBondNative(JNIEnv* env, jobject obj, jbyteArray address) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jbyte *addr;
jboolean result;
static jboolean pinReplyNative(JNIEnv *env, jobject obj, jbyteArray address, jboolean accept,
jint len, jbyteArray pinArray) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jbyte *addr, *pinPtr = NULL;
jboolean result = JNI_FALSE;
static jboolean sspReplyNative(JNIEnv *env, jobject obj, jbyteArray address,
jint type, jboolean accept, jint passkey) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jbyte *addr;
jboolean result = JNI_FALSE;
}
static jboolean setAdapterPropertyNative(JNIEnv *env, jobject obj, jint type, jbyteArray value) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jbyte *val;
jboolean result = JNI_FALSE;
}
static jboolean getAdapterPropertiesNative(JNIEnv *env, jobject obj) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jboolean result = JNI_FALSE;
if (!sBluetoothInterface) return result;
}
static jboolean getAdapterPropertyNative(JNIEnv *env, jobject obj, jint type) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jboolean result = JNI_FALSE;
if (!sBluetoothInterface) return result;
}
static jboolean getDevicePropertyNative(JNIEnv *env, jobject obj, jbyteArray address, jint type) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jbyte *addr = NULL;
jboolean result = JNI_FALSE;
static jboolean setDevicePropertyNative(JNIEnv *env, jobject obj, jbyteArray address,
jint type, jbyteArray value) {
- LOGV("%s:",__FUNCTION__);
+ ALOGV("%s:",__FUNCTION__);
jbyte *val, *addr;
jboolean result = JNI_FALSE;
addr = env->GetByteArrayElements(address, NULL);
if (!addr) {
- LOGE("failed to get Bluetooth device address");
+ ALOGE("failed to get Bluetooth device address");
goto Fail;
}
uuid = env->GetByteArrayElements(uuidObj, NULL);
if (!uuid) {
- LOGE("failed to get uuid");
+ ALOGE("failed to get uuid");
goto Fail;
}
if ( (status = sBluetoothSocketInterface->connect((bt_bdaddr_t *) addr, (btsock_type_t) type,
(const uint8_t*) uuid, channel, &socket_fd, flag)) != BT_STATUS_SUCCESS) {
- LOGE("Socket connection failed: %d", status);
+ ALOGE("Socket connection failed: %d", status);
goto Fail;
}
if (socket_fd < 0) {
- LOGE("Fail to creat file descriptor on socket fd");
+ ALOGE("Fail to creat file descriptor on socket fd");
goto Fail;
}
env->ReleaseByteArrayElements(address, addr, 0);
uuid = env->GetByteArrayElements(uuidObj, NULL);
if (!uuid) {
- LOGE("failed to get uuid");
+ ALOGE("failed to get uuid");
goto Fail;
}
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);
+ ALOGE("Socket listen failed: %d", status);
goto Fail;
}
if (socket_fd < 0) {
- LOGE("Fail to creat file descriptor on socket fd");
+ ALOGE("Fail to creat file descriptor on socket fd");
goto Fail;
}
if (service_name) env->ReleaseStringUTFChars(name_str, service_name);
JNIEnv *e;
int status;
- LOGV("Bluetooth Adapter Service : loading JNI\n");
+ ALOGV("Bluetooth Adapter Service : loading JNI\n");
// Check JNI version
if(jvm->GetEnv((void **)&e, JNI_VERSION_1_6)) {
- LOGE("JNI version mismatch error");
+ ALOGE("JNI version mismatch error");
return JNI_ERR;
}
if ((status = android::register_com_android_bluetooth_btservice_AdapterService(e)) < 0) {
- LOGE("jni adapter service registration failure, status: %d", status);
+ ALOGE("jni adapter service registration failure, status: %d", status);
return JNI_ERR;
}
if ((status = android::register_com_android_bluetooth_hfp(e)) < 0) {
- LOGE("jni hfp registration failure, status: %d", status);
+ ALOGE("jni hfp registration failure, status: %d", status);
return JNI_ERR;
}
if ((status = android::register_com_android_bluetooth_a2dp(e)) < 0) {
- LOGE("jni a2dp registration failure: %d", status);
+ ALOGE("jni a2dp registration failure: %d", status);
return JNI_ERR;
}
if ((status = android::register_com_android_bluetooth_hid(e)) < 0) {
- LOGE("jni hid registration failure: %d", status);
+ ALOGE("jni hid registration failure: %d", status);
return JNI_ERR;
}
if ((status = android::register_com_android_bluetooth_hdp(e)) < 0) {
- LOGE("jni hdp registration failure: %d", status);
+ ALOGE("jni hdp registration failure: %d", status);
return JNI_ERR;
}
#define CHECK_CALLBACK_ENV \
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; \
}
JNIEnv* env = AndroidRuntime::getJNIEnv();
if (sCallbackEnv != env || sCallbackEnv == NULL) {
- LOGE("Callback env check fail: env: %p, callback: %p", env, sCallbackEnv);
+ ALOGE("Callback env check fail: env: %p, callback: %p", env, sCallbackEnv);
return false;
}
return true;
CHECK_CALLBACK_ENV
addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t));
if (!addr) {
- LOGE("Fail to new jbyteArray bd addr for channel state");
+ ALOGE("Fail to new jbyteArray bd addr for channel state");
checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__);
return;
}
if (state == BTHL_CONN_STATE_CONNECTED) {
fileDescriptor = jniCreateFileDescriptor(sCallbackEnv, fd);
if (!fileDescriptor) {
- LOGE("Failed to convert file descriptor, fd: %d", fd);
+ ALOGE("Failed to convert file descriptor, fd: %d", fd);
sCallbackEnv->DeleteLocalRef(addr);
return;
}
/*
if ( (btInf = getBluetoothInterface()) == NULL) {
- LOGE("Bluetooth module is not loaded");
+ ALOGE("Bluetooth module is not loaded");
return;
}
if ( (sBluetoothHdpInterface = (bthl_interface_t *)
btInf->get_profile_interface(BT_PROFILE_HEALTH_ID)) == NULL) {
- LOGE("Failed to get Bluetooth Handsfree Interface");
+ ALOGE("Failed to get Bluetooth Handsfree Interface");
return;
}
// TODO(BT) do this only once or
// Do we need to do this every time the BT reenables?
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;
}
*/
- LOGI("%s: succeeds", __FUNCTION__);
+ ALOGI("%s: succeeds", __FUNCTION__);
}
static void initializeNative(JNIEnv *env, jobject object) {
if ( (status = sBluetoothHdpInterface->register_application(®_param, &app_id)) !=
BT_STATUS_SUCCESS) {
- LOGE("Failed register health app, status: %d", status);
+ ALOGE("Failed register health app, status: %d", status);
return -1;
}
if (!sBluetoothHdpInterface) return JNI_FALSE;
if ((status = sBluetoothHdpInterface->unregister_application(app_id)) != BT_STATUS_SUCCESS) {
- LOGE("Failed to unregister app %d, status: %d", app_id, status);
+ ALOGE("Failed to unregister app %d, status: %d", app_id, status);
}
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}
addr = env->GetByteArrayElements(address, NULL);
if (!addr) {
- LOGE("Bluetooth device address null");
+ ALOGE("Bluetooth device address null");
return -1;
}
if ( (status = sBluetoothHdpInterface->connect_channel(app_id, (bt_bdaddr_t *) addr,
0, &chan_id)) !=
BT_STATUS_SUCCESS) {
- LOGE("Failed HDP channel connection, status: %d", status);
+ ALOGE("Failed HDP channel connection, status: %d", status);
chan_id = -1;
}
env->ReleaseByteArrayElements(address, addr, 0);
if ( (status = sBluetoothHdpInterface->destroy_channel(channel_id)) !=
BT_STATUS_SUCCESS) {
- LOGE("Failed disconnect health channel, status: %d", status);
+ ALOGE("Failed disconnect health channel, status: %d", status);
return JNI_FALSE;
}
return JNI_TRUE;
#define CHECK_CALLBACK_ENV \
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; \
}
static void connection_state_callback(bthf_connection_state_t state, bt_bdaddr_t* bd_addr) {
jbyteArray addr;
- LOGI("%s", __FUNCTION__);
+ ALOGI("%s", __FUNCTION__);
CHECK_CALLBACK_ENV
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;
}
CHECK_CALLBACK_ENV
addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t));
if (!addr) {
- LOGE("Fail to new jbyteArray bd addr for audio state");
+ ALOGE("Fail to new jbyteArray bd addr for audio state");
checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__);
return;
}
/*
if ( (btInf = getBluetoothInterface()) == NULL) {
- LOGE("Bluetooth module is not loaded");
+ ALOGE("Bluetooth module is not loaded");
return;
}
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;
}
// TODO(BT) do this only once or
// Do we need to do this every time the BT reenables?
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;
}
*/
- LOGI("%s: succeeds", __FUNCTION__);
+ ALOGI("%s: succeeds", __FUNCTION__);
}
static void initializeNative(JNIEnv *env, jobject object) {
jbyte *addr;
bt_status_t status;
- LOGI("%s: sBluetoothHfpInterface: %p", __FUNCTION__, sBluetoothHfpInterface);
+ ALOGI("%s: sBluetoothHfpInterface: %p", __FUNCTION__, sBluetoothHfpInterface);
if (!sBluetoothHfpInterface) return JNI_FALSE;
addr = env->GetByteArrayElements(address, NULL);
}
if ((status = sBluetoothHfpInterface->connect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) {
- LOGE("Failed HF connection, status: %d", status);
+ ALOGE("Failed HF connection, status: %d", status);
}
env->ReleaseByteArrayElements(address, addr, 0);
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}
if ( (status = sBluetoothHfpInterface->disconnect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) {
- LOGE("Failed HF disconnection, status: %d", status);
+ ALOGE("Failed HF disconnection, status: %d", status);
}
env->ReleaseByteArrayElements(address, addr, 0);
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
if ( (status = sBluetoothHfpInterface->connect_audio((bt_bdaddr_t *)addr)) !=
BT_STATUS_SUCCESS) {
- LOGE("Failed HF audio connection, status: %d", status);
+ ALOGE("Failed HF audio connection, status: %d", status);
}
env->ReleaseByteArrayElements(address, addr, 0);
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
if ( (status = sBluetoothHfpInterface->disconnect_audio((bt_bdaddr_t *) addr)) !=
BT_STATUS_SUCCESS) {
- LOGE("Failed HF audio disconnection, status: %d", status);
+ ALOGE("Failed HF audio disconnection, status: %d", status);
}
env->ReleaseByteArrayElements(address, addr, 0);
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
if (!sBluetoothHfpInterface) return JNI_FALSE;
if ( (status = sBluetoothHfpInterface->start_voice_recognition()) != BT_STATUS_SUCCESS) {
- LOGE("Failed to start voice recognition, status: %d", status);
+ ALOGE("Failed to start voice recognition, status: %d", status);
}
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}
if (!sBluetoothHfpInterface) return JNI_FALSE;
if ( (status = sBluetoothHfpInterface->stop_voice_recognition()) != BT_STATUS_SUCCESS) {
- LOGE("Failed to stop voice recognition, status: %d", status);
+ ALOGE("Failed to stop voice recognition, status: %d", status);
}
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}
if ( (status = sBluetoothHfpInterface->volume_control((bthf_volume_type_t) volume_type,
volume)) != BT_STATUS_SUCCESS) {
- LOGE("FAILED to control volume, status: %d", status);
+ ALOGE("FAILED to control volume, status: %d", status);
}
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}
if ( (status = sBluetoothHfpInterface->device_status_notification
((bthf_network_state_t) network_state, (bthf_service_type_t) service_type,
signal, battery_charge)) != BT_STATUS_SUCCESS) {
- LOGE("FAILED to notify device status, status: %d", status);
+ ALOGE("FAILED to notify device status, status: %d", status);
}
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}
operator_name = env->GetStringUTFChars(operator_str, NULL);
if ( (status = sBluetoothHfpInterface->cops_response(operator_name)) != BT_STATUS_SUCCESS) {
- LOGE("Failed sending cops response, status: %d", status);
+ ALOGE("Failed sending cops response, status: %d", status);
}
env->ReleaseStringUTFChars(operator_str, operator_name);
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
if ( (status = sBluetoothHfpInterface->cind_response(service, num_active, num_held,
(bthf_call_state_t) call_state,
signal, roam, battery_charge)) != BT_STATUS_SUCCESS) {
- LOGE("Failed cind_response, status: %d", status);
+ ALOGE("Failed cind_response, status: %d", status);
}
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}
response = env->GetStringUTFChars(response_str, NULL);
if ( (status = sBluetoothHfpInterface->formatted_at_response(response)) != BT_STATUS_SUCCESS) {
- LOGE("Failed formatted AT response, status: %d", status);
+ ALOGE("Failed formatted AT response, status: %d", status);
}
env->ReleaseStringUTFChars(response_str, response);
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
if ( (status = sBluetoothHfpInterface->at_response((bthf_at_response_t) response_code, cmee_code)) !=
BT_STATUS_SUCCESS) {
- LOGE("Failed AT response, status: %d", status);
+ ALOGE("Failed AT response, status: %d", status);
}
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}
(bthf_call_state_t) callStatus, (bthf_call_mode_t) mode,
mpty ? BTHF_CALL_MPTY_TYPE_MULTI : BTHF_CALL_MPTY_TYPE_SINGLE,
number, (bthf_call_addrtype_t) type)) != BT_STATUS_SUCCESS) {
- LOGE("Failed sending CLCC response, status: %d", status);
+ ALOGE("Failed sending CLCC response, status: %d", status);
}
if (number)
env->ReleaseStringUTFChars(number_str, number);
if ( (status = sBluetoothHfpInterface->phone_state_change(num_active, num_held,
(bthf_call_state_t) call_state, number,
(bthf_call_addrtype_t) type)) != BT_STATUS_SUCCESS) {
- LOGE("Failed report phone state change, status: %d", status);
+ ALOGE("Failed report phone state change, status: %d", status);
}
env->ReleaseStringUTFChars(number_str, number);
return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
#define CHECK_CALLBACK_ENV \
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; \
}
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;
}
/*
if ( (btInf = getBluetoothInterface()) == NULL) {
- LOGE("Bluetooth module is not loaded");
+ ALOGE("Bluetooth module is not loaded");
return;
}
if ( (sBluetoothHidInterface = (bthh_interface_t *)
btInf->get_profile_interface(BT_PROFILE_HIDHOST_ID)) == NULL) {
- LOGE("Failed to get Bluetooth Handsfree Interface");
+ ALOGE("Failed to get Bluetooth Handsfree Interface");
return;
}
// TODO(BT) do this only once or
// Do we need to do this every time the BT reenables?
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;
}
- ALOGI("%s: succeeds", __FUNCTION__);
*/
+ ALOGI("%s: succeeds", __FUNCTION__);
}
static void initializeNative(JNIEnv *env, jobject object) {
addr = env->GetByteArrayElements(address, NULL);
if (!addr) {
- LOGE("Bluetooth device address null");
+ ALOGE("Bluetooth device address null");
return JNI_FALSE;
}
if ((status = sBluetoothHidInterface->connect((bt_bdaddr_t *) addr)) !=
BT_STATUS_SUCCESS) {
- LOGE("Failed HID channel connection, status: %d", status);
+ ALOGE("Failed HID channel connection, status: %d", status);
ret = JNI_FALSE;
}
env->ReleaseByteArrayElements(address, addr, 0);
addr = env->GetByteArrayElements(address, NULL);
if (!addr) {
- LOGE("Bluetooth device address null");
+ ALOGE("Bluetooth device address null");
return JNI_FALSE;
}
if ( (status = sBluetoothHidInterface->disconnect((bt_bdaddr_t *) addr)) !=
BT_STATUS_SUCCESS) {
- LOGE("Failed disconnect hid channel, status: %d", status);
+ ALOGE("Failed disconnect hid channel, status: %d", status);
ret = JNI_FALSE;
}
env->ReleaseByteArrayElements(address, addr, 0);
cdmaIconLevel = (levelDbm < levelEcio) ? levelDbm : levelEcio;
if (mServiceState != null &&
- (mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0 ||
- mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A)) {
+ (mServiceState.getRadioTechnology() == ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_0 ||
+ mServiceState.getRadioTechnology() == ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_A)) {
int evdoEcio = signalStrength.getEvdoEcio();
int evdoSnr = signalStrength.getEvdoSnr();
int levelEvdoEcio = 0;