summaryrefslogtreecommitdiffstats
path: root/services/core/java/com/android/server/fingerprint/FingerprintService.java
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2015-08-21 18:45:15 -0700
committerJim Miller <jaggies@google.com>2015-08-21 18:56:37 -0700
commit827afdab0eb620ed139c4ab519ac837cb718296b (patch)
tree5a6cee0e4de437b228155fdc45932908f4298685 /services/core/java/com/android/server/fingerprint/FingerprintService.java
parente5b4c3d5f329ee830c46f92deef23be1dfbead80 (diff)
downloadframeworks_base-827afdab0eb620ed139c4ab519ac837cb718296b.zip
frameworks_base-827afdab0eb620ed139c4ab519ac837cb718296b.tar.gz
frameworks_base-827afdab0eb620ed139c4ab519ac837cb718296b.tar.bz2
Handle driver errors from remove, enroll and auth.
FingerprintService expects callbacks from the HAL to happen over the provided notify() method. However, there are some circumstances when errors can't be propagated (i.e. the driver cannot be loaded). In this case, the call to the method (remove(), enroll(), authenticate()) fails and we get a return status != 0. When this happens, FingerprintService now sends an error response to the client. In general, this will mean the driver is unavailable, so we send FINGERPRINT_ERROR_HW_UNAVAILABLE. Fixes bug 23183484 Change-Id: Ifb40ba6fb1d960810043749fd8478ba37c968405
Diffstat (limited to 'services/core/java/com/android/server/fingerprint/FingerprintService.java')
-rw-r--r--services/core/java/com/android/server/fingerprint/FingerprintService.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/fingerprint/FingerprintService.java b/services/core/java/com/android/server/fingerprint/FingerprintService.java
index befa311..7807416 100644
--- a/services/core/java/com/android/server/fingerprint/FingerprintService.java
+++ b/services/core/java/com/android/server/fingerprint/FingerprintService.java
@@ -298,6 +298,7 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
final int result = daemon.enroll(cryptoToken, groupId, timeout);
if (result != 0) {
Slog.w(TAG, "startEnroll failed, result=" + result);
+ dispatchError(mHalDeviceId, FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE);
}
} catch (RemoteException e) {
Slog.e(TAG, "startEnroll failed", e);
@@ -391,6 +392,7 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
final int result = daemon.authenticate(opId, groupId);
if (result != 0) {
Slog.w(TAG, "startAuthentication failed, result=" + result);
+ dispatchError(mHalDeviceId, FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE);
}
} catch (RemoteException e) {
Slog.e(TAG, "startAuthentication failed", e);
@@ -433,12 +435,14 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
return;
}
+ stopPendingOperations(true);
mRemoveClient = new ClientMonitor(token, receiver, userId, restricted);
// The fingerprint template ids will be removed when we get confirmation from the HAL
try {
final int result = daemon.remove(fingerId, userId);
if (result != 0) {
Slog.w(TAG, "startRemove with id = " + fingerId + " failed, result=" + result);
+ dispatchError(mHalDeviceId, FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE);
}
} catch (RemoteException e) {
Slog.e(TAG, "startRemove failed", e);