Skip to content

Comments

Catch exceptions when changing the audio communication device#6226

Open
jmartinesp wants to merge 1 commit intodevelopfrom
fix/catch-possible-exceptions-when-setting-or-clearing-comm-devices
Open

Catch exceptions when changing the audio communication device#6226
jmartinesp wants to merge 1 commit intodevelopfrom
fix/catch-possible-exceptions-when-setting-or-clearing-comm-devices

Conversation

@jmartinesp
Copy link
Member

Content

Catch exceptions when changing the audio communication device in Element Call, log the errors instead.

Motivation and context

Fix https://sentry.tools.element.io/organizations/element/issues/11227938/events/894944cf6c414234972e7ff766d22a70/

java.lang.IllegalArgumentException: invalid portID 1743
    at android.os.Parcel.createExceptionOrNull(Parcel.java:3054)
    at android.os.Parcel.createException(Parcel.java:3034)
    at android.os.Parcel.readException(Parcel.java:3017)
    at android.os.Parcel.readException(Parcel.java:2959)
    at android.media.IAudioService$Stub$Proxy.setCommunicationDevice(IAudioService.java:5971)
    at android.media.AudioManager.setCommunicationDevice(AudioManager.java:7775)
    at io.element.android.features.call.impl.utils.WebViewAudioManager.selectAudioDevice(r8-map-id-d391da7e13318a6053c0090609941610e92b5b23e01c8fa22be3586faaa66eba:10)
    at io.element.android.features.call.impl.utils.WebViewAudioManager.selectDefaultAudioDevice(r8-map-id-d391da7e13318a6053c0090609941610e92b5b23e01c8fa22be3586faaa66eba:99)
    at io.element.android.features.call.impl.utils.WebViewAudioManager$audioDeviceCallback$1.onAudioDevicesAdded(r8-map-id-d391da7e13318a6053c0090609941610e92b5b23e01c8fa22be3586faaa66eba:149)
    at android.media.AudioManager$NativeEventHandlerDelegate$1.handleMessage(AudioManager.java:8637)
    at android.os.Handler.dispatchMessage(Handler.java:111)
    at android.os.Looper.loopOnce(Looper.java:238)
    at android.os.Looper.loop(Looper.java:357)
    at android.app.ActivityThread.main(ActivityThread.java:8149)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:957)

Tests

I don't think this one can be easily tested.

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@jmartinesp jmartinesp requested a review from a team as a code owner February 19, 2026 08:04
@jmartinesp jmartinesp requested review from ganfra and removed request for a team February 19, 2026 08:04
@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Feb 19, 2026
@github-actions
Copy link
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/Ser5Wx

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.41%. Comparing base (5cf0554) to head (8e71b8a).
⚠️ Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
...id/features/call/impl/utils/WebViewAudioManager.kt 0.00% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6226      +/-   ##
===========================================
- Coverage    81.42%   81.41%   -0.01%     
===========================================
  Files         2570     2570              
  Lines        69778    69784       +6     
  Branches      8950     8952       +2     
===========================================
  Hits         56817    56817              
- Misses        9640     9646       +6     
  Partials      3321     3321              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Bugfix For bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant