mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
Fix NPE if notification ringtone is set to silent
This commit is contained in:
@@ -168,8 +168,10 @@ public class C2DMReceiver extends C2DMBaseReceiver {
|
||||
Uri uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||
if (uri != null) {
|
||||
Ringtone rt = RingtoneManager.getRingtone(context, uri);
|
||||
rt.setStreamType(AudioManager.STREAM_NOTIFICATION);
|
||||
if (rt != null) rt.play();
|
||||
if (rt != null) {
|
||||
rt.setStreamType(AudioManager.STREAM_NOTIFICATION);
|
||||
rt.play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user