Add engine configuration to the AIDL Audio HAL interface. am: db11b2db44

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2215431

Change-Id: If172d08a6fe2705aa9a307b6c7098cacb8d54279
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Lorena Torres-Huerta
2022-12-12 23:09:37 +00:00
committed by Automerger Merge Worker
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