From 8296aa824b0bd5890866eb3bfa20f1836c48846e Mon Sep 17 00:00:00 2001 From: Lorena Torres-Huerta Date: Mon, 29 Aug 2022 21:48:01 +0000 Subject: [PATCH] Use explicit aidl versions for audio hal and soundtrigger dependencies. There are still issues with importing implicit versions. Switching to explicit versions while b/188871598 is worked out. Bug: 242678729 Test: m; AIDL_TRANSITIVE_FREEZE=true m aidl-freeze-api && AIDL_FROZEN_REL=true m Change-Id: Ide6a90716bf042fbb925357e110bc84ddb9e96fb --- audio/aidl/Android.bp | 19 +++++++++++++------ audio/aidl/default/Android.bp | 4 +++- audio/aidl/vts/Android.bp | 2 +- automotive/audiocontrol/aidl/Android.bp | 6 +++--- automotive/audiocontrol/aidl/vts/Android.bp | 4 ++-- soundtrigger/aidl/Android.bp | 4 ++-- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp index 9c7a6a208a..d4c1e85e91 100644 --- a/audio/aidl/Android.bp +++ b/audio/aidl/Android.bp @@ -33,7 +33,7 @@ aidl_interface { "android/hardware/audio/common/SourceMetadata.aidl", ], imports: [ - "android.media.audio.common.types", + "android.media.audio.common.types-V2", ], stability: "vintf", backend: { @@ -59,7 +59,7 @@ aidl_interface { versions_with_info: [ { 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 @@ -68,11 +68,18 @@ aidl_interface { } // Note: This should always be one version ahead of the last frozen version -latest_android_hardware_audio_common = "android.hardware.audio.common-V2" +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: [ @@ -97,8 +104,8 @@ aidl_interface { imports: [ "android.hardware.common-V2", "android.hardware.common.fmq-V1", - "android.hardware.audio.common", - "android.media.audio.common.types", + "android.hardware.audio.common-V1", + "android.media.audio.common.types-V2", ], stability: "vintf", backend: { @@ -145,7 +152,7 @@ aidl_interface { ], imports: [ "android.hardware.audio.common-V1", - "android.media.audio.common.types-V1", + "android.media.audio.common.types-V2", ], stability: "vintf", backend: { diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp index 6225fb3d66..5d63347569 100644 --- a/audio/aidl/default/Android.bp +++ b/audio/aidl/default/Android.bp @@ -60,11 +60,13 @@ cc_binary { cc_defaults { name: "aidlaudioeffectservice_defaults", + defaults: [ + "latest_android_media_audio_common_types_ndk_shared", + ], vendor: true, shared_libs: [ "libbase", "libbinder_ndk", - "android.media.audio.common.types-V1-ndk", "android.hardware.audio.effect-V1-ndk", ], cflags: [ diff --git a/audio/aidl/vts/Android.bp b/audio/aidl/vts/Android.bp index 2e12e7e334..6ea7cef0e2 100644 --- a/audio/aidl/vts/Android.bp +++ b/audio/aidl/vts/Android.bp @@ -45,6 +45,7 @@ cc_test { cc_test { name: "VtsHalAudioEffectTargetTest", defaults: [ + "latest_android_media_audio_common_types_ndk_static", "VtsHalTargetTestDefaults", "use_libaidlvintf_gtest_helper_static", ], @@ -55,7 +56,6 @@ cc_test { "libbinder_ndk", ], static_libs: [ - "android.media.audio.common.types-V1-ndk", "android.hardware.audio.effect-V1-ndk", ], cflags: [ diff --git a/automotive/audiocontrol/aidl/Android.bp b/automotive/audiocontrol/aidl/Android.bp index e5f7a4f8c1..03dab08f1f 100644 --- a/automotive/audiocontrol/aidl/Android.bp +++ b/automotive/audiocontrol/aidl/Android.bp @@ -15,7 +15,7 @@ aidl_interface { srcs: ["android/hardware/automotive/audiocontrol/*.aidl"], imports: [ "android.hardware.audio.common-V1", - "android.media.audio.common.types-V1", + "android.media.audio.common.types-V2", ], stability: "vintf", backend: { @@ -33,14 +33,14 @@ aidl_interface { version: "1", imports: [ "android.hardware.audio.common-V1", - "android.media.audio.common.types-V1", + "android.media.audio.common.types-V2", ], }, { version: "2", imports: [ "android.hardware.audio.common-V1", - "android.media.audio.common.types-V1", + "android.media.audio.common.types-V2", ], }, diff --git a/automotive/audiocontrol/aidl/vts/Android.bp b/automotive/audiocontrol/aidl/vts/Android.bp index 3d4be4828f..edac160e77 100644 --- a/automotive/audiocontrol/aidl/vts/Android.bp +++ b/automotive/audiocontrol/aidl/vts/Android.bp @@ -24,6 +24,8 @@ package { cc_test { name: "VtsAidlHalAudioControlTest", defaults: [ + "latest_android_media_audio_common_types_cpp_static", + "latest_android_hardware_audio_common_cpp_static", "VtsHalTargetTestDefaults", "use_libaidlvintf_gtest_helper_static", ], @@ -38,8 +40,6 @@ cc_test { ], static_libs: [ "android.hardware.automotive.audiocontrol-V2-cpp", - "android.hardware.audio.common-V1-cpp", - "android.media.audio.common.types-V1-cpp", "libgmock", ], test_suites: [ diff --git a/soundtrigger/aidl/Android.bp b/soundtrigger/aidl/Android.bp index 426bf48e2f..27d43d3fc3 100644 --- a/soundtrigger/aidl/Android.bp +++ b/soundtrigger/aidl/Android.bp @@ -23,7 +23,7 @@ aidl_interface { ], stability: "vintf", imports: [ - "android.media.soundtrigger.types", + "android.media.soundtrigger.types-V1", ], backend: { cpp: { @@ -45,7 +45,7 @@ aidl_interface { } // Note: This should always be one version ahead of the last frozen version -latest_android_hardware_soundtrigger3 = "android.hardware.soundtrigger3-V2" +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