Merge "hal: Add runtime based flag “ro.boot.audio” property"
diff --git a/hal/audio_extn/a2dp.c b/hal/audio_extn/a2dp.c
index 8665d88..17190e9 100644
--- a/hal/audio_extn/a2dp.c
+++ b/hal/audio_extn/a2dp.c
@@ -187,6 +187,8 @@
static void *vndk_fwk_lib_handle = NULL;
static int is_running_with_enhanced_fwk = UNINITIALIZED;
+static char g_audio_framework[PROPERTY_VALUE_MAX];
+
typedef int (*vndk_fwk_isVendorEnhancedFwk_t)(void);
static vndk_fwk_isVendorEnhancedFwk_t vndk_fwk_isVendorEnhancedFwk;
@@ -935,9 +937,16 @@
static void update_offload_codec_capabilities()
{
- a2dp.is_a2dp_offload_supported =
+ property_get("ro.boot.audio", g_audio_framework, NULL);
+
+ if (strstr(g_audio_framework, "audioreach") != NULL) {
+ a2dp.is_a2dp_offload_supported =
property_get_bool(SYSPROP_A2DP_OFFLOAD_SUPPORTED, false) &&
!property_get_bool(SYSPROP_A2DP_OFFLOAD_DISABLED, false);
+ } else {
+ /*For Elite audio framework */
+ a2dp.is_a2dp_offload_supported = true;
+ }
ALOGD("%s: A2DP offload supported = %d",__func__,
a2dp.is_a2dp_offload_supported);