diff options
author | tkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2014-03-10 15:23:55 +0000 |
---|---|---|
committer | tkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2014-03-10 15:23:55 +0000 |
commit | ac1671d00a6c318b31fd9137828814f844da9172 (patch) | |
tree | d8a21a16df0956655b6f2d1a93deb019799c4b59 /smcc/src/main/java/at/gv | |
parent | 271a40ff1cf25c5eadf7a7f42e93fd85775a9ff7 (diff) | |
download | mocca-ac1671d00a6c318b31fd9137828814f844da9172.tar.gz mocca-ac1671d00a6c318b31fd9137828814f844da9172.tar.bz2 mocca-ac1671d00a6c318b31fd9137828814f844da9172.zip |
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
Diffstat (limited to 'smcc/src/main/java/at/gv')
3 files changed, 16 insertions, 25 deletions
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"); - } } |