Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47fc50e5 authored by Nick Pelly's avatar Nick Pelly Committed by Android Git Automerger
Browse files

am a3e4293c: am 163bd407: Merge "Added getType() to NDEF technology class (API...

am a3e4293c: am 163bd407: Merge "Added getType() to NDEF technology class (API part)." into gingerbread

* commit 'a3e4293c':
  Added getType() to NDEF technology class (API part).
parents b300ae40 a3e4293c
Loading
Loading
Loading
Loading
+19 −0
Original line number Original line Diff line number Diff line
@@ -54,9 +54,20 @@ public final class Ndef extends BasicTagTechnology {
    /** @hide */
    /** @hide */
    public static final String EXTRA_NDEF_CARDSTATE = "ndefcardstate";
    public static final String EXTRA_NDEF_CARDSTATE = "ndefcardstate";


    /** @hide */
    public static final String EXTRA_NDEF_TYPE = "ndeftype";

    public static final int UNKNOWN_TAG = 0;
    public static final int TYPE1_TAG = 1;
    public static final int TYPE2_TAG = 2;
    public static final int TYPE3_TAG = 3;
    public static final int TYPE4_TAG = 4;
    public static final int MIFARE_CLASSIC_TAG = 5;

    private final int mMaxNdefSize;
    private final int mMaxNdefSize;
    private final int mCardState;
    private final int mCardState;
    private final NdefMessage mNdefMsg;
    private final NdefMessage mNdefMsg;
    private final int mNdefType;


    /**
    /**
     * Internal constructor, to be used by NfcAdapter
     * Internal constructor, to be used by NfcAdapter
@@ -68,6 +79,7 @@ public final class Ndef extends BasicTagTechnology {
            mMaxNdefSize = extras.getInt(EXTRA_NDEF_MAXLENGTH);
            mMaxNdefSize = extras.getInt(EXTRA_NDEF_MAXLENGTH);
            mCardState = extras.getInt(EXTRA_NDEF_CARDSTATE);
            mCardState = extras.getInt(EXTRA_NDEF_CARDSTATE);
            mNdefMsg = extras.getParcelable(EXTRA_NDEF_MSG);
            mNdefMsg = extras.getParcelable(EXTRA_NDEF_MSG);
            mNdefType = extras.getInt(EXTRA_NDEF_TYPE);
        } else {
        } else {
            throw new NullPointerException("NDEF tech extras are null.");
            throw new NullPointerException("NDEF tech extras are null.");
        }
        }
@@ -91,6 +103,13 @@ public final class Ndef extends BasicTagTechnology {
        throw new UnsupportedOperationException();
        throw new UnsupportedOperationException();
    }
    }


    /**
     * Get NDEF card type
     */
    public int getType() {
        return mNdefType;
    }

    /**
    /**
     * Get maximum NDEF message size in bytes
     * Get maximum NDEF message size in bytes
     */
     */