audio: Add methods for controlling hw volume
Add the following methods:
- IStreamIn.get/setHwGain;
- IStreamOut.get/setHwVolume.
Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I8fc48c15a9211b5f0bf8bb4b5b0e50d414b859c2
diff --git a/audio/aidl/default/Stream.cpp b/audio/aidl/default/Stream.cpp
index 424c3e4..e984091 100644
--- a/audio/aidl/default/Stream.cpp
+++ b/audio/aidl/default/Stream.cpp
@@ -658,6 +658,17 @@
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
+ndk::ScopedAStatus StreamIn::getHwGain(std::vector<float>* _aidl_return) {
+ LOG(DEBUG) << __func__;
+ (void)_aidl_return;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus StreamIn::setHwGain(const std::vector<float>& in_channelGains) {
+ LOG(DEBUG) << __func__ << ": gains " << ::android::internal::ToString(in_channelGains);
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
// static
ndk::ScopedAStatus StreamOut::createInstance(const SourceMetadata& sourceMetadata,
StreamContext context,
@@ -680,4 +691,15 @@
LOG(DEBUG) << __func__;
}
+ndk::ScopedAStatus StreamOut::getHwVolume(std::vector<float>* _aidl_return) {
+ LOG(DEBUG) << __func__;
+ (void)_aidl_return;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus StreamOut::setHwVolume(const std::vector<float>& in_channelVolumes) {
+ LOG(DEBUG) << __func__ << ": gains " << ::android::internal::ToString(in_channelVolumes);
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/include/core-impl/Stream.h b/audio/aidl/default/include/core-impl/Stream.h
index 5746f9d..e8b2c54 100644
--- a/audio/aidl/default/include/core-impl/Stream.h
+++ b/audio/aidl/default/include/core-impl/Stream.h
@@ -305,6 +305,8 @@
return StreamCommonImpl<::aidl::android::hardware::audio::common::SinkMetadata,
StreamInWorker>::updateMetadata(in_sinkMetadata);
}
+ ndk::ScopedAStatus getHwGain(std::vector<float>* _aidl_return) override;
+ ndk::ScopedAStatus setHwGain(const std::vector<float>& in_channelGains) override;
public:
static ndk::ScopedAStatus createInstance(
@@ -337,6 +339,8 @@
return StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata,
StreamOutWorker>::updateMetadata(in_sourceMetadata);
}
+ ndk::ScopedAStatus getHwVolume(std::vector<float>* _aidl_return) override;
+ ndk::ScopedAStatus setHwVolume(const std::vector<float>& in_channelVolumes) override;
public:
static ndk::ScopedAStatus createInstance(