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

Use in-call volume and mode for EC #4481

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

jmartinesp
Copy link
Member

Content

Motivation and context

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

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
    …ccording to the bounds and shape of the user avatar and display name

Copy link
Contributor

github-actions bot commented Mar 26, 2025

📱 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/fX8dic

@@ -161,6 +167,10 @@ private fun CallWebView(
}
},
onRelease = { webView ->
// Reset audio mode
val audioManager = webView.context.getSystemService<AudioManager>()
audioManager?.mode = AudioManager.MODE_NORMAL
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks.

@jmartinesp jmartinesp force-pushed the fix/use-in-call-volume-for-element-call-audio branch from acdf636 to e5ec2c4 Compare March 27, 2025 08:23
Copy link

codecov bot commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 16.66667% with 20 lines in your changes missing coverage. Please review.

Project coverage is 80.07%. Comparing base (48c7e46) to head (d2dbae8).
Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...roid/libraries/androidutils/compat/AudioManager.kt 11.11% 14 Missing and 2 partials ⚠️
...nt/android/features/call/impl/ui/CallScreenView.kt 33.33% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4481      +/-   ##
===========================================
- Coverage    80.09%   80.07%   -0.03%     
===========================================
  Files         2081     2082       +1     
  Lines        55550    55574      +24     
  Branches      6785     6793       +8     
===========================================
+ Hits         44495    44499       +4     
- Misses        8724     8738      +14     
- Partials      2331     2337       +6     

☔ 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.

@toger5
Copy link

toger5 commented Mar 27, 2025

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)
The output device selection in EC does not work however. It will always defaults to the loudspeaker.

I think this makes sense to become its own issue?
It will need more work on the product to design how we want to control the output devices in EC.

It will would be interesting to have an experiment if it event works?
Since we send widget actions on mute/unmute i am wondering if we can throw together a short experiment with this pr:

  • muting the camera switches the android media device to the head piece
  • unmuting the camera switches to the loudspeaker
    ?

@toger5
Copy link

toger5 commented Mar 27, 2025

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.

@toger5
Copy link

toger5 commented Apr 2, 2025

@jmartinesp
It is okay to never be able to mute the call: element-hq/element-call#3137
So using the in-call output is the way to go.

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.

3 participants