mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-25 23:47:20 +00:00
parent
a3007c5906
commit
fca98c42d5
@ -76,6 +76,7 @@ import me.leolin.shortcutbadger.ShortcutBadger;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class MessageNotifier {
|
public class MessageNotifier {
|
||||||
|
private static final String TAG = MessageNotifier.class.getSimpleName();
|
||||||
|
|
||||||
public static final int NOTIFICATION_ID = 1338;
|
public static final int NOTIFICATION_ID = 1338;
|
||||||
|
|
||||||
@ -300,10 +301,18 @@ public class MessageNotifier {
|
|||||||
|
|
||||||
String ringtone = TextSecurePreferences.getNotificationRingtone(context);
|
String ringtone = TextSecurePreferences.getNotificationRingtone(context);
|
||||||
|
|
||||||
if (ringtone == null)
|
if (ringtone == null) {
|
||||||
|
Log.w(TAG, "ringtone preference was null.");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Uri uri = Uri.parse(ringtone);
|
Uri uri = Uri.parse(ringtone);
|
||||||
|
|
||||||
|
if (uri == null) {
|
||||||
|
Log.w(TAG, "couldn't parse ringtone uri " + ringtone);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
MediaPlayer player = new MediaPlayer();
|
MediaPlayer player = new MediaPlayer();
|
||||||
player.setAudioStreamType(AudioManager.STREAM_NOTIFICATION);
|
player.setAudioStreamType(AudioManager.STREAM_NOTIFICATION);
|
||||||
player.setDataSource(context, uri);
|
player.setDataSource(context, uri);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user