1

I have some custom logic that do the same sound as in notifications when some event appears, and if it's silent or vibrate mode I do vibration.

So I have two questions:

  1. Is it possible to call some function that will do notification sound or vibration the same as in notifications depends on current ringer mode?

  2. If not is it possible to call vibration with the same pattern as in notifications? I'm looking for pattern e.g new long[] {0, 100, 100, 100} maybe somebody has seen it in android sources?

Orest
  • 6,548
  • 10
  • 54
  • 84
  • Possible duplicate of [How to make an Android device vibrate?](http://stackoverflow.com/questions/13950338/how-to-make-an-android-device-vibrate) – Hitesh Sahu Apr 25 '16 at 01:11
  • No it's not a duplicate, I know hot to make device vibrate, the question is about default vibration pattern used in notifications... – Orest Apr 25 '16 at 04:14
  • Notification vibrartion pattern is new long[] { 0, 700, 500, 1000 }; http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.1_r1/com/android/fixvibratesetting/FixVibrateSetting.java#FixVibrateSetting How to make default pattern http://stackoverflow.com/questions/18253482/vibrate-and-sound-defaults-on-notification – Hitesh Sahu Apr 27 '16 at 12:28

0 Answers0