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

Commit 3b918434 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10025836 from 40079052 to udc-release

Change-Id: I11830a5e13e800a7c2da49ed506e1afafde36502
parents b700fdcf 40079052
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -49,13 +49,11 @@ interface ISoundDose {
    oneway void updateAttenuation(float attenuationDB, int device);

    /**
     * Disable the calculation of sound dose. This has the effect that no MEL
     * values will be computed on the framework side. The MEL returned from
     * the IHalSoundDoseCallbacks will be ignored.
     * Should only be called once at startup if the AudioService does not
     * support CSD.
     * Enables/disables the calculation of sound dose. This has the effect that
     * if disabled no MEL values will be computed on the framework side. The MEL
     * returned from the IHalSoundDoseCallbacks will be ignored.
     */
    oneway void disableCsd();
    oneway void setCsdEnabled(boolean enabled);

    /* -------------------------- Test API methods --------------------------
    /** Get the currently used RS2 upper bound. */
+6 −0
Original line number Diff line number Diff line
@@ -74,6 +74,12 @@ cc_library_shared {
cc_library_headers {
    name: "libaudiohal_headers",

    header_libs: [
        "libeffectsconfig_headers",
    ],

    export_header_lib_headers: ["libeffectsconfig_headers"],

    export_include_dirs: ["include"],
}

+3 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ cc_defaults {
        "android.hidl.allocator@1.0",
        "android.hidl.memory@1.0",
        "libaudiohal_deathhandler",
        "libeffectsconfig",
        "libhidlbase",
        "libhidlmemory",
    ],
@@ -287,15 +288,16 @@ cc_library_shared {
        "android.hardware.common.fmq-V1-ndk",
    ],
    shared_libs: [
        "libbinder_ndk",
        "libaudio_aidl_conversion_common_cpp",
        "libaudio_aidl_conversion_common_ndk",
        "libaudio_aidl_conversion_core_ndk",
        "libaudio_aidl_conversion_effect_ndk",
        "libaudioaidlcommon",
        "libbinder_ndk",
    ],
    header_libs: [
        "libaudio_system_headers",
        "libeffectsconfig_headers",
    ],
    cflags: [
        "-Wall",
+23 −6
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
//#define LOG_NDEBUG 0

#include <error/expected_utils.h>
#include <aidl/android/media/audio/common/AudioStreamType.h>
#include <android/binder_manager.h>
#include <media/AidlConversionCppNdk.h>
#include <media/AidlConversionEffect.h>
@@ -35,11 +36,13 @@
#include "EffectsFactoryHalAidl.h"

using ::aidl::android::legacy2aidl_audio_uuid_t_AudioUuid;
using aidl::android::aidl_utils::statusTFromBinderStatus;
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::IFactory;
using aidl::android::media::audio::common::AudioUuid;
using android::detail::AudioHalVersionInfo;
using ::aidl::android::aidl_utils::statusTFromBinderStatus;
using ::aidl::android::hardware::audio::effect::Descriptor;
using ::aidl::android::hardware::audio::effect::IFactory;
using ::aidl::android::hardware::audio::effect::Processing;
using ::aidl::android::media::audio::common::AudioUuid;
using ::android::base::unexpected;
using ::android::detail::AudioHalVersionInfo;

namespace android {
namespace effect {
@@ -92,7 +95,8 @@ EffectsFactoryHalAidl::EffectsFactoryHalAidl(std::shared_ptr<IFactory> effectsFa
                       [](const Descriptor& desc) { return !desc.common.id.proxy.has_value(); });
          return list;
      }()),
      mEffectCount(mNonProxyDescList.size() + mProxyDescList.size()) {
      mEffectCount(mNonProxyDescList.size() + mProxyDescList.size()),
      mEffectProcessings(nullptr /* TODO: add AIDL implementation */) {
    ALOG_ASSERT(mFactory != nullptr, "Provided IEffectsFactory service is NULL");
    ALOGI("%s with %zu nonProxyEffects and %zu proxyEffects", __func__, mNonProxyDescList.size(),
          mProxyDescList.size());
@@ -269,6 +273,19 @@ bool EffectsFactoryHalAidl::isProxyEffect(const AudioUuid& uuid) const {
    return 0 != mUuidProxyMap.count(uuid);
}

std::shared_ptr<const effectsConfig::Processings> EffectsFactoryHalAidl::getProcessings() const {
    return mEffectProcessings;
}

::android::error::Result<size_t> EffectsFactoryHalAidl::getSkippedElements() const {
    if (!mEffectProcessings) {
        return ::android::base::unexpected(BAD_VALUE);
    }

    // Only return 0 for AIDL, because the AIDL interface doesn't aware of configuration file
    return 0;
}

} // namespace effect

// When a shared library is built from a static library, even explicit
+6 −0
Original line number Diff line number Diff line
@@ -62,6 +62,10 @@ class EffectsFactoryHalAidl final : public EffectsFactoryHalInterface {

    detail::AudioHalVersionInfo getHalVersion() const override;

    std::shared_ptr<const effectsConfig::Processings> getProcessings() const override;

    ::android::error::Result<size_t> getSkippedElements() const override;

  private:
    const std::shared_ptr<IFactory> mFactory;
    const detail::AudioHalVersionInfo mHalVersion;
@@ -77,6 +81,8 @@ class EffectsFactoryHalAidl final : public EffectsFactoryHalInterface {
    const std::vector<Descriptor> mNonProxyDescList;
    // total number of effects including proxy effects
    const size_t mEffectCount;
    // Query result of pre and post processing from effect factory
    const std::shared_ptr<const effectsConfig::Processings> mEffectProcessings;

    std::mutex mLock;
    uint64_t mEffectIdCounter GUARDED_BY(mLock) = 0;  // Align with HIDL (0 is INVALID_ID)
Loading