From 72f03af9151540d2e7e3b605ce60cebc2b473611 Mon Sep 17 00:00:00 2001 From: Tzachi Dar Date: Fri, 9 Feb 2024 15:49:04 +0200 Subject: [PATCH] Add SecurityException to IOException (needed for android 14). --- .../java/com/eveningoutpost/dexdrip/NFCReaderX.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/NFCReaderX.java b/app/src/main/java/com/eveningoutpost/dexdrip/NFCReaderX.java index 5ebd3d3096..a30671c2ab 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/NFCReaderX.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/NFCReaderX.java @@ -611,7 +611,7 @@ protected Tag doInBackground(Tag... params) { try { replyBlock = nfcvTag.transceive(diag); break; - } catch (IOException e) { + } catch (IOException | SecurityException e) { if ((System.currentTimeMillis() > time + 2000)) { Log.e(TAG, "tag diagnostic read timeout"); JoH.static_toast_short(gs(R.string.nfc_diag_timeout)); @@ -644,7 +644,7 @@ protected Tag doInBackground(Tag... params) { patchInfo = Arrays.copyOfRange(patchInfo, 1, patchInfo.length); } break; - } catch (IOException e) { + } catch (IOException | SecurityException e) { if ((System.currentTimeMillis() > time_patch + 2000)) { Log.e(TAG, "patchInfo tag read timeout"); JoH.static_toast_short(gs(R.string.nfc_read_timeout)); @@ -699,7 +699,7 @@ protected Tag doInBackground(Tag... params) { try { replyBlock = nfcvTag.transceive(cmd); break; - } catch (IOException e) { + } catch (IOException | SecurityException e) { if ((System.currentTimeMillis() > time + 2000)) { Log.e(TAG, "tag read timeout"); JoH.static_toast_short(gs(R.string.nfc_read_timeout)); @@ -760,7 +760,7 @@ protected Tag doInBackground(Tag... params) { Log.e(TAG, "sending command " + HexDump.toHexString(cmd)); oneBlock = nfcvTag.transceive(cmd); break; - } catch (IOException e) { + } catch (IOException | SecurityException e) { if ((System.currentTimeMillis() > time + 2000)) { Log.e(TAG, "tag read timeout"); JoH.static_toast_short(gs(R.string.nfc_read_timeout)); @@ -790,7 +790,7 @@ protected Tag doInBackground(Tag... params) { JoH.static_toast_short(gs(R.string.scanned_ok)); PersistentStore.setLongZeroIfSet("nfc-address-failures"); - } catch (IOException e) { + } catch (IOException | SecurityException e) { JoH.static_toast_short(gs(R.string.nfc_io_error)); vibrate(context, 3); } catch (Exception e) {