Add engine configuration to the AIDL Audio HAL interface.

Bug: 242678729
Test: m
Change-Id: I9f02399f6b63dca6d7a4c1a848fada0784e18b1d
This commit is contained in:
Lorena Torres-Huerta
2022-08-19 02:58:59 +00:00
parent 8fcc79fcb7
commit db11b2db44
4 changed files with 30 additions and 0 deletions

View File

@@ -35,4 +35,5 @@ package android.hardware.audio.core;
@VintfStability
interface IConfig {
android.hardware.audio.core.SurroundSoundConfig getSurroundSoundConfig();
android.media.audio.common.AudioHalEngineConfig getEngineConfig();
}

View File

@@ -17,6 +17,7 @@
package android.hardware.audio.core;
import android.hardware.audio.core.SurroundSoundConfig;
import android.media.audio.common.AudioHalEngineConfig;
/**
* This interface provides system-wide configuration parameters for audio I/O
@@ -34,4 +35,19 @@ interface IConfig {
* @return The surround sound configuration
*/
SurroundSoundConfig getSurroundSoundConfig();
/**
* Returns the configuration items used to determine the audio policy engine
* flavor and initial configuration.
*
* Engine flavor is determined by presence of capSpecificConfig, which must
* only be present if the device uses the Configurable Audio Policy (CAP)
* engine. Clients normally use the default audio policy engine. The client
* will use the CAP engine only when capSpecificConfig has a non-null value.
*
* This method is expected to only be called during the initialization of
* the audio policy engine, and must always return the same result.
*
* @return The engine configuration
*/
AudioHalEngineConfig getEngineConfig();
}

View File

@@ -13,11 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "AHAL_Module"
#include <android-base/logging.h>
#include "core-impl/Config.h"
using aidl::android::media::audio::common::AudioHalEngineConfig;
namespace aidl::android::hardware::audio::core {
ndk::ScopedAStatus Config::getSurroundSoundConfig(SurroundSoundConfig* _aidl_return) {
SurroundSoundConfig surroundSoundConfig;
@@ -26,4 +29,12 @@ ndk::ScopedAStatus Config::getSurroundSoundConfig(SurroundSoundConfig* _aidl_ret
LOG(DEBUG) << __func__ << ": returning " << _aidl_return->toString();
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Config::getEngineConfig(AudioHalEngineConfig* _aidl_return) {
AudioHalEngineConfig engineConfig;
// TODO: parse from XML; for now, use empty config as default
*_aidl_return = std::move(engineConfig);
LOG(DEBUG) << __func__ << ": returning " << _aidl_return->toString();
return ndk::ScopedAStatus::ok();
}
} // namespace aidl::android::hardware::audio::core

View File

@@ -22,6 +22,8 @@ namespace aidl::android::hardware::audio::core {
class Config : public BnConfig {
ndk::ScopedAStatus getSurroundSoundConfig(SurroundSoundConfig* _aidl_return) override;
ndk::ScopedAStatus getEngineConfig(
aidl::android::media::audio::common::AudioHalEngineConfig* _aidl_return) override;
};
} // namespace aidl::android::hardware::audio::core