title: Cannot disable notification vibration in Android 8
body: <p>I try to <strong>disable vibration</strong> when showing a notification.</p>
  <p>Func:</p>
  <pre><code>public static Notification buildNotifForUploaderService(Context ctx, String title, String message) {
  
          Notification notification;
          NotificationCompat.Builder notificationBuilder;
  
          //If device is Android 8+
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
              NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH);
              //setting pattern to disable vibrating
              notificationChannel.setVibrationPattern(new long[]{0L});
              notificationBuilder = new NotificationCompat.Builder(ctx, CHANNEL_ID);
          } else {
              notificationBuilder = new NotificationCompat.Builder(ctx);
              notificationBuilder.setVibrate(new long[]{0L});
          }
  
  
          notificationBuilder
                  .setContentTitle(title)
                  .setContentText(message)
                  .setLargeIcon(BitmapFactory.decodeResource(ctx.getResources(), R.mipmap.ic_launcher))
                  .setSmallIcon(R.drawable.ic_backup_black_24dp);
  
  
          notification = notificationBuilder.build();
  
          return notification;
      }
  </code></pre>
  <p>I call this on an activity's onCreate() like this:</p>
  <pre><code>Notification notification = NotificationHelper.buildNotifForUploaderService(this, &quot;title&quot;, &quot;message&quot;);
      NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
      notificationManager.notify(1, notification);
  </code></pre>
  <p>It is <strong>still vibrating</strong>. I test on <strong>Android 8</strong> device.
  I have also tried</p>
  <pre><code> notificationChannel.setVibrationPattern(null);
  </code></pre>
  <p>still not works.</p>
  <p>I have</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
  </code></pre>
  <p><strong>No matter how I define the vibration pattern</strong>, like:</p>
  <pre><code>new long[]{1000L, 500L, 300L, 1000L};
  </code></pre>
  <p>The vibration <strong>does not correspond to my settings</strong>. Onyl the default &quot;two short&quot; vibration occurs.</p>
  <p>Please help if you can, thanks in advance.</p>
  <p><strong>E D I T:</strong></p>
  <p>As Avijit Karmakar mentioned, <strong>I have added</strong></p>
  <pre><code>  notificationChannel.enableVibration(false);
  </code></pre>
  <p><strong>Full code</strong> now:</p>
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      final static String CHANNEL_ID = &quot;MY_CHANNEL_ID&quot;;
      final static String CHANNEL_NAME = &quot;MY_CHANNEL_NAME&quot;;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      Notification notification;
      NotificationCompat.Builder mBuilder;
      NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  
  
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
          NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH);
          //Disabling vibration!
          notificationChannel.enableVibration(false);
          notificationManager.createNotificationChannel(notificationChannel);
          mBuilder = new NotificationCompat.Builder(this, CHANNEL_ID);
  
      } else {
          mBuilder = new NotificationCompat.Builder(this);
          mBuilder.setVibrate(new long[]{0L});
      }
  
      mBuilder.setContentTitle(&quot;title&quot;)
              .setContentText(&quot;message&quot;)
              .setSmallIcon(R.drawable.ic_android_black_24dp);
  
      Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
      mBuilder.setLargeIcon(bm);
  
      notification = mBuilder.build();
      notificationManager.notify(1, notification);
      }
  }
  </code></pre>
  <hr />
  <h2>It is still vibrating.</h2>
  <p>I test on Xiaomi Mi A1 (Android 8.0)</p>
  <p>Can anybody try this code and help me with the results?</p>