-
Notifications
You must be signed in to change notification settings - Fork 156
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
Call: ensure that the microphone is working when the application is backgrounded. #3685
Conversation
…y when the call is effectively started.
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3685 +/- ##
===========================================
- Coverage 82.81% 82.81% -0.01%
===========================================
Files 1748 1748
Lines 41777 41782 +5
Branches 5108 5109 +1
===========================================
+ Hits 34597 34601 +4
- Misses 5365 5366 +1
Partials 1815 1815 ☔ View full report in Codecov by Sentry. |
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.
There are a few things I'd like to double check.
...es/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/ElementCallActivity.kt
Show resolved
Hide resolved
...es/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/CallScreenPresenter.kt
Show resolved
Hide resolved
@@ -33,8 +35,12 @@ import timber.log.Timber | |||
class CallForegroundService : Service() { | |||
companion object { | |||
fun start(context: Context) { | |||
val intent = Intent(context, CallForegroundService::class.java) | |||
ContextCompat.startForegroundService(context, intent) | |||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED) { |
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.
Really weird corner case, but what happens if the user didn't enable the microphone permission and joined the room anyway? Will the audio from the other side still be heard, even when the device is locked? I assume it would work for the app just being in background since the PiP window is alive.
Quality Gate passedIssues Measures |
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 for the changes, the feature now seems a lot more stable and useful!
cc @toger5 since he was especially interested in this. He might also be a good early tester 😛 . |
I tested the latest nightly. It failed on the very first call but then worked with no issues, even if I revoked the picture in picture permissions. |
Content
Request audio focus only when the call is actually started and start the foreground service as soon as the call is started.
Second commit change the service permission. We do not really need the permission
MANAGE_OWN_CALLS
but are rather interested byFOREGROUND_SERVICE_MICROPHONE
.Motivation and context
Close #3679
Screenshots / GIFs
Tests
the call should stay active, with a working microphone
Tested devices
Checklist