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
|
@ -95,7 +95,7 @@ class CallRingPlayerOutgoing(
|
||||||
} else {
|
} else {
|
||||||
mediaPlayer.setAudioAttributes(AudioAttributes.Builder()
|
mediaPlayer.setAudioAttributes(AudioAttributes.Builder()
|
||||||
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
|
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
|
||||||
.setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION_SIGNALLING)
|
.setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION)
|
||||||
.build())
|
.build())
|
||||||
}
|
}
|
||||||
return mediaPlayer
|
return mediaPlayer
|
||||||
|
|
|
@ -93,6 +93,10 @@ class CallAudioManager(
|
||||||
|
|
||||||
fun startForCall(mxCall: MxCall) {
|
fun startForCall(mxCall: MxCall) {
|
||||||
Timber.v("## VOIP: AudioManager startForCall ${mxCall.callId}")
|
Timber.v("## VOIP: AudioManager startForCall ${mxCall.callId}")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setupAudioManager(mxCall: MxCall) {
|
||||||
|
Timber.v("## VOIP: AudioManager setupAudioManager ${mxCall.callId}")
|
||||||
val audioManager = audioManager ?: return
|
val audioManager = audioManager ?: return
|
||||||
savedIsSpeakerPhoneOn = audioManager.isSpeakerphoneOn
|
savedIsSpeakerPhoneOn = audioManager.isSpeakerphoneOn
|
||||||
savedIsMicrophoneMute = audioManager.isMicrophoneMute
|
savedIsMicrophoneMute = audioManager.isMicrophoneMute
|
||||||
|
@ -150,6 +154,7 @@ class CallAudioManager(
|
||||||
|
|
||||||
fun onCallConnected(mxCall: MxCall) {
|
fun onCallConnected(mxCall: MxCall) {
|
||||||
Timber.v("##VOIP: AudioManager call answered, adjusting current sound device")
|
Timber.v("##VOIP: AudioManager call answered, adjusting current sound device")
|
||||||
|
setupAudioManager(mxCall)
|
||||||
adjustCurrentSoundDevice(mxCall)
|
adjustCurrentSoundDevice(mxCall)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue