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

Commit 6b6a0f05 authored by Kevin Rocard's avatar Kevin Rocard Committed by Android (Google) Code Review
Browse files

Merge changes from topic "audio-v5"

* changes:
  libaudiohal: move to Stream Metadata to common
  libaudiohal: Introduce support HAL V5 identical to V4
parents 63d2d774 1cf6b4df
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -15,10 +15,13 @@ cc_library_shared {
    shared_libs: [
        "android.hardware.audio.effect@2.0",
        "android.hardware.audio.effect@4.0",
        "android.hardware.audio.effect@5.0",
        "android.hardware.audio@2.0",
        "android.hardware.audio@4.0",
        "android.hardware.audio@5.0",
        "libaudiohal@2.0",
        "libaudiohal@4.0",
        "libaudiohal@5.0",
        "libutils",
    ],

+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#include <android/hardware/audio/2.0/IDevicesFactory.h>
#include <android/hardware/audio/4.0/IDevicesFactory.h>
#include <android/hardware/audio/5.0/IDevicesFactory.h>

#include <libaudiohal/FactoryHalHidl.h>

@@ -23,6 +24,9 @@ namespace android {

// static
sp<DevicesFactoryHalInterface> DevicesFactoryHalInterface::create() {
    if (hardware::audio::V5_0::IDevicesFactory::getService() != nullptr) {
        return V5_0::createDevicesFactoryHal();
    }
    if (hardware::audio::V4_0::IDevicesFactory::getService() != nullptr) {
        return V4_0::createDevicesFactoryHal();
    }
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#include <android/hardware/audio/effect/2.0/IEffectsFactory.h>
#include <android/hardware/audio/effect/4.0/IEffectsFactory.h>
#include <android/hardware/audio/effect/5.0/IEffectsFactory.h>

#include <libaudiohal/FactoryHalHidl.h>

@@ -23,6 +24,9 @@ namespace android {

// static
sp<EffectsFactoryHalInterface> EffectsFactoryHalInterface::create() {
    if (hardware::audio::effect::V5_0::IEffectsFactory::getService() != nullptr) {
        return V5_0::createEffectsFactoryHal();
    }
    if (hardware::audio::effect::V4_0::IEffectsFactory::getService() != nullptr) {
        return V4_0::createEffectsFactoryHal();
    }
+22 −6
Original line number Diff line number Diff line
@@ -25,12 +25,6 @@ cc_defaults {
    ],
    shared_libs: [
        "android.hardware.audio.common-util",
        "android.hardware.audio.common@2.0",
        "android.hardware.audio.common@4.0",
        "android.hardware.audio.effect@2.0",
        "android.hardware.audio.effect@4.0",
        "android.hardware.audio@2.0",
        "android.hardware.audio@4.0",
        "android.hidl.allocator@1.0",
        "android.hidl.memory@1.0",
        "libaudiohal_deathhandler",
@@ -63,7 +57,10 @@ cc_library_shared {
    name: "libaudiohal@2.0",
    defaults: ["libaudiohal_default"],
    shared_libs: [
        "android.hardware.audio.common@2.0",
        "android.hardware.audio.common@2.0-util",
        "android.hardware.audio.effect@2.0",
        "android.hardware.audio@2.0",
    ],
    cflags: [
        "-DMAJOR_VERSION=2",
@@ -76,7 +73,10 @@ cc_library_shared {
    name: "libaudiohal@4.0",
    defaults: ["libaudiohal_default"],
    shared_libs: [
        "android.hardware.audio.common@4.0",
        "android.hardware.audio.common@4.0-util",
        "android.hardware.audio.effect@4.0",
        "android.hardware.audio@4.0",
    ],
    cflags: [
        "-DMAJOR_VERSION=4",
@@ -84,3 +84,19 @@ cc_library_shared {
        "-include common/all-versions/VersionMacro.h",
    ]
}

cc_library_shared {
    name: "libaudiohal@5.0",
    defaults: ["libaudiohal_default"],
    shared_libs: [
        "android.hardware.audio.common@5.0",
        "android.hardware.audio.common@5.0-util",
        "android.hardware.audio.effect@5.0",
        "android.hardware.audio@5.0",
    ],
    cflags: [
        "-DMAJOR_VERSION=5",
        "-DMINOR_VERSION=0",
        "-include common/all-versions/VersionMacro.h",
    ]
}
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@

using ::android::hardware::audio::CPP_VERSION::Result;

#if MAJOR_VERSION == 4
#if MAJOR_VERSION >= 4
using ::android::hardware::audio::CPP_VERSION::AudioMicrophoneChannelMapping;
using ::android::hardware::audio::CPP_VERSION::AudioMicrophoneDirectionality;
using ::android::hardware::audio::CPP_VERSION::AudioMicrophoneLocation;
@@ -109,7 +109,7 @@ void ConversionHelperHidl::emitError(const char* funcName, const char* descripti
    ALOGE("%s %p %s: %s (from rpc)", mClassName, this, funcName, description);
}

#if MAJOR_VERSION == 4
#if MAJOR_VERSION >= 4
// TODO: Use the same implementation in the hal when it moves to a util library.
static std::string deviceAddressToHal(const DeviceAddress& address) {
    // HAL assumes that the address is NUL-terminated.
Loading