From 411edccbb3f1e44afa0c3b436bd711997f64343d Mon Sep 17 00:00:00 2001 From: Roman Kiryanov Date: Sat, 18 Jul 2020 20:23:44 -0700 Subject: [PATCH] Provide defaults for android.hardware.audio@6.0-impl This will allow vendors to create instances of this library with other names. A different name is required if a vendor wants to provide a custom version (e.g. in HIDL) of android.hardware.audio@6.0-impl and still be able to use the library itself (e.g. to load audio.r_submix.default) - android.hardware.audio.service does not load both libraries and prefers the default one. Bug: 161485545 Test: boot emulator, check if audio works Signed-off-by: Roman Kiryanov Change-Id: I55c4f9b1386be3464ad0f5f2568423843e7eae88 --- audio/core/all-versions/default/Android.bp | 38 +++++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/audio/core/all-versions/default/Android.bp b/audio/core/all-versions/default/Android.bp index 0af81b2bd4..8fdb70d1a2 100644 --- a/audio/core/all-versions/default/Android.bp +++ b/audio/core/all-versions/default/Android.bp @@ -1,8 +1,5 @@ -cc_defaults { - name: "android.hardware.audio-impl_default", - relative_install_path: "hw", - proprietary: true, - vendor: true, +filegroup { + name: "android.hardware.audio-impl_srcs", srcs: [ "Conversions.cpp", "Device.cpp", @@ -13,11 +10,24 @@ cc_defaults { "StreamIn.cpp", "StreamOut.cpp", ], +} + +cc_library_headers { + name: "android.hardware.audio-impl_headers", + proprietary: true, + vendor: true, + export_include_dirs: ["include"], +} + +cc_defaults { + name: "android.hardware.audio-impl_default", + relative_install_path: "hw", + proprietary: true, + vendor: true, + srcs: [":android.hardware.audio-impl_srcs"], defaults: ["hidl_defaults"], - export_include_dirs: ["include"], - static_libs: [ "libaudiofoundation", ], @@ -35,12 +45,17 @@ cc_defaults { ], header_libs: [ + "android.hardware.audio-impl_headers", "android.hardware.audio.common.util@all-versions", "libaudioclient_headers", "libaudio_system_headers", "libhardware_headers", "libmedia_headers", ], + + export_header_lib_headers: [ + "android.hardware.audio-impl_headers", + ], } cc_library_shared { @@ -89,8 +104,8 @@ cc_library_shared { ], } -cc_library_shared { - name: "android.hardware.audio@6.0-impl", +cc_defaults { + name: "android.hardware.audio@6.0-impl_default", defaults: ["android.hardware.audio-impl_default"], shared_libs: [ "android.hardware.audio@6.0", @@ -103,3 +118,8 @@ cc_library_shared { "-include common/all-versions/VersionMacro.h", ], } + +cc_library_shared { + name: "android.hardware.audio@6.0-impl", + defaults: ["android.hardware.audio@6.0-impl_default"], +}