diff options
author | Sasha Levitskiy <sanek@google.com> | 2015-05-08 14:31:48 -0700 |
---|---|---|
committer | Sasha Levitskiy <sanek@google.com> | 2015-05-11 13:42:19 -0700 |
commit | 80db9baf9766dc40f9d1b6bf60797ee5cc64a48c (patch) | |
tree | 58b8d76e2b0b3b0aefd8717638e62e43624f6bb5 /services/core/jni | |
parent | faf55219877416c1bdfbdfe5b7d24e35e9971a03 (diff) | |
download | frameworks_base-80db9baf9766dc40f9d1b6bf60797ee5cc64a48c.zip frameworks_base-80db9baf9766dc40f9d1b6bf60797ee5cc64a48c.tar.gz frameworks_base-80db9baf9766dc40f9d1b6bf60797ee5cc64a48c.tar.bz2 |
Fingerprint: Add Set Active Group
Change-Id: Ie9d63c5f948c9610bd6b19a76bffab5ae0070620
Signed-off-by: Sasha Levitskiy <sanek@google.com>
Diffstat (limited to 'services/core/jni')
-rw-r--r-- | services/core/jni/com_android_server_fingerprint_FingerprintService.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/services/core/jni/com_android_server_fingerprint_FingerprintService.cpp b/services/core/jni/com_android_server_fingerprint_FingerprintService.cpp index 7dbfaf6..39474ec 100644 --- a/services/core/jni/com_android_server_fingerprint_FingerprintService.cpp +++ b/services/core/jni/com_android_server_fingerprint_FingerprintService.cpp @@ -181,6 +181,21 @@ static jlong nativeGetAuthenticatorId(JNIEnv *, jobject clazz) { return gContext.device->get_authenticator_id(gContext.device); } +static jint nativeSetActiveGroup(JNIEnv *env, jobject clazz, jint gid, jbyteArray path) { + const int pathSize = env->GetArrayLength(path); + jbyte* pathData = env->GetByteArrayElements(path, 0); + if (pathSize >= PATH_MAX) { + ALOGE("Path name is too long\n"); + return -1; + } + char path_name[PATH_MAX] = {0}; + memcpy(path_name, pathData, pathSize); + ALOG(LOG_VERBOSE, LOG_TAG, "nativeSetActiveGroup() path: %s, gid: %d\n", path_name, gid); + int result = gContext.device->set_active_group(gContext.device, gid, path_name); + env->ReleaseByteArrayElements(path, pathData, 0); + return result; +} + static jint nativeOpenHal(JNIEnv* env, jobject clazz) { ALOG(LOG_VERBOSE, LOG_TAG, "nativeOpenHal()\n"); int err; @@ -242,6 +257,7 @@ static const JNINativeMethod g_methods[] = { { "nativeAuthenticate", "(JI)I", (void*)nativeAuthenticate }, { "nativeStopAuthentication", "()I", (void*)nativeStopAuthentication }, { "nativeEnroll", "([BII)I", (void*)nativeEnroll }, + { "nativeSetActiveGroup", "(I[B)I", (void*)nativeSetActiveGroup }, { "nativePreEnroll", "()J", (void*)nativePreEnroll }, { "nativeStopEnrollment", "()I", (void*)nativeStopEnrollment }, { "nativeRemove", "(II)I", (void*)nativeRemove }, |