summaryrefslogtreecommitdiff
path: root/audio/core/all-versions/default/PrimaryDevice.cpp
diff options
context:
space:
mode:
authorMikhail Naganov <mnaganov@google.com>2022-01-15 01:15:12 +0000
committerMikhail Naganov <mnaganov@google.com>2022-02-05 00:44:17 +0000
commit8140f5660a6cd15d3e947cb52e6b305c36313151 (patch)
treebad364f3489c097a7bb9d7295ce6a5f23e5b6008 /audio/core/all-versions/default/PrimaryDevice.cpp
parent51a7e13849988a91938932231c39a41157953038 (diff)
Audio HAL V7.1: Update the default implementation
Split versions of "common" and "core" types from the version of the interfaces. "Common" and "core" versions are set to 7.0. Implemented new methods of V7.1 interfaces. Bug: 214426419 Test: m android.hardware.audio@7.1-impl Test: m android.hardware.audio@7.0-impl Test: m android.hardware.audio.effect@7.0-impl Test: m android.hardware.audio@6.0-impl Change-Id: Ic4c44d4ac9bbfa7b62695866b9aa7473658390b2 (cherry picked from commit 7d01538eeccf81aa57da61b4abba830d34582195) Merged-In: Ic4c44d4ac9bbfa7b62695866b9aa7473658390b2
Diffstat (limited to 'audio/core/all-versions/default/PrimaryDevice.cpp')
-rw-r--r--audio/core/all-versions/default/PrimaryDevice.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/audio/core/all-versions/default/PrimaryDevice.cpp b/audio/core/all-versions/default/PrimaryDevice.cpp
index fe56177975..cf162f1463 100644
--- a/audio/core/all-versions/default/PrimaryDevice.cpp
+++ b/audio/core/all-versions/default/PrimaryDevice.cpp
@@ -29,6 +29,10 @@ namespace audio {
namespace CPP_VERSION {
namespace implementation {
+namespace util {
+using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util;
+}
+
PrimaryDevice::PrimaryDevice(audio_hw_device_t* device) : mDevice(new Device(device)) {}
PrimaryDevice::~PrimaryDevice() {
@@ -195,7 +199,7 @@ Return<void> PrimaryDevice::updateAudioPatch(int32_t previousPatch,
// Methods from ::android::hardware::audio::CPP_VERSION::IPrimaryDevice follow.
Return<Result> PrimaryDevice::setVoiceVolume(float volume) {
- if (!isGainNormalized(volume)) {
+ if (!util::isGainNormalized(volume)) {
ALOGW("Can not set a voice volume (%f) outside [0,1]", volume);
return Result::INVALID_ARGUMENTS;
}
@@ -326,7 +330,7 @@ Return<Result> PrimaryDevice::setBtHfpSampleRate(uint32_t sampleRateHz) {
return mDevice->setParam(AUDIO_PARAMETER_KEY_HFP_SET_SAMPLING_RATE, int(sampleRateHz));
}
Return<Result> PrimaryDevice::setBtHfpVolume(float volume) {
- if (!isGainNormalized(volume)) {
+ if (!util::isGainNormalized(volume)) {
ALOGW("Can not set BT HFP volume (%f) outside [0,1]", volume);
return Result::INVALID_ARGUMENTS;
}