skip automatic audio device selection when BT is available
This commit is contained in:
parent
a78747eaa2
commit
21b8bf424a
|
@ -159,14 +159,15 @@ public class CallIntegration extends Connection {
|
||||||
|
|
||||||
public void setAudioDeviceWhenAvailable(final AudioDevice audioDevice) {
|
public void setAudioDeviceWhenAvailable(final AudioDevice audioDevice) {
|
||||||
final var available = getAudioDevices();
|
final var available = getAudioDevices();
|
||||||
if (available.contains(audioDevice)) {
|
if (available.contains(audioDevice) && !available.contains(AudioDevice.BLUETOOTH)) {
|
||||||
this.setAudioDevice(audioDevice);
|
this.setAudioDevice(audioDevice);
|
||||||
} else {
|
} else {
|
||||||
Log.d(
|
Log.d(
|
||||||
Config.LOGTAG,
|
Config.LOGTAG,
|
||||||
"application requested to switch to "
|
"application requested to switch to "
|
||||||
+ audioDevice
|
+ audioDevice
|
||||||
+ " but device was not available");
|
+ " but we won't because available devices are "
|
||||||
|
+ available);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,13 +408,14 @@ public class CallIntegration extends Connection {
|
||||||
final Set<CallIntegration.AudioDevice> availableAudioDevices) {
|
final Set<CallIntegration.AudioDevice> availableAudioDevices) {
|
||||||
if (this.initialAudioDevice != null
|
if (this.initialAudioDevice != null
|
||||||
&& this.initialAudioDeviceConfigured.compareAndSet(false, true)) {
|
&& this.initialAudioDeviceConfigured.compareAndSet(false, true)) {
|
||||||
if (availableAudioDevices.contains(this.initialAudioDevice)) {
|
if (availableAudioDevices.contains(this.initialAudioDevice)
|
||||||
|
&& !availableAudioDevices.contains(AudioDevice.BLUETOOTH)) {
|
||||||
setAudioDevice(this.initialAudioDevice);
|
setAudioDevice(this.initialAudioDevice);
|
||||||
Log.d(Config.LOGTAG, "configured initial audio device");
|
Log.d(Config.LOGTAG, "configured initial audio device");
|
||||||
} else {
|
} else {
|
||||||
Log.d(
|
Log.d(
|
||||||
Config.LOGTAG,
|
Config.LOGTAG,
|
||||||
"initial audio device not available. available devices: "
|
"not setting initial audio device. available devices: "
|
||||||
+ availableAudioDevices);
|
+ availableAudioDevices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue