Fix cancelling of Open eCard Android Service
@@ -122,6 +122,7 @@ public class EacGuiImpl implements EacGui {
@Override
public void cancel() {
+ if (! cancelPromise.isDelivered() && ! cancelPromise.isCancelled()) {
cancelPromise.deliver(Boolean.TRUE);
cancelPromise(serverData);
cancelPromise(userReadSelection);
@@ -131,6 +132,7 @@ public class EacGuiImpl implements EacGui {
cancelPromise(pinCorrect);
cancelPromise(pinStatus);
}
+ }
private void cancelPromise(@Nullable Promise<?> p) {
if (p != null) {
@@ -144,7 +146,7 @@ public class EacGuiImpl implements EacGui {
///
public boolean isCancelled() {
- return cancelPromise.isCancelled();
+ return cancelPromise.isDelivered();
}
public void loadValuesFromSteps(Step step1, Step step2) {
