title: Java NotificationCompat Sound Not Ring
body: <p>I am creating notification for my apps. I don't want to give a sound when the notification type is a progress bar.</p>
  
  <pre><code>// Run method 
  progressNotification(context);
  
  public void progressNotification(Context context){
      // Simulation download progress
      int min = 0;
      int max = 100;
      while (min&lt;=max){
          try{
              showNotification(context, true, min, max);
              Thread.sleep(100);
          }catch(InterruptedException ex){
          }
          min++;
      }
      // Send notification with sound
      showNotification(context, false, 0, 0);
  }
  
  public void showNotification(Context context, Boolean progress, int min, int max){
      Intent intent = new Intent(context, EntryActivity.class);
      intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
      PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
  
      String notificationChannelId = createNotificationChannel(context, progress ? false : true);
      NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, notificationChannelId);
      mBuilder.setSmallIcon(R.mipmap.ic_launcher)
              .setContentTitle(context.getString(R.string.message_title))
              .setContentText(context.getString(R.string.message_content))
              .setStyle(new NotificationCompat.BigTextStyle()
                      .bigText(context.getString(R.string.mask_message_content)))
              .setPriority(NotificationCompat.PRIORITY_DEFAULT)
              .setContentIntent(pendingIntent)
              .setAutoCancel(true);
  
      if(progress) {
          if(min&lt;max) {
              mBuilder.setContentText("Downloading...").setProgress(max, min, false);
          }else{
              mBuilder.setContentText("Download Complete!").setProgress(0, 0,false);
          }
      }
  
      NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
      notificationManager.notify(234, mBuilder.build());
  }
  
  private String createNotificationChannel(Context context, Boolean audio) {
      String channelId = "channelId";
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
          CharSequence name = "channel_name";
          String description = "channel_description";
          int importance = NotificationManager.IMPORTANCE_DEFAULT;
          NotificationChannel channel = new NotificationChannel(channelId, name, importance);
          channel.setDescription(description);
  
          // Here the condition
          if(!audio) channel.setSound(null, null);
  
          NotificationManager notificationManager = context.getSystemService(NotificationManager.class);
          notificationManager.createNotificationChannel(channel);
          return channelId;
      }
      return null;
  }
  </code></pre>
  
  <p>If I set showNotification() with progress 'true' it means I disable sound, It works but when I show notificaiton again with progress 'false' it means I enable sound, but it is still disabled.</p>