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

Commit 3583c435 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "Audio policy: implement configuration file in XML"

parents f8e187c6 f4ad6e56
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -67,12 +67,16 @@ LOCAL_SHARED_LIBRARIES := \

ifeq ($(USE_CONFIGURABLE_AUDIO_POLICY), 1)

ifneq ($(USE_XML_AUDIO_POLICY_CONF), 1)
$(error Configurable policy does not support legacy conf file)
endif #ifneq ($(USE_XML_AUDIO_POLICY_CONF), 1)

LOCAL_REQUIRED_MODULES := \
    parameter-framework.policy \
    audio_policy_criteria.conf \

LOCAL_C_INCLUDES += \
    $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include \
    $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include

LOCAL_SHARED_LIBRARIES += libaudiopolicyengineconfigurable

@@ -85,12 +89,20 @@ endif
LOCAL_C_INCLUDES += \
    $(TOPDIR)frameworks/av/services/audiopolicy/common/include \
    $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface \
    $(TOPDIR)frameworks/av/services/audiopolicy/utilities \
    $(TOPDIR)frameworks/av/services/audiopolicy/utilities

LOCAL_STATIC_LIBRARIES := \
    libmedia_helper \
    libaudiopolicycomponents

ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1)
LOCAL_STATIC_LIBRARIES += libxml2

LOCAL_SHARED_LIBRARIES += libicuuc

LOCAL_CFLAGS += -DUSE_XML_AUDIO_POLICY_CONF
endif #ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1)

LOCAL_MODULE:= libaudiopolicymanagerdefault

include $(BUILD_SHARED_LIBRARY)
+16 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ LOCAL_SRC_FILES:= \
    src/AudioOutputDescriptor.cpp \
    src/AudioCollections.cpp \
    src/EffectDescriptor.cpp \
    src/ConfigParsingUtils.cpp \
    src/SoundTriggerSession.cpp \
    src/SessionRoute.cpp \
    src/AudioSourceDescriptor.cpp \
@@ -29,12 +28,27 @@ LOCAL_SHARED_LIBRARIES := \
    libutils \
    liblog \

LOCAL_C_INCLUDES += \
LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/include \
    $(TOPDIR)frameworks/av/services/audiopolicy/common/include \
    $(TOPDIR)frameworks/av/services/audiopolicy \
    $(TOPDIR)frameworks/av/services/audiopolicy/utilities \

ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1)
LOCAL_SRC_FILES += src/Serializer.cpp

LOCAL_STATIC_LIBRARIES := libxml2

LOCAL_SHARED_LIBRARIES += libicuuc

LOCAL_C_INCLUDES += \
    $(TOPDIR)external/libxml2/include \
    $(TOPDIR)external/icu/icu4c/source/common

else
LOCAL_SRC_FILES += src/ConfigParsingUtils.cpp
endif #ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1)

LOCAL_EXPORT_C_INCLUDE_DIRS := \
    $(LOCAL_PATH)/include

+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ public:
class AudioRouteVector : public Vector<sp<AudioRoute> >
{
public:
    status_t dump(int fd) const;
    status_t dump(int fd, int spaces) const;
};

}; // namespace android
+10 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#pragma once

#include <AudioGain.h>
#include <VolumeCurve.h>
#include <AudioPort.h>
#include <AudioPatch.h>
#include <DeviceDescriptor.h>
@@ -52,6 +53,15 @@ public:
        mHwModules = hwModules;
    }

    void addAvailableDevice(const sp<DeviceDescriptor> &availableDevice)
    {
        if (audio_is_output_device(availableDevice->type())) {
            mAvailableOutputDevices.add(availableDevice);
        } else if (audio_is_input_device(availableDevice->type())) {
            mAvailableInputDevices.add(availableDevice);
        }
    }

    void addAvailableInputDevices(const DeviceVector &availableInputDevices)
    {
        mAvailableInputDevices.add(availableInputDevices);
+10 −1
Original line number Diff line number Diff line
@@ -51,7 +51,16 @@ public:
    void setGains(const AudioGainCollection &gains) { mGains = gains; }
    const AudioGainCollection &getGains() const { return mGains; }

    void setFlags(uint32_t flags) { mFlags = flags; }
    void setFlags(uint32_t flags)
    {
        //force direct flag if offload flag is set: offloading implies a direct output stream
        // and all common behaviors are driven by checking only the direct flag
        // this should normally be set appropriately in the policy configuration file
        if (mRole == AUDIO_PORT_ROLE_SOURCE && (flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) != 0) {
            flags |= AUDIO_OUTPUT_FLAG_DIRECT;
        }
        mFlags = flags;
    }
    uint32_t getFlags() const { return mFlags; }

    virtual void attach(const sp<HwModule>& module);
Loading