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

Commit 9fe81732 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Enable passthrough mode by default for audio, soundtrigger, and radio"

parents b04aa125 9dc1747e
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -9,9 +9,20 @@ LOCAL_SHARED_LIBRARIES := \
    liblog      \
    libutils

ifeq ($(ENABLE_TREBLE), true)
ifeq ($(USE_LEGACY_LOCAL_AUDIO_HAL), true)

LOCAL_CFLAGS += -DENABLE_TREBLE
# Use audiohal directly w/o hwbinder middleware.
# This is for performance comparison and debugging only.

LOCAL_SRC_FILES := \
    DeviceHalLocal.cpp          \
    DevicesFactoryHalLocal.cpp  \
    EffectBufferHalLocal.cpp    \
    EffectHalLocal.cpp          \
    EffectsFactoryHalLocal.cpp  \
    StreamHalLocal.cpp

else  # if !USE_LEGACY_LOCAL_AUDIO_HAL

LOCAL_SRC_FILES := \
    ConversionHelperHidl.cpp   \
@@ -36,16 +47,7 @@ LOCAL_SHARED_LIBRARIES += \
    android.hidl.memory@1.0                \
    libmedia_helper

else  # if !ENABLE_TREBLE

LOCAL_SRC_FILES := \
    DeviceHalLocal.cpp          \
    DevicesFactoryHalLocal.cpp  \
    EffectBufferHalLocal.cpp    \
    EffectHalLocal.cpp          \
    EffectsFactoryHalLocal.cpp  \
    StreamHalLocal.cpp
endif  # ENABLE_TREBLE
endif  # USE_LEGACY_LOCAL_AUDIO_HAL

LOCAL_MODULE := libaudiohal

+4 −2
Original line number Diff line number Diff line
@@ -167,14 +167,16 @@ status_t EffectHalHidl::command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdDa
        uint32_t *replySize, void *pReplyData) {
    if (mEffect == 0) return NO_INIT;
    hidl_vec<uint8_t> hidlData;
    if (pCmdData != nullptr && cmdSize > 0) {
        hidlData.setToExternal(reinterpret_cast<uint8_t*>(pCmdData), cmdSize);
    }
    status_t status;
    Return<void> ret = mEffect->command(cmdCode, hidlData, *replySize,
            [&](int32_t s, const hidl_vec<uint8_t>& result) {
                status = s;
                if (status == 0) {
                    if (*replySize > result.size()) *replySize = result.size();
                    if (pReplyData && *replySize > 0) {
                    if (pReplyData != nullptr && *replySize > 0) {
                        memcpy(pReplyData, &result[0], *replySize);
                    }
                }
+6 −7
Original line number Diff line number Diff line
@@ -30,9 +30,13 @@ LOCAL_SHARED_LIBRARIES:= \
    libradio \
    libradio_metadata

ifeq ($(ENABLE_TREBLE),true)
ifeq ($(USE_LEGACY_LOCAL_AUDIO_HAL),true)
# libhardware configuration
LOCAL_SRC_FILES +=               \
    RadioHalLegacy.cpp
else
# Treble configuration
LOCAL_CFLAGS += -DENABLE_TREBLE

LOCAL_SRC_FILES += \
    HidlUtils.cpp \
    RadioHalHidl.cpp
@@ -43,13 +47,8 @@ LOCAL_SHARED_LIBRARIES += \
    libhidltransport \
    libbase \
    android.hardware.broadcastradio@1.0
else
# libhardware configuration
LOCAL_SRC_FILES +=               \
    RadioHalLegacy.cpp
endif


LOCAL_CFLAGS += -Wall -Wextra -Werror

LOCAL_MULTILIB := $(AUDIOSERVER_MULTILIB)
+11 −12
Original line number Diff line number Diff line
@@ -34,9 +34,12 @@ LOCAL_SHARED_LIBRARIES:= \
    libserviceutility


ifeq ($(ENABLE_TREBLE),true)
ifeq ($(USE_LEGACY_LOCAL_AUDIO_HAL),true)
# libhardware configuration
LOCAL_SRC_FILES +=               \
    SoundTriggerHalLegacy.cpp
else
# Treble configuration
LOCAL_CFLAGS += -DENABLE_TREBLE
LOCAL_SRC_FILES +=               \
    SoundTriggerHalHidl.cpp

@@ -47,10 +50,6 @@ LOCAL_SHARED_LIBRARIES += \
    libbase \
    android.hardware.soundtrigger@2.0 \
    android.hardware.audio.common@2.0
else
# libhardware configuration
LOCAL_SRC_FILES +=               \
    SoundTriggerHalLegacy.cpp
endif