diff options
author | Martijn Coenen <maco@google.com> | 2011-06-06 13:46:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-06 13:46:47 -0700 |
commit | 4e75dbb94d276009327ad248a1cdc869c5eafd6d (patch) | |
tree | 7f99066fac0ed0757d0a375d86241df97fb14c20 | |
parent | 49470743fa1d5b4f6d8bd2a97f9664ef8bc80264 (diff) | |
parent | ea51a4275ab7353d537ff94d97e6294e49b50cab (diff) | |
download | frameworks_base-4e75dbb94d276009327ad248a1cdc869c5eafd6d.zip frameworks_base-4e75dbb94d276009327ad248a1cdc869c5eafd6d.tar.gz frameworks_base-4e75dbb94d276009327ad248a1cdc869c5eafd6d.tar.bz2 |
Merge "Connecting to a NFC technology may fail."
-rw-r--r-- | core/java/android/nfc/ErrorCodes.java | 5 | ||||
-rw-r--r-- | core/java/android/nfc/tech/BasicTagTechnology.java | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/nfc/ErrorCodes.java b/core/java/android/nfc/ErrorCodes.java index 69329df..3adcdc3 100644 --- a/core/java/android/nfc/ErrorCodes.java +++ b/core/java/android/nfc/ErrorCodes.java @@ -57,6 +57,7 @@ public class ErrorCodes { case ERROR_SE_ALREADY_SELECTED: return "SE_ALREADY_SELECTED"; case ERROR_SE_CONNECTED: return "SE_CONNECTED"; case ERROR_NO_SE_CONNECTED: return "NO_SE_CONNECTED"; + case ERROR_NOT_SUPPORTED: return "NOT_SUPPORTED"; default: return "UNKNOWN ERROR"; } } @@ -105,4 +106,6 @@ public class ErrorCodes { public static final int ERROR_NO_SE_CONNECTED = -20; -}
\ No newline at end of file + public static final int ERROR_NOT_SUPPORTED = -21; + +} diff --git a/core/java/android/nfc/tech/BasicTagTechnology.java b/core/java/android/nfc/tech/BasicTagTechnology.java index 7ec807a..6557ee0 100644 --- a/core/java/android/nfc/tech/BasicTagTechnology.java +++ b/core/java/android/nfc/tech/BasicTagTechnology.java @@ -77,6 +77,10 @@ import java.io.IOException; // Store this in the tag object mTag.setConnectedTechnology(mSelectedTechnology); mIsConnected = true; + } else if (errorCode == ErrorCodes.ERROR_NOT_SUPPORTED) { + throw new UnsupportedOperationException("Connecting to " + + "this technology is not supported by the NFC " + + "adapter."); } else { throw new IOException(); } |