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

Commit 45c0e183 authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am 46d8eb1a: Merge "Add a configurable version of the policy engine based on PFW" into mnc-dev

* commit '46d8eb1a':
  Add a configurable version of the policy engine based on PFW
parents 8541205f 46d8eb1a
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -64,8 +64,23 @@ LOCAL_SHARED_LIBRARIES := \
    liblog \
    libsoundtrigger

ifeq ($(USE_CONFIGURABLE_AUDIO_POLICY), 1)

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

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

LOCAL_SHARED_LIBRARIES += libaudiopolicyengineconfigurable

else

LOCAL_SHARED_LIBRARIES += libaudiopolicyenginedefault

endif

LOCAL_C_INCLUDES += \
    $(TOPDIR)frameworks/av/services/audiopolicy/common/include \
    $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface \
+2 −2
Original line number Diff line number Diff line
@@ -107,8 +107,8 @@ public:
     * @param[in] usage for which a configuration shall be forced.
     * @param[in] config wished to be forced for the given usage.
     *
     * @return NO_ERROR if the Force Use config was set correctly, error code otherwise (e.g. config not
     * allowed a given usage...)
     * @return NO_ERROR if the Force Use config was set correctly, error code otherwise (e.g. config
     * not allowed a given usage...)
     */
    virtual status_t setForceUse(audio_policy_force_use_t usage,
                                 audio_policy_forced_cfg_t config) = 0;
+59 −0
Original line number Diff line number Diff line
ifeq ($(USE_CONFIGURABLE_AUDIO_POLICY), 1)

LOCAL_PATH := $(call my-dir)

# Component build
#######################################################################

include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
    src/Engine.cpp \
    src/EngineInstance.cpp \
    src/Stream.cpp \
    src/Strategy.cpp \
    src/Usage.cpp \
    src/InputSource.cpp \

audio_policy_engine_includes_common := \
    $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include \
    $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/interface \
    $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface

LOCAL_CFLAGS += \
    -Wall \
    -Werror \
    -Wextra \

LOCAL_EXPORT_C_INCLUDE_DIRS := \
    $(audio_policy_engine_includes_common)

LOCAL_C_INCLUDES := \
    $(audio_policy_engine_includes_common) \
    $(TARGET_OUT_HEADERS)/hw \
    $(call include-path-for, frameworks-av) \
    $(call include-path-for, audio-utils) \
    $(TOPDIR)frameworks/av/services/audiopolicy/common/include


LOCAL_MODULE := libaudiopolicyengineconfigurable
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_LIBRARIES := \
    libmedia_helper \
    libaudiopolicypfwwrapper \
    libaudiopolicycomponents

LOCAL_SHARED_LIBRARIES := \
    libcutils \
    libutils \
    libaudioutils \
    libparameter

include $(BUILD_SHARED_LIBRARY)

#######################################################################
# Recursive call sub-folder Android.mk
#
include $(call all-makefiles-under,$(LOCAL_PATH))

endif
+81 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

class AudioPolicyManagerInterface;
class AudioPolicyPluginInterface;

namespace android
{
namespace audio_policy
{

class Engine;

class EngineInstance
{
protected:
    EngineInstance();

public:
    virtual ~EngineInstance();

    /**
     * Get Audio Policy Engine instance.
     *
     * @return pointer to Route Manager Instance object.
     */
    static EngineInstance *getInstance();

    /**
     * Interface query.
     * The first client of an interface of the policy engine will start the singleton.
     *
     * @tparam RequestedInterface: interface that the client is wishing to retrieve.
     *
     * @return interface handle.
     */
    template <class RequestedInterface>
    RequestedInterface *queryInterface() const;

protected:
    /**
     * Get Audio Policy Engine instance.
     *
     * @return Audio Policy Engine singleton.
     */
    Engine *getEngine() const;

private:
    /* Copy facilities are put private to disable copy. */
    EngineInstance(const EngineInstance &object);
    EngineInstance &operator=(const EngineInstance &object);
};

/**
 * Limit template instantation to supported type interfaces.
 * Compile time error will claim if invalid interface is requested.
 */
template <>
AudioPolicyManagerInterface *EngineInstance::queryInterface() const;

template <>
AudioPolicyPluginInterface *EngineInstance::queryInterface() const;

}; // namespace audio_policy

}; // namespace android
+22 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <Volume.h>
#include <vector>

typedef std::vector<VolumeCurvePoint> VolumeCurvePoints;
Loading