replace logx with alogx

Change-Id: Iec82cb4545bb26a8aa55dc7d473247396b9fd6e1

Conflicts:

	jni/com_android_bluetooth_hid.cpp
diff --git a/jni/com_android_bluetooth_a2dp.cpp b/jni/com_android_bluetooth_a2dp.cpp
index 10c69b8..7176a5d 100644
--- a/jni/com_android_bluetooth_a2dp.cpp
+++ b/jni/com_android_bluetooth_a2dp.cpp
@@ -37,15 +37,15 @@
 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;
     }
@@ -98,13 +98,13 @@
         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;
     }
     */
@@ -113,12 +113,12 @@
     //          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) {
@@ -182,7 +182,7 @@
     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);
@@ -193,7 +193,7 @@
     }
 
     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;
@@ -212,7 +212,7 @@
     }
 
     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;
diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp
index c4ca767..70b152c 100755
--- a/jni/com_android_bluetooth_btservice_AdapterService.cpp
+++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp
@@ -48,7 +48,7 @@
 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();
     }
@@ -57,7 +57,7 @@
 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;
@@ -65,10 +65,10 @@
 
 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);
 
@@ -103,7 +103,7 @@
     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;
 }
 
@@ -115,14 +115,14 @@
     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;
     }
 
@@ -172,14 +172,14 @@
 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;
     }
 
@@ -240,7 +240,7 @@
     return;
 
 Fail:
-    LOGE("Error while allocation byte array in %s", __FUNCTION__);
+    ALOGE("Error while allocation byte array in %s", __FUNCTION__);
 }
 
 
@@ -256,17 +256,17 @@
                                                 (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,
@@ -282,16 +282,16 @@
     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);
@@ -331,11 +331,11 @@
 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);
@@ -346,11 +346,11 @@
 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;
     }
 
@@ -373,18 +373,18 @@
 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;
     }
 
@@ -408,7 +408,7 @@
     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) {
@@ -421,10 +421,10 @@
         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();
@@ -490,28 +490,28 @@
             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;
     }
@@ -519,7 +519,7 @@
 }
 
 static bool cleanupNative(JNIEnv *env, jobject obj) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jboolean result = JNI_FALSE;
     if (!sBluetoothInterface) return result;
@@ -532,7 +532,7 @@
 }
 
 static jboolean enableNative(JNIEnv* env, jobject obj) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jboolean result = JNI_FALSE;
     if (!sBluetoothInterface) return result;
@@ -543,7 +543,7 @@
 }
 
 static jboolean disableNative(JNIEnv* env, jobject obj) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jboolean result = JNI_FALSE;
     if (!sBluetoothInterface) return result;
@@ -554,7 +554,7 @@
 }
 
 static jboolean startDiscoveryNative(JNIEnv* env, jobject obj) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jboolean result = JNI_FALSE;
     if (!sBluetoothInterface) return result;
@@ -565,7 +565,7 @@
 }
 
 static jboolean cancelDiscoveryNative(JNIEnv* env, jobject obj) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jboolean result = JNI_FALSE;
     if (!sBluetoothInterface) return result;
@@ -576,7 +576,7 @@
 }
 
 static jboolean createBondNative(JNIEnv* env, jobject obj, jbyteArray address) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jbyte *addr;
     jboolean result = JNI_FALSE;
@@ -597,7 +597,7 @@
 }
 
 static jboolean removeBondNative(JNIEnv* env, jobject obj, jbyteArray address) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jbyte *addr;
     jboolean result;
@@ -617,7 +617,7 @@
 }
 
 static jboolean cancelBondNative(JNIEnv* env, jobject obj, jbyteArray address) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jbyte *addr;
     jboolean result;
@@ -638,7 +638,7 @@
 
 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;
@@ -670,7 +670,7 @@
 
 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;
@@ -691,7 +691,7 @@
 }
 
 static jboolean setAdapterPropertyNative(JNIEnv *env, jobject obj, jint type, jbyteArray value) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jbyte *val;
     jboolean result = JNI_FALSE;
@@ -711,7 +711,7 @@
 }
 
 static jboolean getAdapterPropertiesNative(JNIEnv *env, jobject obj) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jboolean result = JNI_FALSE;
     if (!sBluetoothInterface) return result;
