-
Notifications
You must be signed in to change notification settings - Fork 201
Use in-call volume and mode for EC #4481
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
Use in-call volume and mode for EC #4481
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
@@ -161,6 +167,10 @@ private fun CallWebView( | |||
} | |||
}, | |||
onRelease = { webView -> | |||
// Reset audio mode | |||
val audioManager = webView.context.getSystemService<AudioManager>() | |||
audioManager?.mode = AudioManager.MODE_NORMAL |
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.
Maybe store the previous mode and restore it here?
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.
From what I saw in some issues (this is poorly documented, AFAICT) the app can be 'blacklisted' if it doesn't play any audio in the 6s after enabling this mode or doesn't return to the MODE_NORMAL
when it's done playing.
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.
OK, thanks.
acdf636
to
e5ec2c4
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4481 +/- ##
===========================================
- Coverage 80.08% 80.05% -0.03%
===========================================
Files 2087 2088 +1
Lines 55121 55145 +24
Branches 6876 6884 +8
===========================================
+ Hits 44143 44148 +5
- Misses 8617 8631 +14
- Partials 2361 2366 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I tested it and it works. I can change the output volume while in a call with the hardware buttons (without using androids per sink volume control ui) I think this makes sense to become its own issue? It will would be interesting to have an experiment if it event works?
|
Another issue I observed with this is, that the min volume is still very audible (there is no 0 volume option for in call audio) Which is very nice for the user so they will never be stuck with no sound and also what a normal call does. It is still sth we need to be aware of, since we might want to be able to silence the phone if in a conference when someone else comes by in the real world. I think this is sth we would like to solve in EC where we provide a mute output button or similar. |
@jmartinesp |
@toger5 I think you already did, but can you confirm that even though the changes don't fix all the issues, we can merge this as is and iterate later if needed? Thanks! |
Yes when i tested it this was already an imporvement and worked as expected (volume rocker changed call sound) |
// The built-in earpiece of the device | ||
AudioDeviceInfo.TYPE_BUILTIN_EARPIECE, | ||
// The built-in speaker of the device | ||
AudioDeviceInfo.TYPE_BUILTIN_SPEAKER, |
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.
For Video Call, I guess TYPE_BUILTIN_SPEAKER should have a higher priority than TYPE_BUILTIN_EARPIECE, no?
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.
Oh, nice catch.
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.
Once we have the "EC stop audio output"/"EC start/continue audio output" widget actions it should be easy to switch from TYPE_BUILTIN_SPEAKER
to TYPE_BUILTIN_EARPIECE
when the phone is put in standby right?
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.
I can't say without having tested it first. In theory it should be.
|
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 update!
Content
When the call starts, get the list of audio devices and try to set the 'most likely to be used' device as audio input + output. This also changes the audio mode to 'in communication', making the volume rocker change the 'in-call' audio stream.
This works as a workaround for not being able to pick the audio output in the EC settings, since this is not supported by the Android WebView (and it doesn't seem like it'll be supported any time soon).
Note that adding a new audio device while in-call won't work, the workaround can't make that work too, sadly. We'll see if we can do something in the future.
Motivation and context
Should fix #4480.
Tests
Tested devices
Checklist