You can apply one trick, just build pattern dynamic based on number of repetition you want.
private long[] createVibrationPattern(long[] oneShotPattern, int repeat) {
long[] repeatPattern = new long[oneShotPattern.length * repeat];
System.arraycopy(oneShotPattern, 0, repeatPattern, 0, oneShotPattern.length);
for (int count = 1; count < repeat; count++) {
repeatPattern[oneShotPattern.length * count] = 500; // Delay in ms, change whatever you want for each repition
System.arraycopy(oneShotPattern, 1, repeatPattern, oneShotPattern.length * count + 1, oneShotPattern.length - 1);
}
return repeatPattern;
}
Then do the call like below
long[] pattern = { 0, 200, 500 };
Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(createVibrationPattern(pattern , 2);
OUTPUT Pattern would become as
0, 200, 500, 500, 0, 200, 500