do not attempt to play ringtone if none was found
This commit is contained in:
parent
9fc04c4b1e
commit
37ce311764
|
@ -425,6 +425,10 @@ public class NotificationService {
|
||||||
}
|
}
|
||||||
final Uri uri = Uri.parse(ringtonePreference);
|
final Uri uri = Uri.parse(ringtonePreference);
|
||||||
this.currentlyPlayingRingtone = RingtoneManager.getRingtone(mXmppConnectionService, uri);
|
this.currentlyPlayingRingtone = RingtoneManager.getRingtone(mXmppConnectionService, uri);
|
||||||
|
if (this.currentlyPlayingRingtone == null) {
|
||||||
|
Log.d(Config.LOGTAG,"unable to find ringtone for uri "+uri);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||||
this.currentlyPlayingRingtone.setLooping(true);
|
this.currentlyPlayingRingtone.setLooping(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue