I want to disable vibrations for notifications but I am not able to make it work. I want to make the notification sound be heard, but the phone should not vibrate. Here is my code:
audioManager.setStreamVolume(AudioManager.STREAM_NOTIFICATION, 2, 0);
audioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, AudioManager.VIBRATE_SETTING_OFF);
but when I receive a message or other notification that uses default sound settings, the phone vibrates. Can someone tell me how to achieve my goal?