Loading api/current.xml +13 −0 Original line number Diff line number Diff line Loading @@ -101199,6 +101199,19 @@ <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" core/java/android/nfc/INfcTag.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -39,4 +39,7 @@ interface INfcTag int ndefMakeReadOnly(int nativeHandle); boolean ndefIsWritable(int nativeHandle); int formatNdef(int nativeHandle, in byte[] key); void setIsoDepTimeout(int timeout); void resetIsoDepTimeout(); } core/java/android/nfc/technology/IsoDep.java +30 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.nfc.NfcAdapter; import android.nfc.Tag; import android.os.Bundle; import android.os.RemoteException; import android.util.Log; import java.io.IOException; Loading @@ -38,6 +39,8 @@ import java.io.IOException; * permission. */ public final class IsoDep extends BasicTagTechnology { private static final String TAG = "NFC"; /** @hide */ public static final String EXTRA_HI_LAYER_RESP = "hiresp"; /** @hide */ Loading @@ -56,6 +59,33 @@ public final class IsoDep extends BasicTagTechnology { } } /** * Sets the timeout of an IsoDep transceive transaction in milliseconds. * If the transaction has not completed before the timeout, * any ongoing {@link BasicTagTechnology#transceive} operation will be * aborted and the connection to the tag is lost. This setting is applied * only to the {@link Tag} object linked to this technology and will be * reset when {@link IsoDep#close} is called. * The default transaction timeout is 5 seconds. */ public void setTimeout(int timeout) { try { mTagService.setIsoDepTimeout(timeout); } catch (RemoteException e) { Log.e(TAG, "NFC service dead", e); } } @Override public void close() { try { mTagService.resetIsoDepTimeout(); } catch (RemoteException e) { Log.e(TAG, "NFC service dead", e); } super.close(); } /** * Return the historical bytes if the tag is using {@link NfcA}, null otherwise. */ Loading Loading
api/current.xml +13 −0 Original line number Diff line number Diff line Loading @@ -101199,6 +101199,19 @@ <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"
core/java/android/nfc/INfcTag.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -39,4 +39,7 @@ interface INfcTag int ndefMakeReadOnly(int nativeHandle); boolean ndefIsWritable(int nativeHandle); int formatNdef(int nativeHandle, in byte[] key); void setIsoDepTimeout(int timeout); void resetIsoDepTimeout(); }
core/java/android/nfc/technology/IsoDep.java +30 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.nfc.NfcAdapter; import android.nfc.Tag; import android.os.Bundle; import android.os.RemoteException; import android.util.Log; import java.io.IOException; Loading @@ -38,6 +39,8 @@ import java.io.IOException; * permission. */ public final class IsoDep extends BasicTagTechnology { private static final String TAG = "NFC"; /** @hide */ public static final String EXTRA_HI_LAYER_RESP = "hiresp"; /** @hide */ Loading @@ -56,6 +59,33 @@ public final class IsoDep extends BasicTagTechnology { } } /** * Sets the timeout of an IsoDep transceive transaction in milliseconds. * If the transaction has not completed before the timeout, * any ongoing {@link BasicTagTechnology#transceive} operation will be * aborted and the connection to the tag is lost. This setting is applied * only to the {@link Tag} object linked to this technology and will be * reset when {@link IsoDep#close} is called. * The default transaction timeout is 5 seconds. */ public void setTimeout(int timeout) { try { mTagService.setIsoDepTimeout(timeout); } catch (RemoteException e) { Log.e(TAG, "NFC service dead", e); } } @Override public void close() { try { mTagService.resetIsoDepTimeout(); } catch (RemoteException e) { Log.e(TAG, "NFC service dead", e); } super.close(); } /** * Return the historical bytes if the tag is using {@link NfcA}, null otherwise. */ Loading