Merge changes from topic "media_common_types_version_bump"

* changes:
  Use explicit aidl versions for audio hal and soundtrigger dependencies.
  Add AudioAttributes and AudioFlag for use in HAL interface for engine configuration.
This commit is contained in:
Lorena Torres-Huerta 2022-09-07 23:30:55 +00:00 committed by Gerrit Code Review
commit e38b08ad47
7 changed files with 108 additions and 30 deletions

View file

@ -33,7 +33,7 @@ aidl_interface {
"android/hardware/audio/common/SourceMetadata.aidl", "android/hardware/audio/common/SourceMetadata.aidl",
], ],
imports: [ imports: [
"android.media.audio.common.types-V1", "android.media.audio.common.types-V2",
], ],
stability: "vintf", stability: "vintf",
backend: { backend: {
@ -59,12 +59,34 @@ aidl_interface {
versions_with_info: [ versions_with_info: [
{ {
version: "1", version: "1",
imports: ["android.media.audio.common.types-V1"], imports: ["android.media.audio.common.types-V2"],
}, },
// IMPORTANT: Update latest_android_hardware_audio_common every time you
// add the latest frozen version to versions_with_info
], ],
} }
// Note: This should always be one version ahead of the last frozen version
latest_android_hardware_audio_common = "android.hardware.audio.common-V1"
// Modules that depend on android.hardware.audio.common directly can include
// the following cc_defaults to avoid explicitly managing dependency versions
// across many scattered files.
cc_defaults {
name: "latest_android_hardware_audio_common_cpp_static",
static_libs: [
latest_android_hardware_audio_common + "-cpp",
],
}
cc_defaults {
name: "latest_android_hardware_audio_common_ndk_static",
static_libs: [
latest_android_hardware_audio_common + "-ndk",
],
}
aidl_interface { aidl_interface {
name: "android.hardware.audio.core", name: "android.hardware.audio.core",
vendor_available: true, vendor_available: true,
@ -80,10 +102,10 @@ aidl_interface {
"android/hardware/audio/core/StreamDescriptor.aidl", "android/hardware/audio/core/StreamDescriptor.aidl",
], ],
imports: [ imports: [
"android.hardware.audio.common-V1",
"android.hardware.common-V2", "android.hardware.common-V2",
"android.hardware.common.fmq-V1", "android.hardware.common.fmq-V1",
"android.media.audio.common.types-V1", "android.hardware.audio.common-V1",
"android.media.audio.common.types-V2",
], ],
stability: "vintf", stability: "vintf",
backend: { backend: {
@ -95,6 +117,30 @@ aidl_interface {
sdk_version: "module_current", sdk_version: "module_current",
}, },
}, },
versions_with_info: [
// IMPORTANT: Update latest_android_hardware_audio_core every time you
// add the latest frozen version to versions_with_info
],
}
// Note: This should always be one version ahead of the last frozen version
latest_android_hardware_audio_core = "android.hardware.audio.core-V1"
// Modules that depend on android.hardware.audio.core directly can include
// the following cc_defaults to avoid explicitly managing dependency versions
// across many scattered files.
cc_defaults {
name: "latest_android_hardware_audio_core_ndk_shared",
shared_libs: [
latest_android_hardware_audio_core + "-ndk",
],
}
cc_defaults {
name: "latest_android_hardware_audio_core_ndk_static",
static_libs: [
latest_android_hardware_audio_core + "-ndk",
],
} }
aidl_interface { aidl_interface {
@ -106,7 +152,7 @@ aidl_interface {
], ],
imports: [ imports: [
"android.hardware.audio.common-V1", "android.hardware.audio.common-V1",
"android.media.audio.common.types-V1", "android.media.audio.common.types-V2",
], ],
stability: "vintf", stability: "vintf",
backend: { backend: {

View file

@ -18,8 +18,6 @@ cc_defaults {
"libfmq", "libfmq",
"libstagefright_foundation", "libstagefright_foundation",
"libutils", "libutils",
"android.media.audio.common.types-V1-ndk",
"android.hardware.audio.core-V1-ndk",
"android.hardware.common-V2-ndk", "android.hardware.common-V2-ndk",
"android.hardware.common.fmq-V1-ndk", "android.hardware.common.fmq-V1-ndk",
], ],
@ -27,7 +25,11 @@ cc_defaults {
cc_library_static { cc_library_static {
name: "libaudioserviceexampleimpl", name: "libaudioserviceexampleimpl",
defaults: ["aidlaudioservice_defaults"], defaults: [
"aidlaudioservice_defaults",
"latest_android_media_audio_common_types_ndk_shared",
"latest_android_hardware_audio_core_ndk_shared",
],
export_include_dirs: ["include"], export_include_dirs: ["include"],
srcs: [ srcs: [
"Config.cpp", "Config.cpp",
@ -45,7 +47,11 @@ cc_binary {
relative_install_path: "hw", relative_install_path: "hw",
init_rc: ["android.hardware.audio.service-aidl.example.rc"], init_rc: ["android.hardware.audio.service-aidl.example.rc"],
vintf_fragments: ["android.hardware.audio.service-aidl.xml"], vintf_fragments: ["android.hardware.audio.service-aidl.xml"],
defaults: ["aidlaudioservice_defaults"], defaults: [
"aidlaudioservice_defaults",
"latest_android_media_audio_common_types_ndk_shared",
"latest_android_hardware_audio_core_ndk_shared",
],
static_libs: [ static_libs: [
"libaudioserviceexampleimpl", "libaudioserviceexampleimpl",
], ],
@ -54,11 +60,13 @@ cc_binary {
cc_defaults { cc_defaults {
name: "aidlaudioeffectservice_defaults", name: "aidlaudioeffectservice_defaults",
defaults: [
"latest_android_media_audio_common_types_ndk_shared",
],
vendor: true, vendor: true,
shared_libs: [ shared_libs: [
"libbase", "libbase",
"libbinder_ndk", "libbinder_ndk",
"android.media.audio.common.types-V1-ndk",
"android.hardware.audio.effect-V1-ndk", "android.hardware.audio.effect-V1-ndk",
], ],
cflags: [ cflags: [

View file

@ -12,6 +12,9 @@ cc_test {
defaults: [ defaults: [
"VtsHalTargetTestDefaults", "VtsHalTargetTestDefaults",
"use_libaidlvintf_gtest_helper_static", "use_libaidlvintf_gtest_helper_static",
"latest_android_hardware_audio_common_ndk_static",
"latest_android_hardware_audio_core_ndk_static",
"latest_android_media_audio_common_types_ndk_static",
], ],
shared_libs: [ shared_libs: [
"libbinder_ndk", "libbinder_ndk",
@ -19,11 +22,8 @@ cc_test {
"libfmq", "libfmq",
], ],
static_libs: [ static_libs: [
"android.hardware.audio.common-V1-ndk",
"android.hardware.audio.core-V1-ndk",
"android.hardware.common-V2-ndk", "android.hardware.common-V2-ndk",
"android.hardware.common.fmq-V1-ndk", "android.hardware.common.fmq-V1-ndk",
"android.media.audio.common.types-V1-ndk",
"libaudioaidlcommon", "libaudioaidlcommon",
], ],
cflags: [ cflags: [
@ -45,6 +45,7 @@ cc_test {
cc_test { cc_test {
name: "VtsHalAudioEffectTargetTest", name: "VtsHalAudioEffectTargetTest",
defaults: [ defaults: [
"latest_android_media_audio_common_types_ndk_static",
"VtsHalTargetTestDefaults", "VtsHalTargetTestDefaults",
"use_libaidlvintf_gtest_helper_static", "use_libaidlvintf_gtest_helper_static",
], ],
@ -55,7 +56,6 @@ cc_test {
"libbinder_ndk", "libbinder_ndk",
], ],
static_libs: [ static_libs: [
"android.media.audio.common.types-V1-ndk",
"android.hardware.audio.effect-V1-ndk", "android.hardware.audio.effect-V1-ndk",
], ],
cflags: [ cflags: [

View file

@ -49,7 +49,10 @@ cc_defaults {
cc_test { cc_test {
name: "VtsHalAudioV2_0TargetTest", name: "VtsHalAudioV2_0TargetTest",
defaults: ["VtsHalAudioTargetTest_defaults"], defaults: [
"VtsHalAudioTargetTest_defaults",
"latest_android_media_audio_common_types_cpp_static",
],
tidy_timeout_srcs: [ tidy_timeout_srcs: [
"2.0/AudioPrimaryHidlHalTest.cpp", "2.0/AudioPrimaryHidlHalTest.cpp",
], ],
@ -62,7 +65,6 @@ cc_test {
"libmedia_helper", "libmedia_helper",
"android.hardware.audio@2.0", "android.hardware.audio@2.0",
"android.hardware.audio.common@2.0", "android.hardware.audio.common@2.0",
"android.media.audio.common.types-V1-cpp",
], ],
cflags: [ cflags: [
"-DMAJOR_VERSION=2", "-DMAJOR_VERSION=2",
@ -79,7 +81,10 @@ cc_test {
cc_test { cc_test {
name: "VtsHalAudioV4_0TargetTest", name: "VtsHalAudioV4_0TargetTest",
defaults: ["VtsHalAudioTargetTest_defaults"], defaults: [
"VtsHalAudioTargetTest_defaults",
"latest_android_media_audio_common_types_cpp_static",
],
tidy_timeout_srcs: [ tidy_timeout_srcs: [
"4.0/AudioPrimaryHidlHalTest.cpp", "4.0/AudioPrimaryHidlHalTest.cpp",
], ],
@ -92,7 +97,6 @@ cc_test {
"libmedia_helper", "libmedia_helper",
"android.hardware.audio@4.0", "android.hardware.audio@4.0",
"android.hardware.audio.common@4.0", "android.hardware.audio.common@4.0",
"android.media.audio.common.types-V1-cpp",
], ],
cflags: [ cflags: [
"-DMAJOR_VERSION=4", "-DMAJOR_VERSION=4",
@ -109,7 +113,10 @@ cc_test {
cc_test { cc_test {
name: "VtsHalAudioV5_0TargetTest", name: "VtsHalAudioV5_0TargetTest",
defaults: ["VtsHalAudioTargetTest_defaults"], defaults: [
"VtsHalAudioTargetTest_defaults",
"latest_android_media_audio_common_types_cpp_static",
],
srcs: [ srcs: [
"5.0/AudioPrimaryHidlHalTest.cpp", "5.0/AudioPrimaryHidlHalTest.cpp",
], ],
@ -119,7 +126,6 @@ cc_test {
"libmedia_helper", "libmedia_helper",
"android.hardware.audio@5.0", "android.hardware.audio@5.0",
"android.hardware.audio.common@5.0", "android.hardware.audio.common@5.0",
"android.media.audio.common.types-V1-cpp",
], ],
cflags: [ cflags: [
"-DMAJOR_VERSION=5", "-DMAJOR_VERSION=5",
@ -136,7 +142,10 @@ cc_test {
cc_test { cc_test {
name: "VtsHalAudioV6_0TargetTest", name: "VtsHalAudioV6_0TargetTest",
defaults: ["VtsHalAudioTargetTest_defaults"], defaults: [
"VtsHalAudioTargetTest_defaults",
"latest_android_media_audio_common_types_cpp_static",
],
tidy_timeout_srcs: [ tidy_timeout_srcs: [
"6.0/AudioPrimaryHidlHalTest.cpp", "6.0/AudioPrimaryHidlHalTest.cpp",
], ],
@ -150,7 +159,6 @@ cc_test {
"libmedia_helper", "libmedia_helper",
"android.hardware.audio@6.0", "android.hardware.audio@6.0",
"android.hardware.audio.common@6.0", "android.hardware.audio.common@6.0",
"android.media.audio.common.types-V1-cpp",
], ],
cflags: [ cflags: [
"-DMAJOR_VERSION=6", "-DMAJOR_VERSION=6",
@ -244,7 +252,10 @@ cc_test {
cc_test { cc_test {
name: "HalAudioV6_0GeneratorTest", name: "HalAudioV6_0GeneratorTest",
defaults: ["VtsHalAudioTargetTest_defaults"], defaults: [
"VtsHalAudioTargetTest_defaults",
"latest_android_media_audio_common_types_cpp_static",
],
srcs: [ srcs: [
"6.0/Generators.cpp", "6.0/Generators.cpp",
"tests/generators_tests.cpp", "tests/generators_tests.cpp",
@ -252,7 +263,6 @@ cc_test {
static_libs: [ static_libs: [
"android.hardware.audio@6.0", "android.hardware.audio@6.0",
"android.hardware.audio.common@6.0", "android.hardware.audio.common@6.0",
"android.media.audio.common.types-V1-cpp",
"libaudiofoundation", "libaudiofoundation",
"libaudiopolicycomponents", "libaudiopolicycomponents",
"libmedia_helper", "libmedia_helper",

View file

@ -15,7 +15,7 @@ aidl_interface {
srcs: ["android/hardware/automotive/audiocontrol/*.aidl"], srcs: ["android/hardware/automotive/audiocontrol/*.aidl"],
imports: [ imports: [
"android.hardware.audio.common-V1", "android.hardware.audio.common-V1",
"android.media.audio.common.types-V1", "android.media.audio.common.types-V2",
], ],
stability: "vintf", stability: "vintf",
backend: { backend: {
@ -33,14 +33,14 @@ aidl_interface {
version: "1", version: "1",
imports: [ imports: [
"android.hardware.audio.common-V1", "android.hardware.audio.common-V1",
"android.media.audio.common.types-V1", "android.media.audio.common.types-V2",
], ],
}, },
{ {
version: "2", version: "2",
imports: [ imports: [
"android.hardware.audio.common-V1", "android.hardware.audio.common-V1",
"android.media.audio.common.types-V1", "android.media.audio.common.types-V2",
], ],
}, },

View file

@ -24,6 +24,8 @@ package {
cc_test { cc_test {
name: "VtsAidlHalAudioControlTest", name: "VtsAidlHalAudioControlTest",
defaults: [ defaults: [
"latest_android_media_audio_common_types_cpp_static",
"latest_android_hardware_audio_common_cpp_static",
"VtsHalTargetTestDefaults", "VtsHalTargetTestDefaults",
"use_libaidlvintf_gtest_helper_static", "use_libaidlvintf_gtest_helper_static",
], ],
@ -38,8 +40,6 @@ cc_test {
], ],
static_libs: [ static_libs: [
"android.hardware.automotive.audiocontrol-V2-cpp", "android.hardware.automotive.audiocontrol-V2-cpp",
"android.hardware.audio.common-V1-cpp",
"android.media.audio.common.types-V1-cpp",
"libgmock", "libgmock",
], ],
test_suites: [ test_suites: [

View file

@ -39,6 +39,20 @@ aidl_interface {
version: "1", version: "1",
imports: ["android.media.soundtrigger.types-V1"], imports: ["android.media.soundtrigger.types-V1"],
}, },
// IMPORTANT: Update latest_android_hardware_soundtrigger3 every time
// you add the latest frozen version to versions_with_info
],
}
// Note: This should always be one version ahead of the last frozen version
latest_android_hardware_soundtrigger3 = "android.hardware.soundtrigger3-V1"
// Modules that depend on android.hardware.soundtrigger3 directly can include
// the following java_defaults to avoid explicitly managing dependency versions
// across many scattered files.
java_defaults {
name: "latest_android_hardware_soundtrigger3_java_static",
static_libs: [
latest_android_hardware_soundtrigger3 + "-java",
], ],
} }