Cancel current operation when binder dies

When the binder dies, it makes no sense to send an error since the client
is already dead. Instead, just notify the driver to cancel the current
operation.

Bug: 119592051

Test: manual
Change-Id: I60e515bfff933df5e672ac2797d7d8620e6ece09
This commit is contained in:
Kevin Chyn
2018-11-20 11:24:49 -08:00
parent d6764f8503
commit 9e7b89a35f

View File

@@ -197,10 +197,15 @@ public abstract class ClientMonitor implements IBinder.DeathRecipient {
@Override
public void binderDied() {
// If the current client dies we should cancel the current operation.
Slog.e(getLogTag(), "Binder died, cancelling client");
try {
getDaemonWrapper().cancel();
} catch (RemoteException e) {
Slog.e(getLogTag(), "Remote exception", e);
}
mToken = null;
mListener = null;
onError(getHalDeviceId(), BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE,
0 /* vendorCode */);
}
@Override