diff options
-rw-r--r-- | jni/Android.mk | 4 | ||||
-rw-r--r-- | jni/android_hardware_fm.cpp | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/jni/Android.mk b/jni/Android.mk index 97d5a7b..0fabbcc 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -19,5 +19,9 @@ LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr LOCAL_MODULE := libqcomfm_jni LOCAL_MODULE_TAGS := optional +ifeq ($(TARGET_QCOM_NO_FM_FIRMWARE),true) + LOCAL_CFLAGS += -DQCOM_NO_FM_FIRMWARE +endif + include $(BUILD_SHARED_LIBRARY) endif # is-vendor-board-platform diff --git a/jni/android_hardware_fm.cpp b/jni/android_hardware_fm.cpp index 8d2e610..230f2dd 100644 --- a/jni/android_hardware_fm.cpp +++ b/jni/android_hardware_fm.cpp @@ -114,6 +114,7 @@ static jint android_hardware_fmradio_FmReceiverJNI_acquireFdNative /*Set the mode for soc downloader*/ property_set("hw.fm.mode", "normal"); /* Need to clear the hw.fm.init firstly */ +#ifndef QCOM_NO_FM_FIRMWARE property_set("hw.fm.init", "0"); property_set("ctl.start", "fm_dl"); sched_yield(); @@ -134,6 +135,9 @@ static jint android_hardware_fmradio_FmReceiverJNI_acquireFdNative return FM_JNI_FAILURE; } } +#else + usleep(WAIT_TIMEOUT); +#endif return fd; } @@ -499,6 +503,7 @@ static jint android_hardware_fmradio_FmReceiverJNI_setNotchFilterNative(JNIEnv * else property_set("hw.fm.mode", "wa_disable"); +#ifndef QCOM_NO_FM_FIRMWARE property_set("ctl.start", "fm_dl"); sched_yield(); for(i=0; i<10; i++) { @@ -511,6 +516,9 @@ static jint android_hardware_fmradio_FmReceiverJNI_setNotchFilterNative(JNIEnv * } } ALOGE("init_success:%d after %f seconds \n", init_success, 0.2*i); +#else + usleep(WAIT_TIMEOUT); +#endif property_get("notch.value", notch, NULL); ALOGE("Notch = %s",notch); |