summaryrefslogtreecommitdiffstats
path: root/services/jni
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-11-04 11:39:12 -0700
committerDianne Hackborn <hackbod@google.com>2010-11-04 13:01:56 -0700
commitea9020e0854427d47e566a1394df6749f3265410 (patch)
tree6d0ec3569fc36c5bbf368a5317d119508feddb8d /services/jni
parentd8d7b555cb45bf55f74e89a7cf9312e400f7cd1c (diff)
downloadframeworks_base-ea9020e0854427d47e566a1394df6749f3265410.zip
frameworks_base-ea9020e0854427d47e566a1394df6749f3265410.tar.gz
frameworks_base-ea9020e0854427d47e566a1394df6749f3265410.tar.bz2
Add API to find out if there is a vibrator.
Change-Id: If29f6ee19448222433cad9fad325d0095a8e5737
Diffstat (limited to 'services/jni')
-rw-r--r--services/jni/com_android_server_VibratorService.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/jni/com_android_server_VibratorService.cpp b/services/jni/com_android_server_VibratorService.cpp
index 6ec5c07..0912d43 100644
--- a/services/jni/com_android_server_VibratorService.cpp
+++ b/services/jni/com_android_server_VibratorService.cpp
@@ -29,6 +29,11 @@
namespace android
{
+static jboolean vibratorExists(JNIEnv *env, jobject clazz)
+{
+ return vibrator_exists() > 0 ? JNI_TRUE : JNI_FALSE;
+}
+
static void vibratorOn(JNIEnv *env, jobject clazz, jlong timeout_ms)
{
// LOGI("vibratorOn\n");
@@ -42,6 +47,7 @@ static void vibratorOff(JNIEnv *env, jobject clazz)
}
static JNINativeMethod method_table[] = {
+ { "vibratorExists", "()Z", (void*)vibratorExists },
{ "vibratorOn", "(J)V", (void*)vibratorOn },
{ "vibratorOff", "()V", (void*)vibratorOff }
};