Disable BT audio devices for Element Call on Android < 12#4876
Merged
jmartinesp merged 4 commits intodevelopfrom Jun 13, 2025
Merged
Conversation
After trying several strategies to make BT audio devices play nice with the embedded Element Call instance on Android versions using the legacy audio APIs - Android 11 and lower - and it failing in several ways - wrong audio device being used when switching, audio just dying until the app is force closed or the app crashing with a native OS error and no stacktrace - we had to make a difficult decision of preventing using these devices at all. This change makes it so when selecting a BT audio device or when it's selected by default by the OS, we notify the user about the device not being usable, and mute the audio to prevent it from being streamed through some other audio device. Once a new device is selected, the audio is enabled again and that device can be used normally.
…n when tapping on the button inside the WebView This change makes it so that if you go back when you already tried to hang up, it'll wait for the confirmation for a couple of seconds and if it doesn't arrive it'll leave the call screen anyway.
87fd3b1 to
993eec5
Compare
Contributor
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
jmartinesp
commented
Jun 13, 2025
Comment on lines
+180
to
+182
| InvalidAudioDeviceReason.BT_AUDIO_DEVICE_DISABLED -> { | ||
| // TODO: use a string resource when available | ||
| "Element Call does not support using Bluetooth audio devices in this Android version. Please select a different audio device." |
Member
Author
There was a problem hiding this comment.
This is replaced by the actual string in a following commit.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4876 +/- ##
===========================================
- Coverage 80.27% 80.25% -0.02%
===========================================
Files 2140 2140
Lines 56909 56938 +29
Branches 7164 7168 +4
===========================================
+ Hits 45686 45698 +12
- Misses 8789 8805 +16
- Partials 2434 2435 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Content
Motivation and context
After trying several strategies to make BT audio devices play nice with the embedded Element Call instance on Android versions using the legacy audio APIs - Android 11 and lower - and it failing in several ways - wrong audio device being used when switching, audio just dying until the app is force closed or the app crashing with a native OS error and no stacktrace - we had to make a difficult decision of preventing using these devices at all.
This change makes it so when selecting a BT audio device or when it's selected by default by the OS, we notify the user about the device not being usable, and mute the audio to prevent it from being streamed through some other audio device. Once a new device is selected, the audio is enabled again and that device can be used normally.
Screenshots / GIFs
Tests
With an Android device using Android 11 or lower:
Tested devices
Checklist