kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix disconnect sound on call termination.
rodzic
c7016aa462
commit
5b5b118b7a
|
@ -413,6 +413,8 @@ class TelecomAwareSignalAudioManager(context: Context, eventListener: EventListe
|
||||||
if (!focusedGained) {
|
if (!focusedGained) {
|
||||||
handler.postDelayed({ androidAudioManager.requestCallAudioFocus() }, 500)
|
handler.postDelayed({ androidAudioManager.requestCallAudioFocus() }, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state = State.PREINITIALIZED
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun start() {
|
override fun start() {
|
||||||
|
@ -423,11 +425,21 @@ class TelecomAwareSignalAudioManager(context: Context, eventListener: EventListe
|
||||||
if (!focusedGained) {
|
if (!focusedGained) {
|
||||||
handler.postDelayed({ androidAudioManager.requestCallAudioFocus() }, 500)
|
handler.postDelayed({ androidAudioManager.requestCallAudioFocus() }, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state = State.RUNNING
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun stop(playDisconnect: Boolean) {
|
override fun stop(playDisconnect: Boolean) {
|
||||||
incomingRinger.stop()
|
incomingRinger.stop()
|
||||||
outgoingRinger.stop()
|
outgoingRinger.stop()
|
||||||
|
|
||||||
|
if (playDisconnect && state != State.UNINITIALIZED) {
|
||||||
|
val volume: Float = androidAudioManager.ringVolumeWithMinimum()
|
||||||
|
soundPool.play(disconnectedSoundId, volume, volume, 0, 0, 1.0f)
|
||||||
|
}
|
||||||
|
|
||||||
|
state = State.UNINITIALIZED
|
||||||
|
|
||||||
androidAudioManager.abandonCallAudioFocus()
|
androidAudioManager.abandonCallAudioFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue