0

So, I'm trying to vibrate the phone but can't vibrate when "Do not disturb" mode is enabled.

Here's the code I'm using:

Vibrator vibrator = (Vibrator) requireContext().getSystemService(Context.VIBRATOR_SERVICE);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
    vibrator.vibrate(VibrationEffect.createWaveform(pattern, -1));
} else {
    vibrator.vibrate(pattern, -1);
}

Is there anyway to vibrate the phone when DND is enabled?

Peyman
  • 941
  • 8
  • 28

0 Answers0