lineage_patches_unified/patches/platform_frameworks_av/0014-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch
Andy CrossGate Yan 79b5b414a7 Regenerate patches
frameworks/base got too messy, time to clean it up
2021-02-14 10:41:04 +00:00

46 lines
2.0 KiB
Diff

From e17862fc2b519ccddf7d578968a89f35ceaacfb1 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 13 Apr 2020 21:01:16 +0200
Subject: [PATCH 14/17] There are three SCO devices. Fallback from one to the
others if needed
---
.../managerdefinitions/src/HwModule.cpp | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
index 1f9b725a2..ecba6023d 100644
--- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
@@ -294,6 +294,27 @@ sp <HwModule> HwModuleCollection::getModuleForDeviceTypes(audio_devices_t type,
}
}
}
+ //We didn't find one? Ok but all SCOs are equivalent surely?
+ if(type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO ||
+ type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET ||
+ type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
+ ALOGE("Fallback SCO");
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO) {
+ auto ret = getModuleForDeviceTypes(AUDIO_DEVICE_OUT_BLUETOOTH_SCO, encodedFormat);
+ ALOGE("Fallback SCO simple? %s", (ret != nullptr) ? "yes" : "no");
+ if(ret != nullptr) return ret;
+ }
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET) {
+ auto ret = getModuleForDeviceTypes(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, encodedFormat);
+ ALOGE("Fallback SCO headset? %s", (ret != nullptr) ? "yes" : "no");
+ if(ret != nullptr) return ret;
+ }
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
+ auto ret = getModuleForDeviceTypes(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT, encodedFormat);
+ ALOGE("Fallback SCO carkit? %s", (ret != nullptr) ? "yes" : "no");
+ if(ret != nullptr) return ret;
+ }
+ }
return nullptr;
}
--
2.25.1