Merge pull request #1198 from deltachat/fix1197SoundUriCrashesNotification

Fix not trying to play a sound when -no sound- has been selected.
This commit is contained in:
björn petersen
2019-12-31 16:55:02 +01:00
committed by GitHub
@@ -286,10 +286,13 @@ abstract class MessageNotifier {
}
private void playNotificationSound(Uri uri, boolean vibrate) {
Ringtone ringtone = RingtoneManager.getRingtone(appContext, uri);
if (ringtone!=null) {
ringtone.play();
}
if(uri != null) {
Ringtone ringtone = RingtoneManager.getRingtone(appContext, uri);
if (ringtone != null) {
ringtone.play();
}
} // else we selected "no sound"
if (vibrate) {
Vibrator v = (Vibrator) appContext.getSystemService(Context.VIBRATOR_SERVICE);