diff options
-rw-r--r-- | jni/com_android_nfc.cpp | 20 | ||||
-rw-r--r-- | jni/com_android_nfc_NativeLlcpConnectionlessSocket.cpp | 14 | ||||
-rw-r--r-- | jni/com_android_nfc_NativeLlcpServiceSocket.cpp | 2 | ||||
-rw-r--r-- | jni/com_android_nfc_NativeLlcpSocket.cpp | 18 | ||||
-rw-r--r-- | jni/com_android_nfc_NativeNfcManager.cpp | 118 | ||||
-rwxr-xr-x | jni/com_android_nfc_NativeNfcSecureElement.cpp | 66 | ||||
-rw-r--r-- | jni/com_android_nfc_NativeNfcTag.cpp | 42 | ||||
-rw-r--r-- | jni/com_android_nfc_NativeP2pDevice.cpp | 24 | ||||
-rw-r--r-- | jni/com_android_nfc_list.cpp | 12 |
9 files changed, 158 insertions, 158 deletions
diff --git a/jni/com_android_nfc.cpp b/jni/com_android_nfc.cpp index 8b877f1..fdfd656 100644 --- a/jni/com_android_nfc.cpp +++ b/jni/com_android_nfc.cpp @@ -67,7 +67,7 @@ JNIEnv *nfc_get_env() { JNIEnv *e; if (vm->GetEnv((void **)&e, JNI_VERSION_1_6) != JNI_OK) { - LOGE("Current thread is not attached to VM"); + ALOGE("Current thread is not attached to VM"); abort(); } return e; @@ -78,7 +78,7 @@ bool nfc_cb_data_init(nfc_jni_callback_data* pCallbackData, void* pContext) /* Create semaphore */ if(sem_init(&pCallbackData->sem, 0, 0) == -1) { - LOGE("Semaphore creation failed (errno=0x%08x)", errno); + ALOGE("Semaphore creation failed (errno=0x%08x)", errno); return false; } @@ -91,7 +91,7 @@ bool nfc_cb_data_init(nfc_jni_callback_data* pCallbackData, void* pContext) /* Add to active semaphore list */ if (!listAdd(&nfc_jni_get_monitor()->sem_list, pCallbackData)) { - LOGE("Failed to add the semaphore to the list"); + ALOGE("Failed to add the semaphore to the list"); } return true; @@ -102,13 +102,13 @@ void nfc_cb_data_deinit(nfc_jni_callback_data* pCallbackData) /* Destroy semaphore */ if (sem_destroy(&pCallbackData->sem)) { - LOGE("Failed to destroy semaphore (errno=0x%08x)", errno); + ALOGE("Failed to destroy semaphore (errno=0x%08x)", errno); } /* Remove from active semaphore list */ if (!listRemove(&nfc_jni_get_monitor()->sem_list, pCallbackData)) { - LOGE("Failed to remove semaphore from the list"); + ALOGE("Failed to remove semaphore from the list"); } } @@ -199,19 +199,19 @@ nfc_jni_native_monitor_t* nfc_jni_init_monitor(void) if(pthread_mutex_init(&nfc_jni_native_monitor->reentrance_mutex, &recursive_attr) == -1) { - LOGE("NFC Manager Reentrance Mutex creation returned 0x%08x", errno); + ALOGE("NFC Manager Reentrance Mutex creation returned 0x%08x", errno); return NULL; } if(pthread_mutex_init(&nfc_jni_native_monitor->concurrency_mutex, NULL) == -1) { - LOGE("NFC Manager Concurrency Mutex creation returned 0x%08x", errno); + ALOGE("NFC Manager Concurrency Mutex creation returned 0x%08x", errno); return NULL; } if(!listInit(&nfc_jni_native_monitor->sem_list)) { - LOGE("NFC Manager Semaphore List creation failed"); + ALOGE("NFC Manager Semaphore List creation failed"); return NULL; } @@ -219,13 +219,13 @@ nfc_jni_native_monitor_t* nfc_jni_init_monitor(void) if(pthread_mutex_init(&nfc_jni_native_monitor->incoming_socket_mutex, NULL) == -1) { - LOGE("NFC Manager incoming socket mutex creation returned 0x%08x", errno); + ALOGE("NFC Manager incoming socket mutex creation returned 0x%08x", errno); return NULL; } if(pthread_cond_init(&nfc_jni_native_monitor->incoming_socket_cond, NULL) == -1) { - LOGE("NFC Manager incoming socket condition creation returned 0x%08x", errno); + ALOGE("NFC Manager incoming socket condition creation returned 0x%08x", errno); return NULL; } diff --git a/jni/com_android_nfc_NativeLlcpConnectionlessSocket.cpp b/jni/com_android_nfc_NativeLlcpConnectionlessSocket.cpp index 7cf5350..442946c 100644 --- a/jni/com_android_nfc_NativeLlcpConnectionlessSocket.cpp +++ b/jni/com_android_nfc_NativeLlcpConnectionlessSocket.cpp @@ -88,7 +88,7 @@ static jboolean com_android_nfc_NativeLlcpConnectionlessSocket_doSendTo(JNIEnv * REENTRANCE_UNLOCK(); if(ret != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Llcp_SendTo() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_SendTo() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); goto clean_and_return; } TRACE("phLibNfc_Llcp_SendTo() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); @@ -96,7 +96,7 @@ static jboolean com_android_nfc_NativeLlcpConnectionlessSocket_doSendTo(JNIEnv * /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -139,7 +139,7 @@ static jobject com_android_nfc_NativeLlcpConnectionlessSocket_doReceiveFrom(JNIE /* Create new LlcpPacket object */ if(nfc_jni_cache_object(e,"android/nfc/LlcpPacket",&(llcpPacket)) == -1) { - LOGE("Find LlcpPacket class error"); + ALOGE("Find LlcpPacket class error"); goto clean_and_return; } @@ -147,7 +147,7 @@ static jobject com_android_nfc_NativeLlcpConnectionlessSocket_doReceiveFrom(JNIE clsLlcpPacket = e->GetObjectClass(llcpPacket); if(e->ExceptionCheck()) { - LOGE("Get Object class error"); + ALOGE("Get Object class error"); goto clean_and_return; } @@ -168,7 +168,7 @@ static jobject com_android_nfc_NativeLlcpConnectionlessSocket_doReceiveFrom(JNIE REENTRANCE_UNLOCK(); if(ret != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Llcp_RecvFrom() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_RecvFrom() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); goto clean_and_return; } TRACE("phLibNfc_Llcp_RecvFrom() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); @@ -176,7 +176,7 @@ static jobject com_android_nfc_NativeLlcpConnectionlessSocket_doReceiveFrom(JNIE /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -228,7 +228,7 @@ static jboolean com_android_nfc_NativeLlcpConnectionlessSocket_doClose(JNIEnv *e } else { - LOGE("phLibNfc_Llcp_Close() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Close() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); return FALSE; } } diff --git a/jni/com_android_nfc_NativeLlcpServiceSocket.cpp b/jni/com_android_nfc_NativeLlcpServiceSocket.cpp index 44f134f..92de3e4 100644 --- a/jni/com_android_nfc_NativeLlcpServiceSocket.cpp +++ b/jni/com_android_nfc_NativeLlcpServiceSocket.cpp @@ -127,7 +127,7 @@ static jobject com_NativeLlcpServiceSocket_doAccept(JNIEnv *e, jobject o, jint m /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } diff --git a/jni/com_android_nfc_NativeLlcpSocket.cpp b/jni/com_android_nfc_NativeLlcpSocket.cpp index efd7f18..046ef6a 100644 --- a/jni/com_android_nfc_NativeLlcpSocket.cpp +++ b/jni/com_android_nfc_NativeLlcpSocket.cpp @@ -138,7 +138,7 @@ static jboolean com_android_nfc_NativeLlcpSocket_doConnect(JNIEnv *e, jobject o, REENTRANCE_UNLOCK(); if(ret != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Llcp_Connect(%d) returned 0x%04x[%s]", nSap, ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Connect(%d) returned 0x%04x[%s]", nSap, ret, nfc_jni_get_status_name(ret)); goto clean_and_return; } TRACE("phLibNfc_Llcp_Connect(%d) returned 0x%04x[%s]", nSap, ret, nfc_jni_get_status_name(ret)); @@ -146,7 +146,7 @@ static jboolean com_android_nfc_NativeLlcpSocket_doConnect(JNIEnv *e, jobject o, /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -197,7 +197,7 @@ static jboolean com_android_nfc_NativeLlcpSocket_doConnectBy(JNIEnv *e, jobject REENTRANCE_UNLOCK(); if(ret != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Llcp_ConnectByUri() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_ConnectByUri() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); goto clean_and_return; } TRACE("phLibNfc_Llcp_ConnectByUri() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); @@ -205,7 +205,7 @@ static jboolean com_android_nfc_NativeLlcpSocket_doConnectBy(JNIEnv *e, jobject /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -235,7 +235,7 @@ static jboolean com_android_nfc_NativeLlcpSocket_doClose(JNIEnv *e, jobject o) REENTRANCE_UNLOCK(); if(ret != NFCSTATUS_SUCCESS) { - LOGE("phLibNfc_Llcp_Close() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Close() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); return FALSE; } TRACE("phLibNfc_Llcp_Close() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); @@ -275,7 +275,7 @@ static jboolean com_android_nfc_NativeLlcpSocket_doSend(JNIEnv *e, jobject o, jb REENTRANCE_UNLOCK(); if(ret != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Llcp_Send() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Send() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); goto clean_and_return; } TRACE("phLibNfc_Llcp_Send() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); @@ -283,7 +283,7 @@ static jboolean com_android_nfc_NativeLlcpSocket_doSend(JNIEnv *e, jobject o, jb /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -339,7 +339,7 @@ static jint com_android_nfc_NativeLlcpSocket_doReceive(JNIEnv *e, jobject o, jby /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -355,7 +355,7 @@ static jint com_android_nfc_NativeLlcpSocket_doReceive(JNIEnv *e, jobject o, jby else { /* Return status should be either SUCCESS or PENDING */ - LOGE("phLibNfc_Llcp_Recv() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Recv() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); goto clean_and_return; } TRACE("phLibNfc_Llcp_Recv() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); diff --git a/jni/com_android_nfc_NativeNfcManager.cpp b/jni/com_android_nfc_NativeNfcManager.cpp index ae27b70..63533f9 100644 --- a/jni/com_android_nfc_NativeNfcManager.cpp +++ b/jni/com_android_nfc_NativeNfcManager.cpp @@ -152,7 +152,7 @@ static int nfc_jni_download(struct nfc_jni_native_data *nat, uint8_t update) REENTRANCE_UNLOCK(); if (status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Mgt_DeInitialize() (download) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_Mgt_DeInitialize() (download) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); } clock_gettime(CLOCK_REALTIME, &ts); @@ -186,7 +186,7 @@ static int nfc_jni_download(struct nfc_jni_native_data *nat, uint8_t update) REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Mgt_IoCtl() (download) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_Mgt_IoCtl() (download) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); status = NFCSTATUS_FAILED; goto clean_and_return; } @@ -195,7 +195,7 @@ static int nfc_jni_download(struct nfc_jni_native_data *nat, uint8_t update) /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); status = NFCSTATUS_FAILED; goto clean_and_return; } @@ -225,14 +225,14 @@ reinit: REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Mgt_Initialize() (download) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_Mgt_Initialize() (download) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_Mgt_Initialize() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); status = NFCSTATUS_FAILED; goto clean_and_return; } @@ -292,14 +292,14 @@ static int nfc_jni_configure_driver(struct nfc_jni_native_data *nat) } else if(status != NFCSTATUS_SUCCESS) { - LOGE("phLibNfc_Mgt_ConfigureDriver() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_Mgt_ConfigureDriver() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_Mgt_ConfigureDriver() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); if(pthread_create(&(nat->thread), NULL, nfc_jni_client_thread, nat) != 0) { - LOGE("pthread_create failed"); + ALOGE("pthread_create failed"); goto clean_and_return; } @@ -321,7 +321,7 @@ static int nfc_jni_unconfigure_driver(struct nfc_jni_native_data *nat) REENTRANCE_UNLOCK(); if(status != NFCSTATUS_SUCCESS) { - LOGE("phLibNfc_Mgt_UnConfigureDriver() returned error 0x%04x[%s] -- this should never happen", status, nfc_jni_get_status_name( status)); + ALOGE("phLibNfc_Mgt_UnConfigureDriver() returned error 0x%04x[%s] -- this should never happen", status, nfc_jni_get_status_name( status)); } else { @@ -384,16 +384,16 @@ static int nfc_jni_initialize(struct nfc_jni_native_data *nat) { /* Get EEPROM values and device port from product-specific settings */ ret = hw_get_module(NFC_HARDWARE_MODULE_ID, &hw_module); if (ret) { - LOGE("hw_get_module() failed."); + ALOGE("hw_get_module() failed."); goto clean_and_return; } ret = nfc_pn544_open(hw_module, &pn544_dev); if (ret) { - LOGE("Could not open pn544 hw_module."); + ALOGE("Could not open pn544 hw_module."); goto clean_and_return; } if (pn544_dev->num_eeprom_settings == 0 || pn544_dev->eeprom_settings == NULL) { - LOGE("Could not load EEPROM settings"); + ALOGE("Could not load EEPROM settings"); goto clean_and_return; } @@ -417,7 +417,7 @@ static int nfc_jni_initialize(struct nfc_jni_native_data *nat) { REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Mgt_Initialize() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_Mgt_Initialize() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); update = FALSE; goto force_download; } @@ -426,7 +426,7 @@ static int nfc_jni_initialize(struct nfc_jni_native_data *nat) { /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -477,7 +477,7 @@ force_download: } if(i>=3) { - LOGE("Unable to update firmware, giving up"); + ALOGE("Unable to update firmware, giving up"); goto clean_and_return; } } @@ -518,13 +518,13 @@ force_download: status = phLibNfc_Mgt_IoCtl(gHWRef, NFC_MEM_WRITE, &gInputParam, &gOutputParam, nfc_jni_ioctl_callback, (void *)&cb_data); REENTRANCE_UNLOCK(); if (status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Mgt_IoCtl() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_Mgt_IoCtl() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -566,7 +566,7 @@ force_download: REENTRANCE_UNLOCK(); if (status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_SE_SetMode() returned 0x%04x[%s]", status, + ALOGE("phLibNfc_SE_SetMode() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } @@ -576,7 +576,7 @@ force_download: /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } } @@ -597,7 +597,7 @@ force_download: REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Mgt_SetLlcp_ConfigParams returned 0x%04x[%s]", status, + ALOGE("phLibNfc_Mgt_SetLlcp_ConfigParams returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } @@ -607,7 +607,7 @@ force_download: /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -662,12 +662,12 @@ static int is_user_build() { */ void emergency_recovery(struct nfc_jni_native_data *nat) { if (!is_user_build()) { - LOGE("emergency_recovery: force restart of NFC service"); + ALOGE("emergency_recovery: force restart of NFC service"); } else { // dont recover immediately, so we can debug unsigned int t; for (t=1; t < 1000000; t <<= 1) { - LOGE("emergency_recovery: NFC stack dead-locked, please show to npelly"); + ALOGE("emergency_recovery: NFC stack dead-locked, please show to npelly"); sleep(t); } } @@ -730,7 +730,7 @@ void nfc_jni_restart_discovery_locked(struct nfc_jni_native_data *nat) /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -813,7 +813,7 @@ static void *nfc_jni_client_thread(void *arg) if(phDal4Nfc_msgrcv(gDrvCfg.nClientId, (void *)&wrapper, sizeof(phLibNfc_Message_t), 0, 0) == -1) { - LOGE("NFC client received bad message"); + ALOGE("NFC client received bad message"); continue; } @@ -912,7 +912,7 @@ static void nfc_jni_llcp_linkStatus_callback(void *pContext, e->CallVoidMethod(nat->manager, cached_NfcManager_notifyLlcpLinkDeactivated, nat->tag); if(e->ExceptionCheck()) { - LOGE("Exception occured"); + ALOGE("Exception occured"); kill_client(nat); } } @@ -954,7 +954,7 @@ static void nfc_jni_llcp_transport_listen_socket_callback(void *pCo pListenData = (nfc_jni_listen_data_t*)malloc(sizeof(nfc_jni_listen_data_t)); if (pListenData == NULL) { - LOGE("Failed to create structure to handle incoming LLCP connection request"); + ALOGE("Failed to create structure to handle incoming LLCP connection request"); goto clean_and_return; } pListenData->pServerSocket = hServiceSocket; @@ -1043,7 +1043,7 @@ static void nfc_jni_Discovery_notification_callback(void *pContext, e->CallVoidMethod(nat->manager, cached_NfcManager_notifyTargetDeselected); if(e->ExceptionCheck()) { - LOGE("Exception occured"); + ALOGE("Exception occured"); kill_client(nat); } } @@ -1065,7 +1065,7 @@ static void nfc_jni_Discovery_notification_callback(void *pContext, tag_cls = e->GetObjectClass(nat->cached_P2pDevice); if(e->ExceptionCheck()) { - LOGE("Get Object Class Error"); + ALOGE("Get Object Class Error"); kill_client(nat); return; } @@ -1187,7 +1187,7 @@ static void nfc_jni_Discovery_notification_callback(void *pContext, e->CallVoidMethod(nat->manager, cached_NfcManager_notifyLlcpLinkActivation, tag); if(e->ExceptionCheck()) { - LOGE("Exception occured"); + ALOGE("Exception occured"); kill_client(nat); } } @@ -1197,7 +1197,7 @@ static void nfc_jni_Discovery_notification_callback(void *pContext, e->CallVoidMethod(nat->manager, cached_NfcManager_notifyNdefMessageListeners, tag); if(e->ExceptionCheck()) { - LOGE("Exception occured"); + ALOGE("Exception occured"); kill_client(nat); } } @@ -1383,7 +1383,7 @@ static void nfc_jni_transaction_callback(void *context, } else { - LOGE("SE transaction notification error"); + ALOGE("SE transaction notification error"); goto error; } @@ -1392,7 +1392,7 @@ static void nfc_jni_transaction_callback(void *context, error: /* In case of error, just discard the notification */ - LOGE("Failed to send SE transaction notification"); + ALOGE("Failed to send SE transaction notification"); e->ExceptionClear(); clean_and_return: @@ -1478,7 +1478,7 @@ static void nfc_jni_start_discovery_locked(struct nfc_jni_native_data *nat) /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -1526,7 +1526,7 @@ static void nfc_jni_stop_discovery_locked(struct nfc_jni_native_data *nat) /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -1643,7 +1643,7 @@ static bool com_android_nfc_NfcManager_doSetTimeout( JNIEnv *e, jobject o, bool success = false; CONCURRENCY_LOCK(); if (timeout <= 0) { - LOGE("Timeout must be positive."); + ALOGE("Timeout must be positive."); return false; } else { switch (tech) { @@ -1804,7 +1804,7 @@ static jboolean com_android_nfc_NfcManager_initialize(JNIEnv *e, jobject o) #ifdef TNFC_EMULATOR_ONLY if (!property_get("ro.kernel.qemu", value, 0)) { - LOGE("NFC Initialization failed: not running in an emulator\n"); + ALOGE("NFC Initialization failed: not running in an emulator\n"); goto clean_and_return; } #endif @@ -1888,7 +1888,7 @@ static jboolean com_android_nfc_NfcManager_deinitialize(JNIEnv *e, jobject o) if(cb_data.status != NFCSTATUS_SUCCESS) { - LOGE("Failed to deinit the stack"); + ALOGE("Failed to deinit the stack"); bStackReset = TRUE; } } @@ -1901,7 +1901,7 @@ static jboolean com_android_nfc_NfcManager_deinitialize(JNIEnv *e, jobject o) } else { - LOGE("Failed to create semaphore (errno=0x%08x)", errno); + ALOGE("Failed to create semaphore (errno=0x%08x)", errno); bStackReset = TRUE; } @@ -1937,7 +1937,7 @@ static jintArray com_android_nfc_NfcManager_doGetSecureElementList(JNIEnv *e, jo ret = phLibNfc_SE_GetSecureElementList(se_list, &se_count); REENTRANCE_UNLOCK(); if (ret != NFCSTATUS_SUCCESS) { - LOGE("phLibNfc_SE_GetSecureElementList() returned 0x%04x[%s]", ret, + ALOGE("phLibNfc_SE_GetSecureElementList() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); return list; } @@ -1993,7 +1993,7 @@ static void com_android_nfc_NfcManager_doSelectSecureElement(JNIEnv *e, jobject /* Wait for callback response */ if (sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -2028,14 +2028,14 @@ static void com_android_nfc_NfcManager_doDeselectSecureElement(JNIEnv *e, jobjec TRACE("phLibNfc_SE_SetMode returned 0x%02x", ret); if (ret != NFCSTATUS_PENDING) { - LOGE("phLibNfc_SE_SetMode() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_SE_SetMode() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); goto clean_and_return; } TRACE("phLibNfc_SE_SetMode() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); /* Wait for callback response */ if (sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -2085,7 +2085,7 @@ static jboolean com_android_nfc_NfcManager_doCheckLlcp(JNIEnv *e, jobject o) * NFCSTATUS_PENDING. In this case NFCSTATUS_SUCCESS will also cause the callback. */ if(ret != NFCSTATUS_PENDING && ret != NFCSTATUS_SUCCESS) { - LOGE("phLibNfc_Llcp_CheckLlcp() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_CheckLlcp() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); freeData = true; goto clean_and_return; } @@ -2094,7 +2094,7 @@ static jboolean com_android_nfc_NfcManager_doCheckLlcp(JNIEnv *e, jobject o) /* Wait for callback response */ if(sem_wait(&cb_data->sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -2126,7 +2126,7 @@ static jboolean com_android_nfc_NfcManager_doActivateLlcp(JNIEnv *e, jobject o) } else { - LOGE("phLibNfc_Llcp_Activate() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Activate() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); return JNI_FALSE; } } @@ -2159,7 +2159,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpConnectionlessSocket(JNIEn if(ret != NFCSTATUS_SUCCESS) { lastErrorStatus = ret; - LOGE("phLibNfc_Llcp_Socket() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Socket() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); return NULL; } TRACE("phLibNfc_Llcp_Socket() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); @@ -2173,7 +2173,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpConnectionlessSocket(JNIEn if(ret != NFCSTATUS_SUCCESS) { lastErrorStatus = ret; - LOGE("phLibNfc_Llcp_Bind() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Bind() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); /* Close socket created */ REENTRANCE_LOCK(); ret = phLibNfc_Llcp_Close(hLlcpSocket); @@ -2251,7 +2251,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpServiceSocket(JNIEnv *e, j if(ret != NFCSTATUS_SUCCESS) { - LOGE("phLibNfc_Llcp_Socket() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Socket() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); lastErrorStatus = ret; return NULL; } @@ -2265,7 +2265,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpServiceSocket(JNIEnv *e, j if(ret != NFCSTATUS_SUCCESS) { lastErrorStatus = ret; - LOGE("phLibNfc_Llcp_Bind() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Bind() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); /* Close socket created */ ret = phLibNfc_Llcp_Close(hLlcpSocket); return NULL; @@ -2291,7 +2291,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpServiceSocket(JNIEnv *e, j if(ret != NFCSTATUS_SUCCESS) { - LOGE("phLibNfc_Llcp_Listen() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Listen() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); lastErrorStatus = ret; /* Close created socket */ REENTRANCE_LOCK(); @@ -2304,7 +2304,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpServiceSocket(JNIEnv *e, j /* Create new NativeLlcpServiceSocket object */ if(nfc_jni_cache_object(e,"com/android/nfc/nxp/NativeLlcpServiceSocket",&(serviceSocket)) == -1) { - LOGE("Llcp Socket object creation error"); + ALOGE("Llcp Socket object creation error"); return NULL; } @@ -2312,7 +2312,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpServiceSocket(JNIEnv *e, j clsNativeLlcpServiceSocket = e->GetObjectClass(serviceSocket); if(e->ExceptionCheck()) { - LOGE("Llcp Socket get object class error"); + ALOGE("Llcp Socket get object class error"); return NULL; } @@ -2374,7 +2374,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpSocket(JNIEnv *e, jobject if(ret != NFCSTATUS_SUCCESS) { - LOGE("phLibNfc_Llcp_Socket() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Socket() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); lastErrorStatus = ret; return NULL; } @@ -2383,7 +2383,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpSocket(JNIEnv *e, jobject /* Create new NativeLlcpSocket object */ if(nfc_jni_cache_object(e,"com/android/nfc/nxp/NativeLlcpSocket",&(clientSocket)) == -1) { - LOGE("Llcp socket object creation error"); + ALOGE("Llcp socket object creation error"); return NULL; } @@ -2391,7 +2391,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpSocket(JNIEnv *e, jobject clsNativeLlcpSocket = e->GetObjectClass(clientSocket); if(e->ExceptionCheck()) { - LOGE("Get class object error"); + ALOGE("Get class object error"); return NULL; } @@ -2406,7 +2406,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpSocket(JNIEnv *e, jobject if(ret != NFCSTATUS_SUCCESS) { lastErrorStatus = ret; - LOGE("phLibNfc_Llcp_Bind() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_Llcp_Bind() returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); /* Close socket created */ REENTRANCE_LOCK(); ret = phLibNfc_Llcp_Close(hLlcpSocket); @@ -2523,7 +2523,7 @@ static jboolean com_android_nfc_NfcManager_doDownload(JNIEnv *e, jobject o) REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Mgt_IoCtl() (download) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_Mgt_IoCtl() (download) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); result = FALSE; goto clean_and_return; } @@ -2532,7 +2532,7 @@ static jboolean com_android_nfc_NfcManager_doDownload(JNIEnv *e, jobject o) /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); result = FALSE; goto clean_and_return; } @@ -2650,7 +2650,7 @@ int register_com_android_nfc_NativeNfcManager(JNIEnv *e) nfc_jni_native_monitor = nfc_jni_init_monitor(); if(nfc_jni_native_monitor == NULL) { - LOGE("NFC Manager cannot recover native monitor %x\n", errno); + ALOGE("NFC Manager cannot recover native monitor %x\n", errno); return -1; } diff --git a/jni/com_android_nfc_NativeNfcSecureElement.cpp b/jni/com_android_nfc_NativeNfcSecureElement.cpp index 77ce7ec..8da9d0b 100755 --- a/jni/com_android_nfc_NativeNfcSecureElement.cpp +++ b/jni/com_android_nfc_NativeNfcSecureElement.cpp @@ -139,7 +139,7 @@ static void com_android_nfc_jni_open_secure_element_notification_callback(void * } } if (!foundHandle) { - LOGE("Could not find ISO-DEP secure element"); + ALOGE("Could not find ISO-DEP secure element"); status = NFCSTATUS_FAILED; goto clean_and_return; } @@ -164,7 +164,7 @@ static void com_android_nfc_jni_open_secure_element_notification_callback(void * TRACE("Discovered secure element: tech=%d", SecureElementTech); } else { - LOGE("Discovered secure element, but could not resolve tech"); + ALOGE("Discovered secure element, but could not resolve tech"); status = NFCSTATUS_FAILED; } @@ -235,20 +235,20 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection REENTRANCE_UNLOCK(); if(ret!=NFCSTATUS_PENDING) { - LOGE("IOCTL status error"); + ALOGE("IOCTL status error"); goto clean_and_return; } /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("IOCTL semaphore error"); + ALOGE("IOCTL semaphore error"); goto clean_and_return; } if(cb_data.status != NFCSTATUS_SUCCESS) { - LOGE("READ MEM ERROR"); + ALOGE("READ MEM ERROR"); goto clean_and_return; } @@ -290,7 +290,7 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection REENTRANCE_UNLOCK(); if(ret != NFCSTATUS_SUCCESS) { - LOGE("Register Notification error"); + ALOGE("Register Notification error"); goto clean_and_return; } @@ -304,20 +304,20 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection REENTRANCE_UNLOCK(); if (ret != NFCSTATUS_PENDING ) { - LOGE("\n> SE Set SmartMX mode ERROR \n" ); + ALOGE("\n> SE Set SmartMX mode ERROR \n" ); goto clean_and_return; } /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Secure Element opening error"); + ALOGE("Secure Element opening error"); goto clean_and_return; } if(cb_data.status != NFCSTATUS_SUCCESS) { - LOGE("SE set mode failed"); + ALOGE("SE set mode failed"); goto clean_and_return; } @@ -325,13 +325,13 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Secure Element opening error"); + ALOGE("Secure Element opening error"); goto clean_and_return; } if(cb_data.status != NFCSTATUS_SUCCESS && cb_data.status != NFCSTATUS_MULTIPLE_PROTOCOLS) { - LOGE("SE detection failed"); + ALOGE("SE detection failed"); goto clean_and_return; } CONCURRENCY_UNLOCK(); @@ -344,7 +344,7 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection REENTRANCE_UNLOCK(); if(ret != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Connect(SMX) returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); + ALOGE("phLibNfc_RemoteDev_Connect(SMX) returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_Connect(SMX) returned 0x%04x[%s]", ret, nfc_jni_get_status_name(ret)); @@ -352,14 +352,14 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("CONNECT semaphore error"); + ALOGE("CONNECT semaphore error"); goto clean_and_return; } /* Connect Status */ if(cb_data.status != NFCSTATUS_SUCCESS) { - LOGE("Secure Element connect error"); + ALOGE("Secure Element connect error"); goto clean_and_return; } @@ -376,19 +376,19 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection REENTRANCE_UNLOCK(); if(ret!=NFCSTATUS_PENDING) { - LOGE("IOCTL status error"); + ALOGE("IOCTL status error"); } /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("IOCTL semaphore error"); + ALOGE("IOCTL semaphore error"); goto clean_and_return; } if(cb_data.status != NFCSTATUS_SUCCESS) { - LOGE("READ MEM ERROR"); + ALOGE("READ MEM ERROR"); goto clean_and_return; } @@ -417,20 +417,20 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection REENTRANCE_UNLOCK(); if(ret!=NFCSTATUS_PENDING) { - LOGE("IOCTL status error"); + ALOGE("IOCTL status error"); goto clean_and_return; } /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("IOCTL semaphore error"); + ALOGE("IOCTL semaphore error"); goto clean_and_return; } if(cb_data.status != NFCSTATUS_SUCCESS) { - LOGE("READ MEM ERROR"); + ALOGE("READ MEM ERROR"); goto clean_and_return; } CONCURRENCY_UNLOCK(); @@ -439,13 +439,13 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection } else { - LOGE("phLibNfc_SE_GetSecureElementList(): No SMX detected"); + ALOGE("phLibNfc_SE_GetSecureElementList(): No SMX detected"); goto clean_and_return; } } else { - LOGE("phLibNfc_SE_GetSecureElementList(): Error"); + ALOGE("phLibNfc_SE_GetSecureElementList(): Error"); goto clean_and_return; } @@ -491,7 +491,7 @@ static jboolean com_android_nfc_NativeNfcSecureElement_doDisconnect(JNIEnv *e, j REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Disconnect(SMX) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_Disconnect(SMX) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_Disconnect(SMX) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -505,7 +505,7 @@ static jboolean com_android_nfc_NativeNfcSecureElement_doDisconnect(JNIEnv *e, j /* Disconnect Status */ if(cb_data.status != NFCSTATUS_SUCCESS) { - LOGE("\n> Disconnect SE ERROR \n" ); + ALOGE("\n> Disconnect SE ERROR \n" ); goto clean_and_return; } CONCURRENCY_UNLOCK(); @@ -521,20 +521,20 @@ static jboolean com_android_nfc_NativeNfcSecureElement_doDisconnect(JNIEnv *e, j REENTRANCE_UNLOCK(); if(status!=NFCSTATUS_PENDING) { - LOGE("IOCTL status error"); + ALOGE("IOCTL status error"); goto clean_and_return; } /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("IOCTL semaphore error"); + ALOGE("IOCTL semaphore error"); goto clean_and_return; } if(cb_data.status != NFCSTATUS_SUCCESS) { - LOGE("READ MEM ERROR"); + ALOGE("READ MEM ERROR"); goto clean_and_return; } @@ -563,20 +563,20 @@ static jboolean com_android_nfc_NativeNfcSecureElement_doDisconnect(JNIEnv *e, j REENTRANCE_UNLOCK(); if(status!=NFCSTATUS_PENDING) { - LOGE("IOCTL status error"); + ALOGE("IOCTL status error"); goto clean_and_return; } /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("IOCTL semaphore error"); + ALOGE("IOCTL semaphore error"); goto clean_and_return; } if(cb_data.status != NFCSTATUS_SUCCESS) { - LOGE("READ MEM ERROR"); + ALOGE("READ MEM ERROR"); goto clean_and_return; } @@ -646,7 +646,7 @@ static jbyteArray com_android_nfc_NativeNfcSecureElement_doTransceive(JNIEnv *e, REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Transceive(SMX) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_Transceive(SMX) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_Transceive(SMX) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -654,13 +654,13 @@ static jbyteArray com_android_nfc_NativeNfcSecureElement_doTransceive(JNIEnv *e, /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("TRANSCEIVE semaphore error"); + ALOGE("TRANSCEIVE semaphore error"); goto clean_and_return; } if(cb_data.status != NFCSTATUS_SUCCESS) { - LOGE("TRANSCEIVE error"); + ALOGE("TRANSCEIVE error"); goto clean_and_return; } diff --git a/jni/com_android_nfc_NativeNfcTag.cpp b/jni/com_android_nfc_NativeNfcTag.cpp index be4d9f4..f35dbf9 100644 --- a/jni/com_android_nfc_NativeNfcTag.cpp +++ b/jni/com_android_nfc_NativeNfcTag.cpp @@ -202,7 +202,7 @@ static jbyteArray com_android_nfc_NativeNfcTag_doRead(JNIEnv *e, REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Ndef_Read() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_Ndef_Read() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_Ndef_Read() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -210,7 +210,7 @@ static jbyteArray com_android_nfc_NativeNfcTag_doRead(JNIEnv *e, /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -259,7 +259,7 @@ static jboolean com_android_nfc_NativeNfcTag_doWrite(JNIEnv *e, REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Ndef_Write() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_Ndef_Write() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_Ndef_Write() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -267,7 +267,7 @@ static jboolean com_android_nfc_NativeNfcTag_doWrite(JNIEnv *e, /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -469,7 +469,7 @@ static jint com_android_nfc_NativeNfcTag_doConnect(JNIEnv *e, REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Connect(RW) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_Connect(RW) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_Connect(RW) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -477,7 +477,7 @@ static jint com_android_nfc_NativeNfcTag_doConnect(JNIEnv *e, /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); status = NFCSTATUS_ABORTED; goto clean_and_return; } @@ -525,7 +525,7 @@ static jint com_android_nfc_NativeNfcTag_doHandleReconnect(JNIEnv *e, REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_ReConnect(RW) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_ReConnect(RW) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_ReConnect(RW) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -533,7 +533,7 @@ static jint com_android_nfc_NativeNfcTag_doHandleReconnect(JNIEnv *e, /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); status = NFCSTATUS_ABORTED; goto clean_and_return; } @@ -605,7 +605,7 @@ static jboolean com_android_nfc_NativeNfcTag_doDisconnect(JNIEnv *e, jobject o) if (handle == -1) { // Was never connected to any tag, exit result = JNI_TRUE; - LOGE("doDisconnect() - Target already disconnected"); + ALOGE("doDisconnect() - Target already disconnected"); nfc_jni_restart_discovery_locked(nfc_jni_get_nat_ext(e)); goto clean_and_return; } @@ -624,7 +624,7 @@ static jboolean com_android_nfc_NativeNfcTag_doDisconnect(JNIEnv *e, jobject o) } if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Disconnect(%x) returned 0x%04x[%s]", handle, status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_Disconnect(%x) returned 0x%04x[%s]", handle, status, nfc_jni_get_status_name(status)); nfc_jni_restart_discovery_locked(nfc_jni_get_nat_ext(e)); goto clean_and_return; } @@ -633,7 +633,7 @@ static jboolean com_android_nfc_NativeNfcTag_doDisconnect(JNIEnv *e, jobject o) /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -836,7 +836,7 @@ static jbyteArray com_android_nfc_NativeNfcTag_doTransceive(JNIEnv *e, REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Transceive() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_Transceive() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); if ((targetLost != NULL) && (status == NFCSTATUS_TARGET_LOST)) { *targetLost = 1; } @@ -847,7 +847,7 @@ static jbyteArray com_android_nfc_NativeNfcTag_doTransceive(JNIEnv *e, /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -970,7 +970,7 @@ static jint com_android_nfc_NativeNfcTag_doCheckNdef(JNIEnv *e, jobject o, jintA REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_Ndef_CheckNdef() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_Ndef_CheckNdef() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_Ndef_CheckNdef() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -978,7 +978,7 @@ static jint com_android_nfc_NativeNfcTag_doCheckNdef(JNIEnv *e, jobject o, jintA /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); status = NFCSTATUS_ABORTED; goto clean_and_return; } @@ -1040,7 +1040,7 @@ static jboolean com_android_nfc_NativeNfcTag_doPresenceCheck(JNIEnv *e, jobject if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_CheckPresence() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_CheckPresence() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_CheckPresence() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -1048,7 +1048,7 @@ static jboolean com_android_nfc_NativeNfcTag_doPresenceCheck(JNIEnv *e, jobject /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -1138,7 +1138,7 @@ static jboolean com_android_nfc_NativeNfcTag_doNdefFormat(JNIEnv *e, jobject o, if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_FormatNdef() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_FormatNdef() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_FormatNdef() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -1146,7 +1146,7 @@ static jboolean com_android_nfc_NativeNfcTag_doNdefFormat(JNIEnv *e, jobject o, /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -1186,7 +1186,7 @@ static jboolean com_android_nfc_NativeNfcTag_doMakeReadonly(JNIEnv *e, jobject o if(status != NFCSTATUS_PENDING) { - LOGE("pphLibNfc_ConvertToReadOnlyNdef() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("pphLibNfc_ConvertToReadOnlyNdef() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_ConvertToReadOnlyNdef() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -1194,7 +1194,7 @@ static jboolean com_android_nfc_NativeNfcTag_doMakeReadonly(JNIEnv *e, jobject o /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } diff --git a/jni/com_android_nfc_NativeP2pDevice.cpp b/jni/com_android_nfc_NativeP2pDevice.cpp index 78d0bd0..b3cc6e3 100644 --- a/jni/com_android_nfc_NativeP2pDevice.cpp +++ b/jni/com_android_nfc_NativeP2pDevice.cpp @@ -146,7 +146,7 @@ static jboolean com_android_nfc_NativeP2pDevice_doConnect(JNIEnv *e, jobject o) REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Connect(P2P) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_Connect(P2P) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_Connect(P2P) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -154,7 +154,7 @@ static jboolean com_android_nfc_NativeP2pDevice_doConnect(JNIEnv *e, jobject o) /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -227,14 +227,14 @@ static jboolean com_android_nfc_NativeP2pDevice_doDisconnect(JNIEnv *e, jobject REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Disconnect() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_Disconnect() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); if(status == NFCSTATUS_TARGET_NOT_CONNECTED) { - LOGE("phLibNfc_RemoteDev_Disconnect() failed: Target not connected"); + ALOGE("phLibNfc_RemoteDev_Disconnect() failed: Target not connected"); } else { - LOGE("phLibNfc_RemoteDev_Disconnect() failed"); + ALOGE("phLibNfc_RemoteDev_Disconnect() failed"); nfc_jni_restart_discovery_locked(nfc_jni_get_nat_ext(e)); } @@ -245,7 +245,7 @@ static jboolean com_android_nfc_NativeP2pDevice_doDisconnect(JNIEnv *e, jobject /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -310,7 +310,7 @@ static jbyteArray com_android_nfc_NativeP2pDevice_doTransceive(JNIEnv *e, REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Transceive(P2P) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_Transceive(P2P) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_Transceive(P2P) returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -318,7 +318,7 @@ static jbyteArray com_android_nfc_NativeP2pDevice_doTransceive(JNIEnv *e, /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -378,7 +378,7 @@ static jbyteArray com_android_nfc_NativeP2pDevice_doReceive( REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Receive() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_Receive() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_Receive() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -386,7 +386,7 @@ static jbyteArray com_android_nfc_NativeP2pDevice_doReceive( /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } @@ -434,7 +434,7 @@ static jboolean com_android_nfc_NativeP2pDevice_doSend( REENTRANCE_UNLOCK(); if(status != NFCSTATUS_PENDING) { - LOGE("phLibNfc_RemoteDev_Send() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); + ALOGE("phLibNfc_RemoteDev_Send() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); goto clean_and_return; } TRACE("phLibNfc_RemoteDev_Send() returned 0x%04x[%s]", status, nfc_jni_get_status_name(status)); @@ -442,7 +442,7 @@ static jboolean com_android_nfc_NativeP2pDevice_doSend( /* Wait for callback response */ if(sem_wait(&cb_data.sem)) { - LOGE("Failed to wait for semaphore (errno=0x%08x)", errno); + ALOGE("Failed to wait for semaphore (errno=0x%08x)", errno); goto clean_and_return; } diff --git a/jni/com_android_nfc_list.cpp b/jni/com_android_nfc_list.cpp index ea31998..f0487d3 100644 --- a/jni/com_android_nfc_list.cpp +++ b/jni/com_android_nfc_list.cpp @@ -28,7 +28,7 @@ bool listInit(listHead* pList) pList->pFirst = NULL; if(pthread_mutex_init(&pList->mutex, NULL) == -1) { - LOGE("Mutex creation failed (errno=0x%08x)", errno); + ALOGE("Mutex creation failed (errno=0x%08x)", errno); return false; } @@ -44,7 +44,7 @@ bool listDestroy(listHead* pList) if(pthread_mutex_destroy(&pList->mutex) == -1) { - LOGE("Mutex destruction failed (errno=0x%08x)", errno); + ALOGE("Mutex destruction failed (errno=0x%08x)", errno); return false; } @@ -62,7 +62,7 @@ bool listAdd(listHead* pList, void* pData) if (pNode == NULL) { result = false; - LOGE("Failed to malloc"); + ALOGE("Failed to malloc"); goto clean_and_return; } TRACE("Allocated node: %8p (%8p)", pNode, pData); @@ -108,7 +108,7 @@ bool listRemove(listHead* pList, void* pData) if (pList->pFirst == NULL) { /* Empty list */ - LOGE("Failed to deallocate (list empty)"); + ALOGE("Failed to deallocate (list empty)"); result = false; goto clean_and_return; } @@ -138,7 +138,7 @@ bool listRemove(listHead* pList, void* pData) { /* Node not found */ result = false; - LOGE("Failed to deallocate (not found %8p)", pData); + ALOGE("Failed to deallocate (not found %8p)", pData); goto clean_and_return; } @@ -170,7 +170,7 @@ bool listGetAndRemoveNext(listHead* pList, void** ppData) if (pList->pFirst) { /* Empty list */ - LOGE("Failed to deallocate (list empty)"); + ALOGE("Failed to deallocate (list empty)"); result = false; goto clean_and_return; } |