mirror of
https://github.com/yurisieucuti/treble_evolution.git
synced 2024-11-24 10:56:22 +00:00
47 lines
2.0 KiB
Diff
47 lines
2.0 KiB
Diff
From 26f0d5872f00909a13add9bebe18ae51e86b8b46 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/25] 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 5f14ee4623..166ab7acbb 100644
|
|
--- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
|
|
+++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
|
|
@@ -318,6 +318,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.25.1
|
|
|