title: Disable vibration for a notification
body: <p>I'm writing an app using notification. Google developer guidelines encourages developers to provide settings to customize the notifications (disable vibration, set notification sound...), so I am trying to disable vibration for notifications if the user set it that way.</p>
  
  <p>I am using <code>NotificationCompat.Builder</code> to create the notification, like this:</p>
  
  <pre><code>NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(Application.getContext())
              .setDefaults(Notification.DEFAULT_ALL)
              .setPriority(Notification.PRIORITY_MAX)
              .setSmallIcon(R.drawable.ic_launcher)
              .setLargeIcon(largeIconBitmap)
              .setAutoCancel(true)
              .setContentIntent(resultPendingIntent)
              .setContentTitle(title)
              .setContentText(content);
  </code></pre>
  
  <p>I tried different ways to disable notifications:</p>
  
  <pre><code>notificationBuilder.setVibrate(null);
  
  notificationBuilder.setVibrate(new long[]{0l, 0l});
  
  notificationBuilder.setDefaults(Notification.DEFAULT_ALL | ~Notification.DEFAULT_VIBRATE);
  
  notificationBuilder.setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_SOUND);`
  </code></pre>
  
  <p>I also tried to build the notification and change values on the resulting object:</p>
  
  <pre><code>Notification notification = notificationBuilder.build();
  notification.vibrate = null;
  </code></pre>
  
  <p>But the phone still vibrates when the notification appears.</p>
  
  <p>How can I disable vibration for notifications?</p>