Loading core/java/android/hardware/fingerprint/FingerprintManager.java +21 −1 Original line number Diff line number Diff line Loading @@ -587,6 +587,25 @@ public class FingerprintManager { return false; } /** * Retrieves the authenticator token for binding keys to the lifecycle * of the current set of fingerprints. Used only by internal clients. * * @hide */ public long getAuthenticatorId() { if (mService != null) { try { return mService.getAuthenticatorId(); } catch (RemoteException e) { Log.v(TAG, "Remote exception in getAuthenticatorId(): ", e); } } else { Log.w(TAG, "getAuthenticatorId(): Service not connected!"); } return 0; } private Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { switch(msg.what) { Loading Loading @@ -793,3 +812,4 @@ public class FingerprintManager { }; } core/java/android/hardware/fingerprint/IFingerprintService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -63,4 +63,6 @@ interface IFingerprintService { // Gets the unique device id for hardware enumerated at i // long getHardwareDevice(int i); // Gets the authenticator ID for fingerprint long getAuthenticatorId(); } services/core/java/com/android/server/fingerprint/FingerprintService.java +7 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ public class FingerprintService extends SystemService { static native int nativeOpenHal(); static native int nativeCloseHal(); static native void nativeInit(MessageQueue queue, FingerprintService service); static native long nativeGetAuthenticatorId(); static final class FpHalMsg { int type; // Type of the message. One of the constants in fingerprint.h Loading Loading @@ -595,6 +596,12 @@ public class FingerprintService extends SystemService { checkPermission(USE_FINGERPRINT); return FingerprintService.this.hasEnrolledFingerprints(groupId); } @Override public long getAuthenticatorId() { checkPermission(USE_FINGERPRINT); return nativeGetAuthenticatorId(); } } @Override Loading services/core/jni/com_android_server_fingerprint_FingerprintService.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,10 @@ static jint nativeRemove(JNIEnv* env, jobject clazz, jint fingerId, jint groupId return reinterpret_cast<jint>(ret); } static jlong nativeGetAuthenticatorId(JNIEnv *, jobject clazz) { return gContext.device->get_authenticator_id(gContext.device); } static jint nativeOpenHal(JNIEnv* env, jobject clazz) { ALOG(LOG_VERBOSE, LOG_TAG, "nativeOpenHal()\n"); int err; Loading Loading @@ -229,6 +233,7 @@ static jint nativeCloseHal(JNIEnv* env, jobject clazz) { return -ENOSYS; // TODO } // ---------------------------------------------------------------------------- Loading @@ -240,6 +245,7 @@ static const JNINativeMethod g_methods[] = { { "nativePreEnroll", "()J", (void*)nativePreEnroll }, { "nativeStopEnrollment", "()I", (void*)nativeStopEnrollment }, { "nativeRemove", "(II)I", (void*)nativeRemove }, { "nativeGetAuthenticatorId", "()J", (void*)nativeGetAuthenticatorId }, { "nativeOpenHal", "()I", (void*)nativeOpenHal }, { "nativeCloseHal", "()I", (void*)nativeCloseHal }, { "nativeInit","(Landroid/os/MessageQueue;" Loading Loading
core/java/android/hardware/fingerprint/FingerprintManager.java +21 −1 Original line number Diff line number Diff line Loading @@ -587,6 +587,25 @@ public class FingerprintManager { return false; } /** * Retrieves the authenticator token for binding keys to the lifecycle * of the current set of fingerprints. Used only by internal clients. * * @hide */ public long getAuthenticatorId() { if (mService != null) { try { return mService.getAuthenticatorId(); } catch (RemoteException e) { Log.v(TAG, "Remote exception in getAuthenticatorId(): ", e); } } else { Log.w(TAG, "getAuthenticatorId(): Service not connected!"); } return 0; } private Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { switch(msg.what) { Loading Loading @@ -793,3 +812,4 @@ public class FingerprintManager { }; }
core/java/android/hardware/fingerprint/IFingerprintService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -63,4 +63,6 @@ interface IFingerprintService { // Gets the unique device id for hardware enumerated at i // long getHardwareDevice(int i); // Gets the authenticator ID for fingerprint long getAuthenticatorId(); }
services/core/java/com/android/server/fingerprint/FingerprintService.java +7 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ public class FingerprintService extends SystemService { static native int nativeOpenHal(); static native int nativeCloseHal(); static native void nativeInit(MessageQueue queue, FingerprintService service); static native long nativeGetAuthenticatorId(); static final class FpHalMsg { int type; // Type of the message. One of the constants in fingerprint.h Loading Loading @@ -595,6 +596,12 @@ public class FingerprintService extends SystemService { checkPermission(USE_FINGERPRINT); return FingerprintService.this.hasEnrolledFingerprints(groupId); } @Override public long getAuthenticatorId() { checkPermission(USE_FINGERPRINT); return nativeGetAuthenticatorId(); } } @Override Loading
services/core/jni/com_android_server_fingerprint_FingerprintService.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,10 @@ static jint nativeRemove(JNIEnv* env, jobject clazz, jint fingerId, jint groupId return reinterpret_cast<jint>(ret); } static jlong nativeGetAuthenticatorId(JNIEnv *, jobject clazz) { return gContext.device->get_authenticator_id(gContext.device); } static jint nativeOpenHal(JNIEnv* env, jobject clazz) { ALOG(LOG_VERBOSE, LOG_TAG, "nativeOpenHal()\n"); int err; Loading Loading @@ -229,6 +233,7 @@ static jint nativeCloseHal(JNIEnv* env, jobject clazz) { return -ENOSYS; // TODO } // ---------------------------------------------------------------------------- Loading @@ -240,6 +245,7 @@ static const JNINativeMethod g_methods[] = { { "nativePreEnroll", "()J", (void*)nativePreEnroll }, { "nativeStopEnrollment", "()I", (void*)nativeStopEnrollment }, { "nativeRemove", "(II)I", (void*)nativeRemove }, { "nativeGetAuthenticatorId", "()J", (void*)nativeGetAuthenticatorId }, { "nativeOpenHal", "()I", (void*)nativeOpenHal }, { "nativeCloseHal", "()I", (void*)nativeCloseHal }, { "nativeInit","(Landroid/os/MessageQueue;" Loading