Merge tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' into staging/lineage-21.0_merge-LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0

"LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0"

# By Kumar Anurag Singh (2) and others
# Via Linux Build Service Account (2) and others
* tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0':
  hal: Add runtime based flag “ro.boot.audio” property
  audio-effects: Fix out-of-bound read
  hal: kona: Fix playback for 32bit float file.
  config: Add the audiolite application to MM_AUDIO
  audio-hal: Enable AUDIO_FEATURE_ENABLED_DAEMON_SUPPORT for msmnile_gvmq_s_u

Change-Id: I4b1fb7f5236392125b69c1db409305c9f0e6102b
diff --git a/configs/audio_vendor_product.mk b/configs/audio_vendor_product.mk
index 32fbcb4..5ff7b05 100644
--- a/configs/audio_vendor_product.mk
+++ b/configs/audio_vendor_product.mk
@@ -7,6 +7,7 @@
 
 ifeq ($(TARGET_USES_AUDIOLITE),true)
 AUDIO_USE_STUB_HAL := true
+MM_AUDIO += audiolite
 endif #ends TARGET_USES_AUDIOLITE
 
 #MM_AUDIO product packages
diff --git a/configs/msmnile_au/msmnile_au.mk b/configs/msmnile_au/msmnile_au.mk
index a094b7c..c0ed2d4 100644
--- a/configs/msmnile_au/msmnile_au.mk
+++ b/configs/msmnile_au/msmnile_au.mk
@@ -140,7 +140,7 @@
 ifneq ( ,$(filter T Tiramisu 13 U UpsideDownCake 14, $(PLATFORM_VERSION)))
 AUDIO_FEATURE_ENABLED_POWER_POLICY := true
 endif
-ifneq ( ,$(filter msmnile_gvmq msmnile_au gen4_au msmnile_au_km4 msmnile_au_ar msmnile_gvmq_vcu, $(TARGET_BOARD_PLATFORM)$(TARGET_BOARD_SUFFIX)$(TARGET_BOARD_DERIVATIVE_SUFFIX)))
+ifneq ( ,$(filter msmnile_gvmq msmnile_au gen4_au msmnile_au_km4 msmnile_au_ar msmnile_gvmq_vcu msmnile_gvmq_s_u, $(TARGET_BOARD_PLATFORM)$(TARGET_BOARD_SUFFIX)$(TARGET_BOARD_DERIVATIVE_SUFFIX)))
 AUDIO_FEATURE_ENABLED_AUDIO_PARSERS := true
 endif
 ifneq ( ,$(filter msmnile_tb, $(TARGET_PRODUCT)))
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);
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index ac51da0..eaf46e7 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -8358,7 +8358,8 @@
 
     if (direct_dev &&
         (audio_is_linear_pcm(out->format) ||
-         config->format == AUDIO_FORMAT_DEFAULT)) {
+         config->format == AUDIO_FORMAT_DEFAULT) &&
+        out->flags == AUDIO_OUTPUT_FLAG_NONE) {
         audio_format_t req_format = config->format;
         audio_channel_mask_t req_channel_mask = config->channel_mask;
         uint32_t req_sample_rate = config->sample_rate;
diff --git a/post_proc/equalizer.c b/post_proc/equalizer.c
index a2e69b0..fe188c7 100644
--- a/post_proc/equalizer.c
+++ b/post_proc/equalizer.c
@@ -15,6 +15,11 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
+ * Changes from Qualcomm Innovation Center, Inc. are provided under the following license:
+ * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause-Clear
+ *
  */
 
 #define LOG_TAG "offload_effect_equalizer"
@@ -425,7 +430,7 @@
         equalizer_set_preset(eq_ctxt, preset);
         break;
     case EQ_PARAM_BAND_LEVEL:
-        if (vsize < sizeof(int16_t)) {
+        if (vsize < sizeof(int32_t)) {
             p->status = -EINVAL;
             break;
         }