am ce3da983: am 12328ef4: Merge "Fingerprint: Add post enroll interface." into mnc-dev

* commit 'ce3da9839cbb905c8e6aaf38d74fc7ad719ae105':
  Fingerprint: Add post enroll interface.
This commit is contained in:
Sasha Levitskiy
2015-07-08 23:23:09 +00:00
committed by Android Git Automerger
4 changed files with 40 additions and 1 deletions

View File

@@ -519,6 +519,21 @@ public class FingerprintManager {
return result;
}
/**
* Finishes enrollment and cancels the current auth token.
* @hide
*/
@RequiresPermission(MANAGE_FINGERPRINT)
public int postEnroll() {
int result = 0;
if (mService != null) try {
result = mService.postEnroll(mToken);
} catch (RemoteException e) {
Log.w(TAG, "Remote exception in post enroll: ", e);
}
return result;
}
/**
* Remove given fingerprint template from fingerprint hardware and/or protected storage.
* @param fp the fingerprint item to remove

View File

@@ -21,7 +21,7 @@ import android.hardware.fingerprint.IFingerprintDaemonCallback;
* Communication channel from FingerprintService to FingerprintDaemon (fingerprintd)
* @hide
*/
interface IFingerprintDaemon {
int authenticate(long sessionId, int groupId);
int cancelAuthentication();
@@ -34,4 +34,5 @@ interface IFingerprintDaemon {
long openHal();
int closeHal();
void init(IFingerprintDaemonCallback callback);
int postEnroll();
}

View File

@@ -54,6 +54,9 @@ interface IFingerprintService {
// Get a pre-enrollment authentication token
long preEnroll(IBinder token);
// Finish an enrollment sequence and invalidate the authentication token
int postEnroll(IBinder token);
// Determine if a user has at least one enrolled fingerprint
boolean hasEnrolledFingerprints(int groupId, String opPackageName);

View File

@@ -301,6 +301,20 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
return 0;
}
public int startPostEnroll(IBinder token) {
IFingerprintDaemon daemon = getFingerprintDaemon();
if (daemon == null) {
Slog.w(TAG, "startPostEnroll: no fingeprintd!");
return 0;
}
try {
return daemon.postEnroll();
} catch (RemoteException e) {
Slog.e(TAG, "startPostEnroll failed", e);
}
return 0;
}
private void stopPendingOperations() {
if (mEnrollClient != null) {
stopEnrollment(mEnrollClient.token, true);
@@ -634,6 +648,12 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
return startPreEnroll(token);
}
@Override // Binder call
public int postEnroll(IBinder token) {
checkPermission(MANAGE_FINGERPRINT);
return startPostEnroll(token);
}
@Override // Binder call
public void enroll(final IBinder token, final byte[] cryptoToken, final int groupId,
final IFingerprintServiceReceiver receiver, final int flags) {