Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2193)

Unified Diff: device/nfc/android/java/src/org/chromium/device/nfc/NfcTagHandler.java

Issue 2845463004: [webnfc] Handle IllegalStateException during read / write operations (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/nfc/android/java/src/org/chromium/device/nfc/NfcTagHandler.java
diff --git a/device/nfc/android/java/src/org/chromium/device/nfc/NfcTagHandler.java b/device/nfc/android/java/src/org/chromium/device/nfc/NfcTagHandler.java
index 1ec65dee351f9dd5aac14a339da4570fbb54b8f3..b4029da45d93afc457ad3b2a4a9034124acdff16 100644
--- a/device/nfc/android/java/src/org/chromium/device/nfc/NfcTagHandler.java
+++ b/device/nfc/android/java/src/org/chromium/device/nfc/NfcTagHandler.java
@@ -48,8 +48,9 @@ public class NfcTagHandler {
*/
private interface TagTechnologyHandler {
public void write(NdefMessage message)
- throws IOException, TagLostException, FormatException;
- public NdefMessage read() throws IOException, TagLostException, FormatException;
+ throws IOException, TagLostException, FormatException, IllegalStateException;
+ public NdefMessage read()
+ throws IOException, TagLostException, FormatException, IllegalStateException;
}
/**
@@ -65,12 +66,13 @@ public class NfcTagHandler {
@Override
public void write(NdefMessage message)
- throws IOException, TagLostException, FormatException {
+ throws IOException, TagLostException, FormatException, IllegalStateException {
mNdef.writeNdefMessage(message);
}
@Override
- public NdefMessage read() throws IOException, TagLostException, FormatException {
+ public NdefMessage read()
+ throws IOException, TagLostException, FormatException, IllegalStateException {
return mNdef.getNdefMessage();
}
}
@@ -88,12 +90,12 @@ public class NfcTagHandler {
@Override
public void write(NdefMessage message)
- throws IOException, TagLostException, FormatException {
+ throws IOException, TagLostException, FormatException, IllegalStateException {
mNdefFormattable.format(message);
}
@Override
- public NdefMessage read() throws IOException, TagLostException, FormatException {
+ public NdefMessage read() throws FormatException {
return NfcTypeConverter.emptyNdefMessage();
}
}
@@ -130,11 +132,13 @@ public class NfcTagHandler {
/**
* Writes NdefMessage to NFC tag.
*/
- public void write(NdefMessage message) throws IOException, TagLostException, FormatException {
+ public void write(NdefMessage message)
+ throws IOException, TagLostException, FormatException, IllegalStateException {
mTechHandler.write(message);
}
- public NdefMessage read() throws IOException, TagLostException, FormatException {
+ public NdefMessage read()
+ throws IOException, TagLostException, FormatException, IllegalStateException {
return mTechHandler.read();
}

Powered by Google App Engine
This is Rietveld 408576698