summaryrefslogtreecommitdiffstats
path: root/core/jni/android_view_InputDevice.cpp
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-04-13 04:09:27 -0700
committerJeff Brown <jeffbrown@google.com>2012-04-13 17:01:15 -0700
commita47425a13c19f95057df78b8bb65bb25657e8753 (patch)
tree675c0d6bf611f2427bb3d11315d410bf9087b20a /core/jni/android_view_InputDevice.cpp
parentc2346134bb519a54d50655cbef940fc3fdec60a9 (diff)
downloadframeworks_base-a47425a13c19f95057df78b8bb65bb25657e8753.zip
frameworks_base-a47425a13c19f95057df78b8bb65bb25657e8753.tar.gz
frameworks_base-a47425a13c19f95057df78b8bb65bb25657e8753.tar.bz2
Add support for input devices that have vibrators.
Added a getVibrator() method to InputDevice which returns a Vibrator associated with that input device. Its uses the same API as the system vibrator which makes it easy for applications to be modified to use one or the other. Bug: 6334179 Change-Id: Ifc7f13dbcb778670f3f1c07ccc562334e6109d2e
Diffstat (limited to 'core/jni/android_view_InputDevice.cpp')
-rw-r--r--core/jni/android_view_InputDevice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/jni/android_view_InputDevice.cpp b/core/jni/android_view_InputDevice.cpp
index e8a3a3b..5cb172b 100644
--- a/core/jni/android_view_InputDevice.cpp
+++ b/core/jni/android_view_InputDevice.cpp
@@ -57,7 +57,7 @@ jobject android_view_InputDevice_create(JNIEnv* env, const InputDeviceInfo& devi
gInputDeviceClassInfo.ctor, deviceInfo.getId(), deviceInfo.getGeneration(),
nameObj.get(), descriptorObj.get(),
deviceInfo.getSources(), deviceInfo.getKeyboardType(),
- kcmObj.get()));
+ kcmObj.get(), deviceInfo.hasVibrator()));
const Vector<InputDeviceInfo::MotionRange>& ranges = deviceInfo.getMotionRanges();
for (size_t i = 0; i < ranges.size(); i++) {
@@ -87,7 +87,7 @@ int register_android_view_InputDevice(JNIEnv* env)
gInputDeviceClassInfo.clazz = jclass(env->NewGlobalRef(gInputDeviceClassInfo.clazz));
GET_METHOD_ID(gInputDeviceClassInfo.ctor, gInputDeviceClassInfo.clazz,
- "<init>", "(IILjava/lang/String;Ljava/lang/String;IILandroid/view/KeyCharacterMap;)V");
+ "<init>", "(IILjava/lang/String;Ljava/lang/String;IILandroid/view/KeyCharacterMap;Z)V");
GET_METHOD_ID(gInputDeviceClassInfo.addMotionRange, gInputDeviceClassInfo.clazz,
"addMotionRange", "(IIFFFF)V");