Skip to content
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

Keep foregroundService active if there is other connections #826

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FedorZarubin
Copy link

Hi!
Imagine that you received a call while your app is in the background, accepted it and now have an active conversation.
Then you receive a second incoming call. In that case you may decline second call at once, or you may put on hold the first call and accept the second one, then after a while you finish your conversation and press hang up button, or remote party presses it and you should invoke endCall method to hide second call screen. Anyway, after finishing or declining you going to get back to first call, remove from hold (if needed) and resume conversation. But in all that cases mentioned above you will find that remote party can't hear you anymore.
It happens because any kind of finish of second call fires endCall event which leads unconditionally to currentConnectionService.stopForegroundService() method, therefore your app loses access to microphone in background.
My solution is making a check wether other connections still exist and invoke stopForegroundService only if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant