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

Commit dcb0594d authored by Lorena Torres-Huerta's avatar Lorena Torres-Huerta Committed by Automerger Merge Worker
Browse files

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

Add engine configuration to the AIDL Audio HAL interface. am: db11b2db am: 9e79190b am: 6915317e

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



Change-Id: I91dce2ae9ab4a5d84787188a0778ad87b768334a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 86c7e12f 6915317e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -35,4 +35,5 @@ package android.hardware.audio.core;
@VintfStability
interface IConfig {
  android.hardware.audio.core.SurroundSoundConfig getSurroundSoundConfig();
  android.media.audio.common.AudioHalEngineConfig getEngineConfig();
}
+16 −0
Original line number Diff line number Diff line
@@ -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();
}
+11 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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