mirror of
https://github.com/element-hq/element-android
synced 2024-11-25 02:45:37 +03:00
Fix for ticket #2246: Ringtone volume cannot bechanged while ringing
This fix delays the creation of the audioManager until the call is connected. This way the call feature does not takes the focus from the core service (where the ringtone is generated) until the call is esablished. This way the volume can be controled correctly while the phone is ringing (incoming and outgoing).
This commit is contained in:
parent
e6a8fd5b73
commit
a9f7fb46b3
2 changed files with 6 additions and 1 deletions
|
@ -95,7 +95,7 @@ class CallRingPlayerOutgoing(
|
|||
} else {
|
||||
mediaPlayer.setAudioAttributes(AudioAttributes.Builder()
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
|
||||
.setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION_SIGNALLING)
|
||||
.setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION)
|
||||
.build())
|
||||
}
|
||||
return mediaPlayer
|
||||
|
|
|
@ -93,6 +93,10 @@ class CallAudioManager(
|
|||
|
||||
fun startForCall(mxCall: MxCall) {
|
||||
Timber.v("## VOIP: AudioManager startForCall ${mxCall.callId}")
|
||||
}
|
||||
|
||||
fun setupAudioManager(mxCall: MxCall) {
|
||||
Timber.v("## VOIP: AudioManager setupAudioManager ${mxCall.callId}")
|
||||
val audioManager = audioManager ?: return
|
||||
savedIsSpeakerPhoneOn = audioManager.isSpeakerphoneOn
|
||||
savedIsMicrophoneMute = audioManager.isMicrophoneMute
|
||||
|
@ -150,6 +154,7 @@ class CallAudioManager(
|
|||
|
||||
fun onCallConnected(mxCall: MxCall) {
|
||||
Timber.v("##VOIP: AudioManager call answered, adjusting current sound device")
|
||||
setupAudioManager(mxCall)
|
||||
adjustCurrentSoundDevice(mxCall)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue