Merge "audio: hal: update proper return value"
diff --git a/configs/lahaina/audio_io_policy.conf b/configs/lahaina/audio_io_policy.conf
index 0932e44..7c53b2e 100644
--- a/configs/lahaina/audio_io_policy.conf
+++ b/configs/lahaina/audio_io_policy.conf
@@ -26,7 +26,7 @@
app_type 69943
}
voip_rx {
- flags AUDIO_OUTPUT_FLAG_VOIP_RX|AUDIO_OUTPUT_FLAG_DIRECT
+ flags AUDIO_OUTPUT_FLAG_VOIP_RX
formats AUDIO_FORMAT_PCM_16_BIT
sampling_rates 8000|16000|32000|48000
bit_width 16
diff --git a/configs/lahaina/audio_policy_configuration.xml b/configs/lahaina/audio_policy_configuration.xml
index d205882..e9ff009 100644
--- a/configs/lahaina/audio_policy_configuration.xml
+++ b/configs/lahaina/audio_policy_configuration.xml
@@ -20,7 +20,7 @@
<!--
Changes from Qualcomm Innovation Center are provided under the following license:
-Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
@@ -195,7 +195,7 @@
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="voip_rx" role="source"
- flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX">
+ flags="AUDIO_OUTPUT_FLAG_VOIP_RX">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
diff --git a/configs/sdm660/audio_output_policy.conf b/configs/sdm660/audio_output_policy.conf
index 921c8b8..419089c 100644
--- a/configs/sdm660/audio_output_policy.conf
+++ b/configs/sdm660/audio_output_policy.conf
@@ -19,7 +19,7 @@
app_type 69937
}
voip_rx {
- flags AUDIO_OUTPUT_FLAG_VOIP_RX|AUDIO_OUTPUT_FLAG_DIRECT
+ flags AUDIO_OUTPUT_FLAG_VOIP_RX
formats AUDIO_FORMAT_PCM_16_BIT
sampling_rates 8000|16000|32000|48000
bit_width 16
diff --git a/configs/sdm660/audio_policy_configuration.xml b/configs/sdm660/audio_policy_configuration.xml
index 5a25dad..8440944 100644
--- a/configs/sdm660/audio_policy_configuration.xml
+++ b/configs/sdm660/audio_policy_configuration.xml
@@ -20,7 +20,7 @@
<!--
Changes from Qualcomm Innovation Center are provided under the following license:
-Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
@@ -187,7 +187,7 @@
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="voip_rx" role="source"
- flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX">
+ flags="AUDIO_OUTPUT_FLAG_VOIP_RX">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
diff --git a/configure.ac b/configure.ac
index 8c318df..7fc0d3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,7 @@
[qrbx210], [TARGET_SUPPORT=qrbx210],
[qrb5165], [TARGET_SUPPORT=qrb5165],
[sdmsteppe], [TARGET_SUPPORT=sdmsteppe],
+ [qcs6490], [TARGET_SUPPORT=qcs6490],
[TARGET_SUPPORT=none])],
[TARGET_SUPPORT=none]
)
@@ -129,6 +130,12 @@
TARGET_CFLAGS+=" -DMAX_TARGET_SPECIFIC_CHANNEL_CNT=\"4\""
TARGET_CFLAGS+=" -DINCALL_STEREO_CAPTURE_ENABLED"
fi
+if (test x$TARGET_SUPPORT = xqcs6490); then
+ AC_SUBST([TARGET_PLATFORM], ["msm8974"])
+ TARGET_CFLAGS=" -DPLATFORM_LAHAINA"
+ TARGET_CFLAGS+=" -DMAX_TARGET_SPECIFIC_CHANNEL_CNT=\"4\""
+ TARGET_CFLAGS+=" -DINCALL_STEREO_CAPTURE_ENABLED"
+fi
if (test x$TARGET_SUPPORT = xmsmnile_au); then
AC_SUBST([TARGET_PLATFORM], ["msm8974"])
TARGET_CFLAGS="-DPLATFORM_MSMNILE"
diff --git a/post_proc/bundle.c b/post_proc/bundle.c
index 0dbf27b..a9f95b9 100644
--- a/post_proc/bundle.c
+++ b/post_proc/bundle.c
@@ -2,6 +2,8 @@
* Copyright (c) 2013-2017, 2019, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ *
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -847,7 +849,8 @@
pReplyData == NULL ||
*replySize < (int)(sizeof(effect_param_t) + sizeof(uint32_t) + sizeof(uint16_t)) ||
// constrain memcpy below
- ((effect_param_t *)pCmdData)->psize > *replySize - sizeof(effect_param_t)) {
+ ((effect_param_t *)pCmdData)->psize > *replySize - sizeof(effect_param_t) ||
+ ((effect_param_t *)pCmdData)->psize > cmdSize - sizeof(effect_param_t)) {
status = -EINVAL;
ALOGW("EFFECT_CMD_GET_PARAM invalid command cmdSize %d *replySize %d",
cmdSize, *replySize);
diff --git a/post_proc/volume_listener.c b/post_proc/volume_listener.c
index 65575bc..cb8b02b 100644
--- a/post_proc/volume_listener.c
+++ b/post_proc/volume_listener.c
@@ -1,5 +1,7 @@
/*
* Copyright (c) 2015-2017, 2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ *
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -559,7 +561,7 @@
bool recompute_gain_dep_cal_Level = false;
ALOGV("cmd called EFFECT_CMD_SET_DEVICE ");
- if (p_cmd_data == NULL) {
+ if (p_cmd_data == NULL || cmd_size < sizeof(uint32_t)) {
ALOGE("%s: EFFECT_CMD_SET_DEVICE: cmd data NULL", __func__);
status = -EINVAL;
goto exit;
diff --git a/visualizer/offload_visualizer.c b/visualizer/offload_visualizer.c
index 65b5938..e2b6f59 100644
--- a/visualizer/offload_visualizer.c
+++ b/visualizer/offload_visualizer.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013 The Android Open Source Project
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1321,7 +1322,10 @@
if (pCmdData == NULL ||
cmdSize != (int)(sizeof(effect_param_t) + sizeof(uint32_t)) ||
pReplyData == NULL ||
- *replySize < (int)(sizeof(effect_param_t) + sizeof(uint32_t) + sizeof(uint32_t))) {
+ *replySize < (int)(sizeof(effect_param_t) + sizeof(uint32_t) + sizeof(uint32_t)) ||
+ // constrain memcpy below
+ ((effect_param_t *)pCmdData)->psize > *replySize - sizeof(effect_param_t) ||
+ ((effect_param_t *)pCmdData)->psize > cmdSize - sizeof(effect_param_t)) {
status = -EINVAL;
goto exit;
}
diff --git a/voice_processing/voice_processing.c b/voice_processing/voice_processing.c
index 50cb7af..2847c90 100644
--- a/voice_processing/voice_processing.c
+++ b/voice_processing/voice_processing.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013 The Android Open Source Project
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -582,7 +583,8 @@
pReplyData == NULL ||
*replySize < (int)sizeof(effect_param_t) ||
// constrain memcpy below
- ((effect_param_t *)pCmdData)->psize > *replySize - sizeof(effect_param_t)) {
+ ((effect_param_t *)pCmdData)->psize > *replySize - sizeof(effect_param_t) ||
+ ((effect_param_t *)pCmdData)->psize > cmdSize - sizeof(effect_param_t)) {
ALOGV("fx_command() EFFECT_CMD_GET_PARAM invalid args");
return -EINVAL;
}