Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 497e8031 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

media: Make HAVE_FM_RADIO play nice with OMAP_ENHANCEMENT

OMAP_ENHANCEMENT devices can use CM's FM app (and stack)
without using HAVE_FM_RADIO, but the volume controls are lost.

If the target device's master volume affects FM, using
BOARD_HAVE_FM_RADIO is sufficient.
However, if a specific FM volume control is necessary,
HAVE_FM_RADIO needs to be used (and the volume functions
implemented in that device's HAL)

Change-Id: I00c46727a6f09cdd0cc11265a0a94a5a5aa63721
parent bc6073b0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -145,6 +145,9 @@ LOCAL_SRC_FILES:= \
    android_content_res_Configuration.cpp

ifeq ($(BOARD_HAVE_FM_RADIO),true)
    ## There's a difference. BOARD_HAVE_FM_RADIO enabled the runtime
    ## without modifying the audiosystem (which HAVE_FM_RADIO does)
    LOCAL_CFLAGS += -DBOARD_HAVE_FM_RADIO
    ifeq ($(BOARD_FM_DEVICE),)
        BOARD_FM_DEVICE := $(BOARD_WLAN_DEVICE)
    endif
+2 −2
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ extern int register_android_message_digest_sha1(JNIEnv *env);

extern int register_android_util_FloatMath(JNIEnv* env);

#ifdef HAVE_FM_RADIO
#if defined(HAVE_FM_RADIO) || defined (BOARD_HAVE_FM_RADIO)
extern int register_android_hardware_fm_fmradio(JNIEnv* env);
#endif

@@ -1273,7 +1273,7 @@ static const RegJNIRec gRegJNI[] = {
    REG_JNI(register_android_os_MemoryFile),
    REG_JNI(register_com_android_internal_os_ZygoteInit),
    REG_JNI(register_android_hardware_Camera),
#ifdef HAVE_FM_RADIO
#if defined(HAVE_FM_RADIO) || defined (BOARD_HAVE_FM_RADIO)
    REG_JNI(register_android_hardware_fm_fmradio),
#endif
    REG_JNI(register_android_hardware_SensorManager),
+1 −1
Original line number Diff line number Diff line
@@ -293,7 +293,7 @@ public:
                DEVICE_OUT_WIRED_HEADPHONE | DEVICE_OUT_BLUETOOTH_SCO | DEVICE_OUT_BLUETOOTH_SCO_HEADSET |
#endif
                DEVICE_OUT_BLUETOOTH_SCO_CARKIT | DEVICE_OUT_BLUETOOTH_A2DP | DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES |
#ifdef OMAP_ENHANCEMENT
#if defined(OMAP_ENHANCEMENT) && !defined(HAVE_FM_RADIO)
                DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER | DEVICE_OUT_AUX_DIGITAL | DEVICE_OUT_LOW_POWER |
                DEVICE_OUT_FM_TRANSMIT | DEVICE_OUT_DEFAULT),
#else
+3 −2
Original line number Diff line number Diff line
@@ -71,10 +71,11 @@ enum {
    GET_EFFECT_DESCRIPTOR,
    CREATE_EFFECT,
    MOVE_EFFECTS,
#ifdef HAVE_FM_RADIO
    SET_FM_VOLUME,
#endif
#ifdef OMAP_ENHANCEMENT
    SET_FMRX_ACTIVE
#else
    SET_FM_VOLUME
#endif
};