Skip to content

Commit

Permalink
revert merging with JB new LOG format
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronveloso committed Aug 23, 2012
1 parent 5f99d01 commit 5a75990
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 44 deletions.
12 changes: 5 additions & 7 deletions fm_stack/MCP_Common/Platform/os/linux/mcp_hal_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,35 +398,35 @@ static void MCP_HAL_LOG_LogToAndroid(const char* fileName,
switch (severity)
{
case MCP_HAL_LOG_SEVERITY_FUNCTION:
ALOGV("%s(%s):%s (%ld@%s)",MCP_HAL_LOG_Modules[moduleId].name,
LOGV("%s(%s):%s (%ld@%s)",MCP_HAL_LOG_Modules[moduleId].name,
MCP_HAL_LOG_GetThreadName(),
copy_of_msg,
line,
fileName);
break;
case MCP_HAL_LOG_SEVERITY_DEBUG:
ALOGV("%s(%s):%s (%ld@%s)",MCP_HAL_LOG_Modules[moduleId].name,
LOGV("%s(%s):%s (%ld@%s)",MCP_HAL_LOG_Modules[moduleId].name,
MCP_HAL_LOG_GetThreadName(),
copy_of_msg,
line,
fileName);
break;
case MCP_HAL_LOG_SEVERITY_INFO:
ALOGV("%s(%s):%s (%ld@%s)",MCP_HAL_LOG_Modules[moduleId].name,
LOGV("%s(%s):%s (%ld@%s)",MCP_HAL_LOG_Modules[moduleId].name,
MCP_HAL_LOG_GetThreadName(),
copy_of_msg,
line,
fileName);
break;
case MCP_HAL_LOG_SEVERITY_ERROR:
ALOGV("%s(%s):%s (%ld@%s)",MCP_HAL_LOG_Modules[moduleId].name,
LOGV("%s(%s):%s (%ld@%s)",MCP_HAL_LOG_Modules[moduleId].name,
MCP_HAL_LOG_GetThreadName(),
copy_of_msg,
line,
fileName);
break;
case MCP_HAL_LOG_SEVERITY_FATAL:
ALOGV("%s(%s):%s (%ld@%s)",MCP_HAL_LOG_Modules[moduleId].name,
LOGV("%s(%s):%s (%ld@%s)",MCP_HAL_LOG_Modules[moduleId].name,
MCP_HAL_LOG_GetThreadName(),
copy_of_msg,
line,
Expand Down Expand Up @@ -485,5 +485,3 @@ void MCP_HAL_LOG_LogMsg( const char* fileName,
#endif
}
}


73 changes: 36 additions & 37 deletions service/src/jni/JFmRxNative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ fm_status register_fmsig_handlers(void)
sa.sa_handler = fmapp_termination_handler;

if (-1 == sigaction(SIGTERM, &sa, NULL)) {
ALOGE("failed to register SIGTERM");
LOGE("failed to register SIGTERM");
ret = FMC_STATUS_FAILED;
goto out;
}

if (-1 == sigaction(SIGINT, &sa, NULL)) {
ALOGE("failed to register SIGINT");
LOGE("failed to register SIGINT");
ret = FMC_STATUS_FAILED;
goto out;
}

if (-1 == sigaction(SIGQUIT, &sa, NULL)) {
ALOGE("failed to register SIGQUIT");
LOGE("failed to register SIGQUIT");
ret = FMC_STATUS_FAILED;
goto out;
}
Expand Down Expand Up @@ -168,7 +168,7 @@ static int nativeJFmRx_Create(JNIEnv *env,jobject obj,jobject jContextValue)
register_fmsig_handlers();
ret = fm_open_cmd_socket(g_fmapp_hci_dev);
if (ret) {
ALOGE("failed to open cmd socket ret %d",ret);
LOGE("failed to open cmd socket ret %d",ret);
goto CLEANUP;
}

Expand All @@ -179,15 +179,15 @@ static int nativeJFmRx_Create(JNIEnv *env,jobject obj,jobject jContextValue)

fmStatus = FM_RX_Init(fmrx_error_callback);
if (fmStatus) {
ALOGE("failed to init FM rx stack context");
LOGE("failed to init FM rx stack context");
goto CLEANUP;

}

fmStatus = FM_RX_Create(NULL, fmapp_rx_callback, &fmRxContext);

if (fmStatus) {
ALOGE("failed to create FM rx stack context");
LOGE("failed to create FM rx stack context");
goto CLEANUP;
} else {

Expand Down Expand Up @@ -217,7 +217,7 @@ static int nativeJFmRx_Create(JNIEnv *env,jobject obj,jobject jContextValue)
setValueMethodId = env->GetMethodID(contextCls, "setValue", "(I)V");
if (setValueMethodId == NULL)
{
ALOGE("nativeJFmRx_create: Failed getting setValue method id");
LOGE("nativeJFmRx_create: Failed getting setValue method id");
goto CLEANUP;
}

Expand All @@ -227,7 +227,7 @@ static int nativeJFmRx_Create(JNIEnv *env,jobject obj,jobject jContextValue)
env->CallVoidMethod(jContextValue, setValueMethodId, (unsigned int)fmRxContext);
if (env->ExceptionOccurred())
{
ALOGE("nativeJFmRx_create: Calling CallVoidMethod(setValue) failed");
LOGE("nativeJFmRx_create: Calling CallVoidMethod(setValue) failed");
env->ExceptionDescribe();
goto CLEANUP;
}
Expand All @@ -240,7 +240,7 @@ static int nativeJFmRx_Create(JNIEnv *env,jobject obj,jobject jContextValue)

CLEANUP:

ALOGE("nativeJFmRx_create(): Exiting With a Failure indication");
LOGE("nativeJFmRx_create(): Exiting With a Failure indication");
return FMC_STATUS_FAILED;
}

Expand All @@ -257,7 +257,7 @@ static jint nativeJFmRx_Destroy(JNIEnv *env, jobject obj,jlong jContextValue)
status = FM_RX_Destroy(&fmRxContext);

if (status) {
ALOGE("failed to destroy FM rx stack context");
LOGE("failed to destroy FM rx stack context");
return status;

} else{
Expand All @@ -277,7 +277,7 @@ static jint nativeJFmRx_Destroy(JNIEnv *env, jobject obj,jlong jContextValue)


if (status) {
ALOGE("failed to deinit FM rx stack context");
LOGE("failed to deinit FM rx stack context");
return status;

} else {
Expand All @@ -292,7 +292,7 @@ static jint nativeJFmRx_Destroy(JNIEnv *env, jobject obj,jlong jContextValue)
FM_LOGD("%s: calling bt_chip_disable", __func__);

if(bt_chip_disable() < 0) {
ALOGE("bt_chip_disable failed");
LOGE("bt_chip_disable failed");
} else {

FM_LOGD("bt_chip_disable Success");
Expand Down Expand Up @@ -1032,7 +1032,7 @@ extern "C"
void fmrx_error_callback(const fm_rx_status status)
{

ALOGI("fmrx_error_callback: Entered, ");
LOGI("fmrx_error_callback: Entered, ");

JNIEnv* env = NULL;
bool attachedThread = false;
Expand All @@ -1045,12 +1045,12 @@ void fmrx_error_callback(const fm_rx_status status)

if(jRet < 0)
{
ALOGE("failed to get JNI env,assuming native thread");
LOGE("failed to get JNI env,assuming native thread");
jRet = g_jVM->AttachCurrentThread((&env), NULL);

if(jRet != JNI_OK)
{
ALOGE("failed to atatch to current thread %d",jRet);
LOGE("failed to atatch to current thread %d",jRet);
return ;
}

Expand All @@ -1059,7 +1059,7 @@ void fmrx_error_callback(const fm_rx_status status)

if(env == NULL)
{
ALOGE("fmrx_error_callback: Entered, env is null");
LOGE("fmrx_error_callback: Entered, env is null");
return;
}

Expand All @@ -1072,7 +1072,7 @@ void fmrx_error_callback(const fm_rx_status status)
);

if (env->ExceptionOccurred()) {
ALOGE("fmrx_error_callback: ExceptionOccurred");
LOGE("fmrx_error_callback: ExceptionOccurred");
goto CLEANUP;
}

Expand All @@ -1085,7 +1085,7 @@ void fmrx_error_callback(const fm_rx_status status)
return;

CLEANUP:
ALOGE("fmrx_error_callback: Exiting due to failure");
LOGE("fmrx_error_callback: Exiting due to failure");
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
env->ExceptionClear();
Expand Down Expand Up @@ -1114,7 +1114,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
g_jVM->AttachCurrentThread((&env), NULL);

if(env == NULL) {
ALOGI("%s: Entered, env is null", __func__);
LOGI("%s: Entered, env is null", __func__);
} else {

FM_LOGD("%s: jEnv %p", __func__, (void *)env);
Expand Down Expand Up @@ -1199,7 +1199,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)

jAfListData = env->NewByteArray(event->p.afListData.afListSize);
if (jAfListData == NULL) {
ALOGE("%s: Failed converting elements", __func__);
LOGE("%s: Failed converting elements", __func__);
goto CLEANUP;
}

Expand All @@ -1209,7 +1209,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
(jbyte*)event->p.afListData.afList);

if (env->ExceptionOccurred()) {
ALOGE("%s: Calling nativeCb_fmRxAfListChanged failed",
LOGE("%s: Calling nativeCb_fmRxAfListChanged failed",
__func__);
goto CLEANUP;
}
Expand Down Expand Up @@ -1238,7 +1238,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)

jNameString = env->NewByteArray(len);
if (jNameString == NULL) {
ALOGE("%s: Failed converting elements", __func__);
LOGE("%s: Failed converting elements", __func__);
goto CLEANUP;
}

Expand All @@ -1248,7 +1248,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
(jbyte*)event->p.psData.name);

if (env->ExceptionOccurred()) {
ALOGE("%s: nativeCb_fmRxRadioText failed", __func__);
LOGE("%s: nativeCb_fmRxRadioText failed", __func__);
goto CLEANUP;
}

Expand All @@ -1266,7 +1266,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)

jRadioTxtMsg = env->NewByteArray(event->p.radioTextData.len);
if (jRadioTxtMsg == NULL) {
ALOGE("%s: Failed converting elements", __func__);
LOGE("%s: Failed converting elements", __func__);
goto CLEANUP;
}

Expand All @@ -1276,7 +1276,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
(jbyte*)event->p.radioTextData.msg);

if (env->ExceptionOccurred()) {
ALOGE("%s: Calling nativeCb_fmRxRadioText failed",
LOGE("%s: Calling nativeCb_fmRxRadioText failed",
__func__);
goto CLEANUP;
}
Expand All @@ -1300,7 +1300,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
jGroupData = env->NewByteArray(len);

if (jGroupData == NULL) {
ALOGE("%s: Failed converting elements", __func__);
LOGE("%s: Failed converting elements", __func__);
goto CLEANUP;
}

Expand All @@ -1310,7 +1310,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
(jbyte*)event->p.rawRdsGroupData.groupData);

if (env->ExceptionOccurred()) {
ALOGE("%s: Calling jniCb_fmRxRadioText failed",
LOGE("%s: Calling jniCb_fmRxRadioText failed",
__func__);
goto CLEANUP;
}
Expand Down Expand Up @@ -1351,7 +1351,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)

jChannelsData = env->NewIntArray(len);
if (jChannelsData == NULL) {
ALOGE("%s: Failed converting elements", __func__);
LOGE("%s: Failed converting elements", __func__);
goto CLEANUP;
}

Expand All @@ -1361,7 +1361,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
(jint*)event->p.completeScanData.channelsData);

if (env->ExceptionOccurred()) {
ALOGE("%s: Calling jniCb_fmRxRadioText failed",
LOGE("%s: Calling jniCb_fmRxRadioText failed",
__func__);
goto CLEANUP;
}
Expand All @@ -1381,7 +1381,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
} //end switch

if (env->ExceptionOccurred()) {
ALOGE("fmapp_rx_callback: ExceptionOccurred");
LOGE("fmapp_rx_callback: ExceptionOccurred");
goto CLEANUP;
}

Expand All @@ -1407,7 +1407,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
return;

CLEANUP:
ALOGE("fmapp_rx_callback: Exiting due to failure");
LOGE("fmapp_rx_callback: Exiting due to failure");
if(jAfListData!= NULL)
env->DeleteLocalRef(jAfListData);
if(jRadioTxtMsg!= NULL)
Expand All @@ -1432,7 +1432,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
***********************************************************************/
#define VERIFY_METHOD_ID(methodId) \
if (!_VerifyMethodId(methodId, #methodId)) { \
ALOGE("Error obtaining method id for %s", #methodId); \
LOGE("Error obtaining method id for %s", #methodId); \
return; \
}

Expand All @@ -1441,7 +1441,7 @@ void fmapp_rx_callback(const fm_rx_event_s *event)
bool result = true;

if (methodId == NULL) {
ALOGE("_VerifyMethodId: Failed getting method id of %s", name);
LOGE("_VerifyMethodId: Failed getting method id of %s", name);
result = false;
}

Expand Down Expand Up @@ -1613,12 +1613,12 @@ static int registerNatives(JNIEnv* env, const char* className,

clazz = env->FindClass(className);
if (clazz == NULL) {
ALOGE("Can not find class %s\n", className);
LOGE("Can not find class %s\n", className);
return JNI_FALSE;
}

if (env->RegisterNatives(clazz, gMethods, numMethods) < 0) {
ALOGE("Can not RegisterNatives\n");
LOGE("Can not RegisterNatives\n");
return JNI_FALSE;
}

Expand All @@ -1630,7 +1630,7 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
JNIEnv* env = NULL;
jint result = -1;

ALOGE("OnLoad");
LOGE("OnLoad");

if (vm->GetEnv((void**)&env, JNI_VERSION_1_4) != JNI_OK) {
goto bail;
Expand All @@ -1651,4 +1651,3 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
bail:
return result;
}

0 comments on commit 5a75990

Please sign in to comment.