Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

winnuz
Copy link

@winnuz winnuz commented May 17, 2023

Description

Fix the detection of earpiece for non-cellular devices.

Breakdown

  • update in function "hasEarpiece"
  • use "AudioDeviceInfo.TYPE_BUILTIN_EARPIECE" to detect earpiece

Validation

  • test the library in Zebra TC52 device

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

  • The source has been evaluated for semantic versioning changes and are reflected in gradle.properties
  • The CHANGELOG.md reflects any feature, bug fixes, or known issues made in the source code

…or to support devices without telephony but have built-in earpiece

Some devices do not have telephony but they have built-in earpiece for VoIP use cases. Some devices have telephony but do not have built-in earpiece.
@usayplz
Copy link

usayplz commented Jul 28, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants