Changes for April 2024
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From b5b0fd54c77d0c5feb3eb20395fa6e2400c41172 Mon Sep 17 00:00:00 2001
|
||||
From c92b1e40a795bf844c6347b454403cc26ff3fbce Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Thu, 18 Aug 2022 15:44:46 -0400
|
||||
Subject: [PATCH 1/3] APM: Restore S, R and Q behavior respectively for
|
||||
@@ -36,12 +36,12 @@ Change-Id: I56d36d2aef4319935cb88a3e4771b23c6d5b2145
|
||||
2 files changed, 147 insertions(+), 62 deletions(-)
|
||||
|
||||
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
||||
index f093e685ba..9a90009f9e 100644
|
||||
index 135548fb9c..fc99bdbd78 100644
|
||||
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
||||
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
||||
@@ -689,6 +689,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
disconnectTelephonyAudioSource(mCallRxSourceClient);
|
||||
disconnectTelephonyAudioSource(mCallTxSourceClient);
|
||||
@@ -692,6 +692,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
ALOGV("%s device rxDevice %s txDevice %s", __func__,
|
||||
rxDevices.itemAt(0)->toString().c_str(), txSourceDevice->toString().c_str());
|
||||
|
||||
+ // release existing RX patch if any
|
||||
+ if (mCallRxPatch != 0) {
|
||||
@@ -57,7 +57,7 @@ index f093e685ba..9a90009f9e 100644
|
||||
auto telephonyRxModule =
|
||||
mHwModules.getModuleForDeviceType(AUDIO_DEVICE_IN_TELEPHONY_RX, AUDIO_FORMAT_DEFAULT);
|
||||
auto telephonyTxModule =
|
||||
@@ -711,9 +722,20 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
@@ -714,9 +725,20 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
ALOGE("%s() no telephony Tx and/or RX device", __func__);
|
||||
return INVALID_OPERATION;
|
||||
}
|
||||
@@ -81,9 +81,9 @@ index f093e685ba..9a90009f9e 100644
|
||||
} else {
|
||||
// If the RX device is on the primary HW module, then use legacy routing method for
|
||||
// voice calls via setOutputDevice() on primary output.
|
||||
@@ -730,7 +752,14 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
if (!createRxPatch) {
|
||||
muteWaitMs = setOutputDevices(mPrimaryOutput, rxDevices, true, delayMs);
|
||||
@@ -737,7 +759,14 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
}
|
||||
muteWaitMs = setOutputDevices(__func__, mPrimaryOutput, rxDevices, true, delayMs);
|
||||
} else { // create RX path audio patch
|
||||
- connectTelephonyRxAudioSource();
|
||||
+ if (property_get_int32("ro.vndk.version", 31) >= 31) {
|
||||
@@ -97,7 +97,7 @@ index f093e685ba..9a90009f9e 100644
|
||||
// If the TX device is on the primary HW module but RX device is
|
||||
// on other HW module, SinkMetaData of telephony input should handle it
|
||||
// assuming the device uses audio HAL V5.0 and above
|
||||
@@ -745,7 +774,12 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
@@ -752,7 +781,12 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
closeActiveClients(activeDesc);
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ index f093e685ba..9a90009f9e 100644
|
||||
}
|
||||
if (waitMs != nullptr) {
|
||||
*waitMs = muteWaitMs;
|
||||
@@ -753,6 +787,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
@@ -760,6 +794,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ index f093e685ba..9a90009f9e 100644
|
||||
bool AudioPolicyManager::isDeviceOfModule(
|
||||
const sp<DeviceDescriptor>& devDesc, const char *moduleId) const {
|
||||
sp<HwModule> module = mHwModules.getModuleFromName(moduleId);
|
||||
@@ -4958,83 +5022,101 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
|
||||
@@ -5087,83 +5151,101 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
|
||||
// in config XML to reach the sink so that is can be declared as available.
|
||||
audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
|
||||
sp<SwAudioOutputDescriptor> outputDesc;
|
||||
@@ -308,10 +308,10 @@ index f093e685ba..9a90009f9e 100644
|
||||
AUDIO_STREAM_PATCH;
|
||||
patchBuilder.addSource(srcMixPortConfig);
|
||||
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
||||
index 88bafefdb1..188b5732b3 100644
|
||||
index a1c8f6202c..ee1b595e30 100644
|
||||
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
||||
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
||||
@@ -953,6 +953,9 @@ protected:
|
||||
@@ -964,6 +964,9 @@ protected:
|
||||
|
||||
SoundTriggerSessionCollection mSoundTriggerSessions;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From cf178b74640512639620ed5f99122407225053f8 Mon Sep 17 00:00:00 2001
|
||||
From ae67c8f78aee3c99ee2c9a8da964ad7b5a0cf30d Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Wed, 24 Aug 2022 15:42:39 -0400
|
||||
Subject: [PATCH 2/3] APM: Optionally force-load audio policy for system-side
|
||||
@@ -14,7 +14,7 @@ Change-Id: I279fff541a531f922f3fa55b8f14d00237db59ff
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
index 3d5c1d2e42..881c188e4c 100644
|
||||
index 6f19a7a145..08836377b7 100644
|
||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
@@ -25,6 +25,7 @@
|
||||
@@ -25,7 +25,7 @@ index 3d5c1d2e42..881c188e4c 100644
|
||||
#include <utils/Log.h>
|
||||
#include <utils/StrongPointer.h>
|
||||
#include <utils/Errors.h>
|
||||
@@ -885,6 +886,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
|
||||
@@ -895,6 +896,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
|
||||
if (status != NO_ERROR) {
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From f792286920c7c2c43758a8e1053bab89948bf305 Mon Sep 17 00:00:00 2001
|
||||
From 33f3d337016bfbc4a7836b504c5baf8ad9130a45 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Thu, 25 Aug 2022 13:30:29 -0400
|
||||
Subject: [PATCH 3/3] APM: Remove A2DP audio ports from the primary HAL
|
||||
@@ -16,7 +16,7 @@ Change-Id: I3305594a17285da113167b419543543f0ef71122
|
||||
1 file changed, 22 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
index 881c188e4c..8519cfdc04 100644
|
||||
index 08836377b7..0f7c903909 100644
|
||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
@@ -26,6 +26,7 @@
|
||||
@@ -40,7 +40,7 @@ index 881c188e4c..8519cfdc04 100644
|
||||
}
|
||||
}
|
||||
if (!xmlStrcmp(cur->name, reinterpret_cast<const xmlChar*>(Trait::tag))) {
|
||||
@@ -679,6 +677,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||
@@ -683,6 +681,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||
ALOGE("%s: No %s found", __func__, Attributes::name);
|
||||
return BAD_VALUE;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ index 881c188e4c..8519cfdc04 100644
|
||||
uint32_t versionMajor = 0, versionMinor = 0;
|
||||
std::string versionLiteral = getXmlAttribute(cur, Attributes::version);
|
||||
if (!versionLiteral.empty()) {
|
||||
@@ -704,6 +703,25 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||
@@ -708,6 +707,25 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||
if (status != NO_ERROR) {
|
||||
return status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user