Adhere to HIDL contract on cancel() method

Do not invoke the cancel method multiple times for a single client. This
currently can happen if the client cancels, and subsequently crashes.

Bug: 126205289

Test: Builds
Change-Id: I542ab23298b02928c872a255d0980d6e7e27f6c3
This commit is contained in:
Kevin Chyn
2019-02-25 11:38:57 -08:00
parent cf1a62e830
commit 1417f1f0e7

View File

@@ -209,11 +209,7 @@ public abstract class ClientMonitor extends LoggableMonitor implements IBinder.D
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);
}
stop(false /* initiatedByClient */);
mToken = null;
mListener = null;
}