From 4fe8021f0986b5a2ed2e5580beea66e42004a2da Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Thu, 16 May 2024 18:32:03 -0700 Subject: [PATCH] bluetooth: Add 'defaults' for 'android_hardware_bluetooth_audio' Add defaults for the case when the library is used from within 'target/android'. Also, switch 'BluetoothLeAudioCodecsProviderTest' to use 'defaults' instead of hardcoding the interface module version. Bug: 307310023 Test: m Change-Id: I7e5e70efe6a733367a8b5cbe5cffbfddf610cc6b --- bluetooth/audio/aidl/Android.bp | 22 ++++++++++++++++++++++ bluetooth/audio/utils/Android.bp | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/bluetooth/audio/aidl/Android.bp b/bluetooth/audio/aidl/Android.bp index feed6f55ca..995426ceb1 100644 --- a/bluetooth/audio/aidl/Android.bp +++ b/bluetooth/audio/aidl/Android.bp @@ -97,3 +97,25 @@ cc_defaults { latest_android_hardware_bluetooth_audio + "-ndk", ], } + +cc_defaults { + name: "latest_android_hardware_bluetooth_audio_ndk_android_shared", + target: { + android: { + shared_libs: [ + latest_android_hardware_bluetooth_audio + "-ndk", + ], + }, + }, +} + +cc_defaults { + name: "latest_android_hardware_bluetooth_audio_ndk_android_static", + target: { + android: { + static_libs: [ + latest_android_hardware_bluetooth_audio + "-ndk", + ], + }, + }, +} diff --git a/bluetooth/audio/utils/Android.bp b/bluetooth/audio/utils/Android.bp index 779a90f69a..16613627e1 100644 --- a/bluetooth/audio/utils/Android.bp +++ b/bluetooth/audio/utils/Android.bp @@ -90,6 +90,9 @@ cc_library_shared { cc_test { name: "BluetoothLeAudioCodecsProviderTest", + defaults: [ + "latest_android_hardware_bluetooth_audio_ndk_shared", + ], srcs: [ "aidl_session/BluetoothLeAudioCodecsProvider.cpp", "aidl_session/BluetoothLeAudioCodecsProviderTest.cpp", @@ -100,7 +103,6 @@ cc_test { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.bluetooth.audio-V4-ndk", "libxml2", ], test_suites: [