@@ -723,7 +723,7 @@
 }
 
 static jboolean getAdapterPropertyNative(JNIEnv *env, jobject obj, jint type) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jboolean result = JNI_FALSE;
     if (!sBluetoothInterface) return result;
@@ -735,7 +735,7 @@
 }
 
 static jboolean getDevicePropertyNative(JNIEnv *env, jobject obj, jbyteArray address, jint type) {
-    LOGV("%s:",__FUNCTION__);
+    ALOGV("%s:",__FUNCTION__);
 
     jbyte *addr = NULL;
     jboolean result = JNI_FALSE;
@@ -757,7 +757,7 @@
 
 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;
@@ -820,25 +820,25 @@
 
     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);
@@ -865,18 +865,18 @@
 
     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);
@@ -932,36 +932,36 @@
    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;
    }
 
diff --git a/jni/com_android_bluetooth_hdp.cpp b/jni/com_android_bluetooth_hdp.cpp
index e42d871..dd73f4b 100644
--- a/jni/com_android_bluetooth_hdp.cpp
+++ b/jni/com_android_bluetooth_hdp.cpp
@@ -8,7 +8,7 @@
 
 #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;                                                                  \
    }
 
@@ -33,7 +33,7 @@
 
     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;
@@ -55,7 +55,7 @@
     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;
     }
@@ -64,7 +64,7 @@
     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;
         }
@@ -96,26 +96,26 @@
 
 /*
     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) {
@@ -199,7 +199,7 @@
 
     if ( (status = sBluetoothHdpInterface->register_application(&reg_param, &app_id)) !=
          BT_STATUS_SUCCESS) {
-        LOGE("Failed register health app, status: %d", status);
+        ALOGE("Failed register health app, status: %d", status);
         return -1;
     }
 
@@ -213,7 +213,7 @@
     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;
 }
@@ -227,14 +227,14 @@
 
     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);
@@ -248,7 +248,7 @@
 
     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;
diff --git a/jni/com_android_bluetooth_hfp.cpp b/jni/com_android_bluetooth_hfp.cpp
index 749b519..2545408 100644
--- a/jni/com_android_bluetooth_hfp.cpp
+++ b/jni/com_android_bluetooth_hfp.cpp
@@ -8,7 +8,7 @@
 
 #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;                                                                  \
    }
 
@@ -58,12 +58,12 @@
 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;
     }
@@ -81,7 +81,7 @@
     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;
     }
@@ -227,26 +227,26 @@
 
     /*
     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) {
@@ -311,7 +311,7 @@
     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);
@@ -321,7 +321,7 @@
     }
 
     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;
@@ -340,7 +340,7 @@
     }
 
     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;
@@ -360,7 +360,7 @@
 
     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;
@@ -380,7 +380,7 @@
 
     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;
@@ -391,7 +391,7 @@
     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;
 }
@@ -401,7 +401,7 @@
     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;
 }
@@ -412,7 +412,7 @@
 
     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;
 }
@@ -426,7 +426,7 @@
     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;
 }
@@ -439,7 +439,7 @@
     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;
@@ -454,7 +454,7 @@
     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;
 }
@@ -468,7 +468,7 @@
     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;
@@ -480,7 +480,7 @@
 
     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;
 }
@@ -499,7 +499,7 @@
                      (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);
@@ -517,7 +517,7 @@
     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;
diff --git a/jni/com_android_bluetooth_hid.cpp b/jni/com_android_bluetooth_hid.cpp
index 156ce09..376a72d 100755
--- a/jni/com_android_bluetooth_hid.cpp
+++ b/jni/com_android_bluetooth_hid.cpp
@@ -8,7 +8,7 @@
 
 #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;                                                                  \
    }
 
@@ -50,7 +50,7 @@
     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;
     }
@@ -141,26 +141,26 @@
 
 /*
     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) {
@@ -234,13 +234,13 @@
 
     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);
@@ -256,13 +256,13 @@
 
     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);
diff --git a/src/com/android/bluetooth/hfp/HeadsetPhoneState.java b/src/com/android/bluetooth/hfp/HeadsetPhoneState.java
index 8744896..c490ad0 100644
--- a/src/com/android/bluetooth/hfp/HeadsetPhoneState.java
+++ b/src/com/android/bluetooth/hfp/HeadsetPhoneState.java
@@ -219,8 +219,8 @@
             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;