mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Hide call audio devices that are not of known type.
This commit is contained in:
@@ -30,7 +30,7 @@ class WebRtcAudioPicker31(private val audioOutputChangedListener: OnAudioOutputC
|
||||
return null
|
||||
}
|
||||
|
||||
val devices: List<AudioOutputOption> = am.availableCommunicationDevices.map { AudioOutputOption(it.toFriendlyName(fragmentActivity).toString(), AudioDeviceMapping.fromPlatformType(it.type), it.id) }.distinct()
|
||||
val devices: List<AudioOutputOption> = am.availableCommunicationDevices.map { AudioOutputOption(it.toFriendlyName(fragmentActivity).toString(), AudioDeviceMapping.fromPlatformType(it.type), it.id) }.distinct().filterNot { it.deviceType == SignalAudioManager.AudioDevice.NONE }
|
||||
val currentDeviceId = am.communicationDevice?.id ?: -1
|
||||
if (devices.size < threshold) {
|
||||
Log.d(TAG, "Only found $devices devices,\nnot showing picker.")
|
||||
@@ -75,6 +75,7 @@ class WebRtcAudioPicker31(private val audioOutputChangedListener: OnAudioOutputC
|
||||
return when (this.type) {
|
||||
AudioDeviceInfo.TYPE_BUILTIN_EARPIECE -> context.getString(R.string.WebRtcAudioOutputToggle__phone_earpiece)
|
||||
AudioDeviceInfo.TYPE_BUILTIN_SPEAKER -> context.getString(R.string.WebRtcAudioOutputToggle__speaker)
|
||||
AudioDeviceInfo.TYPE_WIRED_HEADPHONES -> context.getString(R.string.WebRtcAudioOutputToggle__wired_headphones)
|
||||
AudioDeviceInfo.TYPE_WIRED_HEADSET -> context.getString(R.string.WebRtcAudioOutputToggle__wired_headset)
|
||||
AudioDeviceInfo.TYPE_USB_HEADSET -> context.getString(R.string.WebRtcAudioOutputToggle__wired_headset_usb)
|
||||
else -> this.productName
|
||||
|
||||
@@ -2346,7 +2346,9 @@
|
||||
<string name="WebRtcAudioOutputToggle__speaker">Speaker</string>
|
||||
<!-- Audio output option referring to an external audio device connected via wireless Bluetooth -->
|
||||
<string name="WebRtcAudioOutputToggle__bluetooth">Bluetooth</string>
|
||||
<!-- Audio output option referring to an external headset connected via a 3.5mm headphone jack -->
|
||||
<!-- Audio output option referring to a pair of headphones that do not contain a microphone connected via a 3.5mm headphone jack -->
|
||||
<string name="WebRtcAudioOutputToggle__wired_headphones">Wired Headphones</string>
|
||||
<!-- Audio output option referring to an external headset that contains a microphone connected via a 3.5mm headphone jack -->
|
||||
<string name="WebRtcAudioOutputToggle__wired_headset">Wired Headset</string>
|
||||
<!-- Audio output option referring to an external headset connected via a USB-C data cable -->
|
||||
<string name="WebRtcAudioOutputToggle__wired_headset_usb">Wired Headset (USB)</string>
|
||||
|
||||
Reference in New Issue
Block a user