From ac1671d00a6c318b31fd9137828814f844da9172 Mon Sep 17 00:00:00 2001 From: tkellner Date: Mon, 10 Mar 2014 15:23:55 +0000 Subject: Always drop exclusive card access during pin entry (not just win8) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1305 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../java/at/gv/egiz/smcc/reader/DefaultCardReader.java | 18 ++++++++---------- .../java/at/gv/egiz/smcc/reader/PinpadCardReader.java | 18 ++++++++---------- .../src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java | 5 ----- 3 files changed, 16 insertions(+), 25 deletions(-) (limited to 'smcc/src/main/java/at') diff --git a/smcc/src/main/java/at/gv/egiz/smcc/reader/DefaultCardReader.java b/smcc/src/main/java/at/gv/egiz/smcc/reader/DefaultCardReader.java index d3cb9a81..56680313 100644 --- a/smcc/src/main/java/at/gv/egiz/smcc/reader/DefaultCardReader.java +++ b/smcc/src/main/java/at/gv/egiz/smcc/reader/DefaultCardReader.java @@ -123,21 +123,19 @@ public class DefaultCardReader implements CardReader { } private boolean dropExclusive(Card card) throws CardException { - if (SMCCHelper.isWindows8()) { - log.debug("Win8 - giving up exclusive acess"); - try { - card.endExclusive(); - } catch (IllegalStateException e) { - log.debug("Didn't have exclusive access"); - return false; - } + log.debug("Dropping exclusive card access"); + try { + card.endExclusive(); + } catch (IllegalStateException e) { + log.debug("Didn't have exclusive access"); + return false; } return true; } private void regainExclusive(Card card, boolean doRegainExclusive) throws CardException { - if (SMCCHelper.isWindows8() && doRegainExclusive) { - log.debug("Win8 - trying to regain exclusive acess"); + if (doRegainExclusive) { + log.debug("Trying to regain exclusive card access"); card.beginExclusive(); } } diff --git a/smcc/src/main/java/at/gv/egiz/smcc/reader/PinpadCardReader.java b/smcc/src/main/java/at/gv/egiz/smcc/reader/PinpadCardReader.java index f02344eb..56d2233c 100644 --- a/smcc/src/main/java/at/gv/egiz/smcc/reader/PinpadCardReader.java +++ b/smcc/src/main/java/at/gv/egiz/smcc/reader/PinpadCardReader.java @@ -745,21 +745,19 @@ public class PinpadCardReader extends DefaultCardReader { } private boolean dropExclusive(Card card) throws CardException { - if (SMCCHelper.isWindows8()) { - log.debug("Win8 - giving up exclusive acess"); - try { - card.endExclusive(); - } catch (IllegalStateException e) { - log.debug("Didn't have exclusive access"); - return false; - } + log.debug("Dropping exclusive card access"); + try { + card.endExclusive(); + } catch (IllegalStateException e) { + log.debug("Didn't have exclusive access"); + return false; } return true; } private void regainExclusive(Card card, boolean doRegainExclusive) throws CardException { - if (SMCCHelper.isWindows8() && doRegainExclusive) { - log.debug("Win8 - trying to regain exclusive acess"); + if (doRegainExclusive) { + log.debug("Trying to regain exclusive card access"); card.beginExclusive(); } } diff --git a/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java b/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java index e4e11ea1..9f3f7dbd 100644 --- a/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java +++ b/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java @@ -210,9 +210,4 @@ public class SMCCHelper { public static void setUseSWCard(boolean useSWCard) { SMCCHelper.useSWCard = useSWCard; } - - public static boolean isWindows8() { - String osName = System.getProperty("os.name"); - return osName.contains("Windows 8"); - } } -- cgit v1.2.3