Change signature of MifareClassic.authenticate*() to throw IOException.
Update API for this and the previous commit.
Change-Id: I19275a5d00081bd0f00afea59a2b673344a32954
diff --git a/api/current.xml b/api/current.xml
index 5883381..6631b85 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -101070,6 +101070,33 @@
>
</field>
</class>
+<class name="TagLostException"
+ extends="java.io.IOException"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="TagLostException"
+ type="android.nfc.TagLostException"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</constructor>
+<constructor name="TagLostException"
+ type="android.nfc.TagLostException"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="message" type="java.lang.String">
+</parameter>
+</constructor>
+</class>
</package>
<package name="android.nfc.technology"
>
@@ -101184,6 +101211,19 @@
visibility="public"
>
</method>
+<method name="setTimeout"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="timeout" type="int">
+</parameter>
+</method>
<method name="transceive"
return="byte[]"
abstract="false"
@@ -101199,19 +101239,6 @@
<exception name="IOException" type="java.io.IOException">
</exception>
</method>
-<method name="setTimeout"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="timeout" type="int">
-</parameter>
-</method>
</class>
<class name="MifareClassic"
extends="android.nfc.technology.BasicTagTechnology"
@@ -101237,6 +101264,8 @@
</parameter>
<parameter name="keyA" type="boolean">
</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
</method>
<method name="authenticateSector"
return="boolean"
@@ -101254,6 +101283,8 @@
</parameter>
<parameter name="keyA" type="boolean">
</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
</method>
<method name="decrement"
return="void"
diff --git a/core/java/android/nfc/technology/MifareClassic.java b/core/java/android/nfc/technology/MifareClassic.java
index ac87919..a2abaa3 100644
--- a/core/java/android/nfc/technology/MifareClassic.java
+++ b/core/java/android/nfc/technology/MifareClassic.java
@@ -249,7 +249,7 @@
* Authenticate the entire sector that the given block resides in.
* <p>This requires a that the tag be connected.
*/
- public boolean authenticateBlock(int block, byte[] key, boolean keyA) throws TagLostException {
+ public boolean authenticateBlock(int block, byte[] key, boolean keyA) throws IOException {
checkConnected();
byte[] cmd = new byte[12];
@@ -287,7 +287,7 @@
* Authenticate for a given sector.
* <p>This requires a that the tag be connected.
*/
- public boolean authenticateSector(int sector, byte[] key, boolean keyA) throws TagLostException {
+ public boolean authenticateSector(int sector, byte[] key, boolean keyA) throws IOException {
checkConnected();
byte addr = (byte) ((firstBlockInSector(sector)) & 0xff);