How to get pre-defined vibration patterns?

21

January 11, 2019, at 2:30 PM

I'm trying to make the device vibrate in a pre-defined pattern, which is defined in the VibrationEffect class, with patterns like EFFECT_CLICK, EFFECT_POP, and others. I noticed that they are all annotated by @hide, It seems like there's no public method for me to get these patterns, VibrationEffect.get() doesn't work.

So how should I get such patterns? Or is it not possible at all? I also tried to dig into the Android source code to find these patterns, I'm particularly interested in the pre-defined Ringtone vibration patterns, but I can't seem to find them, all I can find is the interface package that defines vibration patterns. Can someone point me the right way if I'm doing this wrong?