File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -12899,6 +12899,7 @@ package android.nfc.tech {
1289912899 method public byte[] getHistoricalBytes();
1290012900 method public int getMaxTransceiveLength();
1290112901 method public int getTimeout();
12902+ method public boolean isExtendedLengthApduSupported();
1290212903 method public void setTimeout(int);
1290312904 method public byte[] transceive(byte[]) throws java.io.IOException;
1290412905 }
Original file line number Diff line number Diff line change @@ -45,4 +45,5 @@ interface INfcTag
4545 void resetTimeouts ();
4646 boolean canMakeReadOnly (int ndefType );
4747 int getMaxTransceiveLength (int technology );
48+ boolean getExtendedLengthApdusSupported ();
4849}
Original file line number Diff line number Diff line change @@ -179,4 +179,27 @@ public byte[] transceive(byte[] data) throws IOException {
179179 public int getMaxTransceiveLength () {
180180 return getMaxTransceiveLengthInternal ();
181181 }
182+
183+ /**
184+ * <p>Standard APDUs have a 1-byte length field, allowing a maximum of
185+ * 255 payload bytes, which results in a maximum APDU length of 261 bytes.
186+ *
187+ * <p>Extended length APDUs have a 3-byte length field, allowing 65535
188+ * payload bytes.
189+ *
190+ * <p>Some NFC adapters, like the one used in the Nexus S and the Galaxy Nexus
191+ * do not support extended length APDUs. They are expected to be well-supported
192+ * in the future though. Use this method to check for extended length APDU
193+ * support.
194+ *
195+ * @return whether the NFC adapter on this device supports extended length APDUs.
196+ */
197+ public boolean isExtendedLengthApduSupported () {
198+ try {
199+ return mTag .getTagService ().getExtendedLengthApdusSupported ();
200+ } catch (RemoteException e ) {
201+ Log .e (TAG , "NFC service dead" , e );
202+ return false ;
203+ }
204+ }
182205}
You can’t perform that action at this time.
0 commit comments