How to turn off vibration of Notifications in android
<p>I'm developing an app that handles <strong>sound and vibration</strong> of apps' <strong>notifications</strong>. I am listening to notifications using <code>NotificationListenerService</code>. I am able to <strong>turn on or off</strong> notification's sound using <code>AudioManager</code> as follows:</p>

<pre><code>// It turns off notification's sound
myAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION, true); 

// It turns on notification's sound
myAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION, false); 
</code></pre>

<p>I have also tried to turn on or off notification's <strong>vibration</strong> with following code but it didn't work on my phone which has Android KitKat 4.4.4</p>

<pre><code>// to turn off notification's vibration
myAudioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, AudioManager.VIBRATE_SETTING_OFF);

// to turn on notification's vibration
myAudioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, AudioManager.VIBRATE_SETTING_ON);
</code></pre>