element-android
element-android copied to clipboard
[Bugfix] Fix microphone loss during background voice calls on Android 14
Implemented a microphone access service to ensure uninterrupted microphone usage during voice calls, even when the app is running in the background.
Left photo represent when the call is in the background, and right when the app is open (no change in this case).
Type of change
- [ ] Feature
- [X] Bugfix
- [ ] Technical
- [ ] Other :
Content
This pull request fixes a bug where the app loses microphone access when it goes into the background during a voice call. The issue has been resolved by ensuring that microphone access is maintained during background operations and that the microphone service continues running as needed.
Motivation and context
Issue: App loses microphone access when not active on v 1.6.20 #8881
Steps to reproduce:
- Start a voice call.
- Click the Home button or switch to another app.
Expected outcome: The conversation should continue without interruptions, and the app should maintain access to the microphone even when switching to other apps or locking the phone.
Actual outcome: The other party cannot hear the user because the app loses access to the microphone, which is indicated by the disappearance of the green dot on Samsung S24 devices.
Operating system: Android 14 App version: Element 1.6.20 (Google Play Store)
Screenshots / GIFs
Tests
- Step 1: Reproduce the issue by placing a voice call and switching to another app.
- Step 2: Confirm that the microphone service continues to run and maintains access to the microphone after switching to the background.
- Step 3: Test that the microphone is properly stopped when the call is ended.
- Step 4: Ensure that the app works as expected on different devices with Android 14 and Android 12.
Tested devices
- [X] Physical
- [X] Emulator
- OS version(s): Android 14, Android 12
Checklist
- [X] Changes has been tested on an Android device or Android emulator with API 21
- [X] UI change has been tested on both light and dark themes
- [x] Accessibility has been taken into account. See https://github.com/element-hq/element-android/blob/develop/CONTRIBUTING.md#accessibility
- [X] Pull request is based on the develop branch
- [X] Pull request includes a new file under ./changelog.d. See https://github.com/element-hq/element-android/blob/develop/CONTRIBUTING.md#changelog
- [ X] Pull request includes screenshots or videos if containing UI changes
- [X] Pull request includes a sign off
- [X] You've made a self review of your PR
- [ ] If you have modified the screen flow, or added new screens to the application, you have updated the test UiAllScreensSanityTest.allScreensTest()
@bmarty It is very important to check this as soon as possible and release a new version of the application.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
@bmarty Will this fix make it into the next release?
i fixed one bug that i found, it was a crash when getting incoming call from lock screen. i want over all the edge cases now, seems stable to me.
@bmarty Is this fix planned?
Hello,
I'm taking the liberty of relaunching the ticket because this problem renders the application useless (voice calls without voice are useless even if you know sign language). The criticality level is maximum. Do you need help to get things moving?
Best regards.