Merge pull request #4381 from vector-im/feature/adm/looping-call-ringtones

Force call ringtones to loop
This commit is contained in:
Benoit Marty 2021-11-02 09:59:56 +01:00 committed by GitHub
commit 23a8ac6231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
changelog.d/4047.bugfix Normal file
View File

@ -0,0 +1 @@
Fixing call ringtones only playing once when the ringtone doesn't contain looping metadata (android 9.0 and above)

View File

@ -62,6 +62,10 @@ class CallRingPlayerIncoming(
val ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE)
ringtone = RingtoneManager.getRingtone(applicationContext, ringtoneUri)
Timber.v("Play ringtone for incoming call")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
ringtone?.isLooping = true
}
ringtone?.play()
}