mirror of
https://github.com/ponces/treble_aosp.git
synced 2024-11-22 06:36:13 +00:00
47 lines
2.0 KiB
Diff
47 lines
2.0 KiB
Diff
From d9af5eff09ab05b8c81c52077e1017ef0c381aab 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 08/24] There are three SCO devices. Fallback from one to the
|
|
others if needed
|
|
|
|
Change-Id: I414dcb6b154855c00cb8520b23dc1069827864b2
|
|
---
|
|
.../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 6696b45f03..3ea185d873 100644
|
|
--- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
|
|
+++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
|
|
@@ -321,6 +321,27 @@ sp<HwModule> HwModuleCollection::getModuleForDeviceType(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 = getModuleForDeviceType(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 = getModuleForDeviceType(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 = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT, encodedFormat);
|
|
+ ALOGE("Fallback SCO carkit? %s", (ret != nullptr) ? "yes" : "no");
|
|
+ if(ret != nullptr) return ret;
|
|
+ }
|
|
+ }
|
|
return nullptr;
|
|
}
|
|
|
|
--
|
|
2.34.1
|
|
|