Loading core/java/android/nfc/INfcTag.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ interface INfcTag byte[] getUid(int nativeHandle); boolean isNdef(int nativeHandle); boolean isPresent(int nativeHandle); byte[] transceive(int nativeHandle, in byte[] data); byte[] transceive(int nativeHandle, in byte[] data, boolean raw); int getLastError(int nativeHandle); Loading core/java/android/nfc/technology/BasicTagTechnology.java +2 −2 Original line number Diff line number Diff line Loading @@ -181,9 +181,9 @@ import android.util.Log; */ public byte[] transceive(byte[] data) throws IOException { try { byte[] response = mTagService.transceive(mTag.getServiceHandle(), data); byte[] response = mTagService.transceive(mTag.getServiceHandle(), data, true); if (response == null) { throw new IOException("transcieve failed"); throw new IOException("transceive failed"); } return response; } catch (RemoteException e) { Loading core/java/android/nfc/technology/MifareClassic.java +25 −0 Original line number Diff line number Diff line Loading @@ -285,5 +285,30 @@ public final class MifareClassic extends BasicTagTechnology { public void writeSectorAccessControl(int sector, int access); public void increment(int block); public void decrement(int block); */ /** * Send data to a tag and receive the response. * <p> * This method will block until the response is received. It can be canceled * with {@link #close}. * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @param data bytes to send * @return bytes received in response * @throws IOException if the target is lost or connection closed */ @Override public byte[] transceive(byte[] data) throws IOException { try { byte[] response = mTagService.transceive(mTag.getServiceHandle(), data, false); if (response == null) { throw new IOException("transceive failed"); } return response; } catch (RemoteException e) { attemptDeadServiceRecovery(e); throw new IOException("NFC service died"); } } } core/java/android/nfc/technology/MifareUltralight.java +25 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,31 @@ public final class MifareUltralight extends BasicTagTechnology { return transceive(blockread_cmd); } /** * Send data to a tag and receive the response. * <p> * This method will block until the response is received. It can be canceled * with {@link #close}. * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @param data bytes to send * @return bytes received in response * @throws IOException if the target is lost or connection closed */ @Override public byte[] transceive(byte[] data) throws IOException { try { byte[] response = mTagService.transceive(mTag.getServiceHandle(), data, false); if (response == null) { throw new IOException("transceive failed"); } return response; } catch (RemoteException e) { attemptDeadServiceRecovery(e); throw new IOException("NFC service died"); } } /** * @throws IOException */ Loading core/java/android/nfc/technology/Ndef.java +5 −0 Original line number Diff line number Diff line Loading @@ -195,4 +195,9 @@ public final class Ndef extends BasicTagTechnology { public void makeLowLevelReadonly() { throw new UnsupportedOperationException(); } @Override public byte[] transceive(byte[] data) { throw new UnsupportedOperationException(); } } Loading
core/java/android/nfc/INfcTag.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ interface INfcTag byte[] getUid(int nativeHandle); boolean isNdef(int nativeHandle); boolean isPresent(int nativeHandle); byte[] transceive(int nativeHandle, in byte[] data); byte[] transceive(int nativeHandle, in byte[] data, boolean raw); int getLastError(int nativeHandle); Loading
core/java/android/nfc/technology/BasicTagTechnology.java +2 −2 Original line number Diff line number Diff line Loading @@ -181,9 +181,9 @@ import android.util.Log; */ public byte[] transceive(byte[] data) throws IOException { try { byte[] response = mTagService.transceive(mTag.getServiceHandle(), data); byte[] response = mTagService.transceive(mTag.getServiceHandle(), data, true); if (response == null) { throw new IOException("transcieve failed"); throw new IOException("transceive failed"); } return response; } catch (RemoteException e) { Loading
core/java/android/nfc/technology/MifareClassic.java +25 −0 Original line number Diff line number Diff line Loading @@ -285,5 +285,30 @@ public final class MifareClassic extends BasicTagTechnology { public void writeSectorAccessControl(int sector, int access); public void increment(int block); public void decrement(int block); */ /** * Send data to a tag and receive the response. * <p> * This method will block until the response is received. It can be canceled * with {@link #close}. * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @param data bytes to send * @return bytes received in response * @throws IOException if the target is lost or connection closed */ @Override public byte[] transceive(byte[] data) throws IOException { try { byte[] response = mTagService.transceive(mTag.getServiceHandle(), data, false); if (response == null) { throw new IOException("transceive failed"); } return response; } catch (RemoteException e) { attemptDeadServiceRecovery(e); throw new IOException("NFC service died"); } } }
core/java/android/nfc/technology/MifareUltralight.java +25 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,31 @@ public final class MifareUltralight extends BasicTagTechnology { return transceive(blockread_cmd); } /** * Send data to a tag and receive the response. * <p> * This method will block until the response is received. It can be canceled * with {@link #close}. * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @param data bytes to send * @return bytes received in response * @throws IOException if the target is lost or connection closed */ @Override public byte[] transceive(byte[] data) throws IOException { try { byte[] response = mTagService.transceive(mTag.getServiceHandle(), data, false); if (response == null) { throw new IOException("transceive failed"); } return response; } catch (RemoteException e) { attemptDeadServiceRecovery(e); throw new IOException("NFC service died"); } } /** * @throws IOException */ Loading
core/java/android/nfc/technology/Ndef.java +5 −0 Original line number Diff line number Diff line Loading @@ -195,4 +195,9 @@ public final class Ndef extends BasicTagTechnology { public void makeLowLevelReadonly() { throw new UnsupportedOperationException(); } @Override public byte[] transceive(byte[] data) { throw new UnsupportedOperationException(); } }