5555 * MIFARE Classic cards that have been formatted according to the
5656 * MIFARE Application Directory (MAD) specification.
5757 * <li>{@link #KEY_NFC_FORUM} is the well-known key for MIFARE Classic cards that
58- * have been formatted according to the NFC
58+ * have been formatted according to the NXP specification for NDEF on MIFARE Classic.
5959 *
6060 * <p>Implementation of this class on a Android NFC device is optional.
6161 * If it is not implemented, then
6464 * and {@link Ndef#MIFARE_CLASSIC} NDEF tags will also be supported. In either case,
6565 * {@link NfcA} will also be enumerated on the tag, because all MIFARE Classic tags are also
6666 * {@link NfcA}.
67+ *
68+ * <p class="note"><strong>Note:</strong> Methods that perform I/O operations
69+ * require the {@link android.Manifest.permission#NFC} permission.
6770 */
6871public final class MifareClassic extends BasicTagTechnology {
6972 /**
@@ -319,6 +322,8 @@ public int sectorToBlock(int sectorIndex) {
319322 * not be called from the main application thread. A blocked call will be canceled with
320323 * {@link IOException} if {@link #close} is called from another thread.
321324 *
325+ * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
326+ *
322327 * @param sectorIndex index of sector to authenticate, starting from 0
323328 * @param key 6-byte authentication key
324329 * @return true on success, false on authentication failure
@@ -344,6 +349,8 @@ public boolean authenticateSectorWithKeyA(int sectorIndex, byte[] key) throws IO
344349 * not be called from the main application thread. A blocked call will be canceled with
345350 * {@link IOException} if {@link #close} is called from another thread.
346351 *
352+ * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
353+ *
347354 * @param sectorIndex index of sector to authenticate, starting from 0
348355 * @param key 6-byte authentication key
349356 * @return true on success, false on authentication failure
@@ -398,6 +405,8 @@ private boolean authenticate(int sector, byte[] key, boolean keyA) throws IOExce
398405 * not be called from the main application thread. A blocked call will be canceled with
399406 * {@link IOException} if {@link #close} is called from another thread.
400407 *
408+ * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
409+ *
401410 * @param blockIndex index of block to read, starting from 0
402411 * @return 16 byte block
403412 * @throws TagLostException if the tag leaves the field
@@ -418,6 +427,8 @@ public byte[] readBlock(int blockIndex) throws IOException {
418427 * not be called from the main application thread. A blocked call will be canceled with
419428 * {@link IOException} if {@link #close} is called from another thread.
420429 *
430+ * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
431+ *
421432 * @param blockIndex index of block to write, starting from 0
422433 * @param data 16 bytes of data to write
423434 * @throws TagLostException if the tag leaves the field
@@ -445,6 +456,8 @@ public void writeBlock(int blockIndex, byte[] data) throws IOException {
445456 * not be called from the main application thread. A blocked call will be canceled with
446457 * {@link IOException} if {@link #close} is called from another thread.
447458 *
459+ * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
460+ *
448461 * @param blockIndex index of block to increment, starting from 0
449462 * @param value non-negative to increment by
450463 * @throws TagLostException if the tag leaves the field
@@ -471,6 +484,8 @@ public void increment(int blockIndex, int value) throws IOException {
471484 * not be called from the main application thread. A blocked call will be canceled with
472485 * {@link IOException} if {@link #close} is called from another thread.
473486 *
487+ * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
488+ *
474489 * @param blockIndex index of block to decrement, starting from 0
475490 * @param value non-negative to decrement by
476491 * @throws TagLostException if the tag leaves the field
@@ -497,6 +512,8 @@ public void decrement(int blockIndex, int value) throws IOException {
497512 * not be called from the main application thread. A blocked call will be canceled with
498513 * {@link IOException} if {@link #close} is called from another thread.
499514 *
515+ * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
516+ *
500517 * @param blockIndex index of block to copy to
501518 * @throws TagLostException if the tag leaves the field
502519 * @throws IOException if there is an I/O failure, or the operation is canceled
@@ -517,6 +534,8 @@ public void transfer(int blockIndex) throws IOException {
517534 * not be called from the main application thread. A blocked call will be canceled with
518535 * {@link IOException} if {@link #close} is called from another thread.
519536 *
537+ * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
538+ *
520539 * @param blockIndex index of block to copy from
521540 * @throws TagLostException if the tag leaves the field
522541 * @throws IOException if there is an I/O failure, or the operation is canceled
@@ -541,6 +560,8 @@ public void restore(int blockIndex) throws IOException {
541560 * not be called from the main application thread. A blocked call will be canceled with
542561 * {@link IOException} if {@link #close} is called from another thread.
543562 *
563+ * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
564+ *
544565 * @see NfcA#transceive
545566 */
546567 public byte [] transceive (byte [] data ) throws IOException {
0 commit comments