-
Notifications
You must be signed in to change notification settings - Fork 238
Disable BT audio devices for Element Call on Android < 12 #4876
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
Disable BT audio devices for Element Call on Android < 12 #4876
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
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
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." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM.
Sadly I'll have to update again #4863, but that's my fault, it's still a draft PR.
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