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

Commit db5456b6 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

Support old libaudiopolicy binaries

The stream strategy and effects methods are new on 2.3, and invoking them
on old audiopolicy proprietaries results in bad things.
Especially if those proprietaries have other non-standard functions
inserted into the interface, in the same locations this code expects to
find effects-related things...

Enable with BOARD_USES_FROYO_AUDIOPOLICY

Change-Id: I3564862b31d44394a99e37767c767ce1a53d77a1
parent 5e241b6d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -118,6 +118,10 @@ ifeq ($(BOARD_USE_BROADCOM_FM_VOLUME_HACK),true)
  LOCAL_CFLAGS += -DUSE_BROADCOM_FM_VOLUME_HACK
endif

ifeq ($(BOARD_USES_FROYO_AUDIOPOLICY),true)
  LOCAL_CFLAGS += -DFROYO_AUDIOPOLICY
endif

ifeq ($(TARGET_SIMULATOR),true)
    ifeq ($(HOST_OS),linux)
        LOCAL_LDLIBS += -lrt -lpthread
+12 −0
Original line number Diff line number Diff line
@@ -348,6 +348,9 @@ status_t AudioPolicyService::getStreamVolumeIndex(AudioSystem::stream_type strea

uint32_t AudioPolicyService::getStrategyForStream(AudioSystem::stream_type stream)
{
#ifdef FROYO_AUDIOPOLICY
    return 0;
#endif
    if (mpPolicyManager == NULL) {
        return 0;
    }
@@ -356,6 +359,9 @@ uint32_t AudioPolicyService::getStrategyForStream(AudioSystem::stream_type strea

audio_io_handle_t AudioPolicyService::getOutputForEffect(effect_descriptor_t *desc)
{
#ifdef FROYO_AUDIOPOLICY
    return NO_INIT;
#endif
    if (mpPolicyManager == NULL) {
        return NO_INIT;
    }
@@ -369,6 +375,9 @@ status_t AudioPolicyService::registerEffect(effect_descriptor_t *desc,
                                int session,
                                int id)
{
#ifdef FROYO_AUDIOPOLICY
    return NO_INIT;
#endif
    if (mpPolicyManager == NULL) {
        return NO_INIT;
    }
@@ -377,6 +386,9 @@ status_t AudioPolicyService::registerEffect(effect_descriptor_t *desc,

status_t AudioPolicyService::unregisterEffect(int id)
{
#ifdef FROYO_AUDIOPOLICY
    return NO_INIT;
#endif
    if (mpPolicyManager == NULL) {
        return NO_INIT;
    }