InputFlinger: Support amplitude control for InputDeviceVibrator

Add support for sending multi-channel rumble amplitudes to input
devices supporting FF_RUMBLE.

Bug: 38511270
Bug: 136215622
Test: Connect a gamepad whose driver supports FF_RUMBLE, find it
      with the android input framework, and do something like this:

      // waveform where rumble magnitude doubles every 2 seconds
      VibrationEffect effect = VibrationEffect.createWaveform(
              new long[] { 2000L, 2000L, 2000L, 2000L, 2000L },
              new int[] { 16, 32, 64, 128, 255 },
              -1);
      inputDevice.getVibrator().vibrate(effect);

Change-Id: I2f059e085c106cbca2372c72d09a9f579d35e4c7
diff --git a/services/inputflinger/reader/InputDevice.cpp b/services/inputflinger/reader/InputDevice.cpp
index 4b19e5e..b4eaf7f 100644
--- a/services/inputflinger/reader/InputDevice.cpp
+++ b/services/inputflinger/reader/InputDevice.cpp
@@ -424,10 +424,10 @@
     return result;
 }
 
-void InputDevice::vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t repeat,
+void InputDevice::vibrate(const std::vector<VibrationElement>& pattern, ssize_t repeat,
                           int32_t token) {
-    for_each_mapper([pattern, patternSize, repeat, token](InputMapper& mapper) {
-        mapper.vibrate(pattern, patternSize, repeat, token);
+    for_each_mapper([pattern, repeat, token](InputMapper& mapper) {
+        mapper.vibrate(pattern, repeat, token);
     });
 }