twilio / audioswitch

An Android audio management library for real-time communication apps.
Apache License 2.0
160 stars 49 forks source link

Fix the detection of earpiece for non-cellular devices. #149

Open winnuz opened 1 year ago

winnuz commented 1 year ago

Description

Fix the detection of earpiece for non-cellular devices.

Breakdown

Validation

Additional Notes

Zebra TC52, TC51, TC53 devices do not have telephony but they have built-in earpiece for VoIP use cases. Zebra ET45 tablet device has telephony but does not have built-in earpiece.

Submission Checklist

usayplz commented 11 months ago

Could you also fix logic when WiredHeadset is disconnected Earpiece never come back. AudioSwitch.kt

Wrong logic on Line 105: wasChanged = wasChanged || this.availableUniqueAudioDevices.add(Earpiece())

never call if WiredHeadset is disconnected: this.availableUniqueAudioDevices.add(Earpiece())

https://github.com/davidliu/audioswitch/blob/fb33b237aa50b3d1d2dea0e0695ecb7b38a98971/audioswitch/src/main/java/com/twilio/audioswitch/AudioSwitch.kt#L105