Support combined vibration effects with input device.
Support combined vibration effects with multi-channel FF effect input
device.
Bug: 161629089
Test: atest InputDeviceVibratorTest
Change-Id: I566f6cdd601f716b34c2f70e3705340ef8906897
diff --git a/services/inputflinger/reader/include/InputDevice.h b/services/inputflinger/reader/include/InputDevice.h
index 7d160eb..8b14b06 100644
--- a/services/inputflinger/reader/include/InputDevice.h
+++ b/services/inputflinger/reader/include/InputDevice.h
@@ -82,8 +82,10 @@
int32_t getSwitchState(uint32_t sourceMask, int32_t switchCode);
bool markSupportedKeyCodes(uint32_t sourceMask, size_t numCodes, const int32_t* keyCodes,
uint8_t* outFlags);
- void vibrate(const std::vector<VibrationElement>& pattern, ssize_t repeat, int32_t token);
+ void vibrate(const VibrationSequence& sequence, ssize_t repeat, int32_t token);
void cancelVibrate(int32_t token);
+ bool isVibrating();
+ std::vector<int32_t> getVibratorIds();
void cancelTouch(nsecs_t when);
int32_t getMetaState();
@@ -272,6 +274,8 @@
}
inline void cancelVibrate() { return mEventHub->cancelVibrate(mId); }
+ inline std::vector<int32_t> getVibratorIds() { return mEventHub->getVibratorIds(mId); }
+
inline bool hasAbsoluteAxis(int32_t code) const {
RawAbsoluteAxisInfo info;
mEventHub->getAbsoluteAxisInfo(mId, code, &info);