Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. if(options.isWithoutSound()) {
  2.     channel.setSound(null, null);
  3. } else {
  4.     AudioAttributes audioAttributes = new AudioAttributes.Builder()
  5.         .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
  6.         .setUsage(AudioAttributes.USAGE_NOTIFICATION).build();
  7.     if(options.isWithDefaultSound()) {
  8.         channel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), audioAttributes);
  9.     } else {
  10.         channel.setSound(options.getSound(), audioAttributes);
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement