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

Commit 8abce7f5 authored by Nick Pelly's avatar Nick Pelly Committed by Android Git Automerger
Browse files

am 40ddd4a6: Merge "Implemented getSize() to return max ndef size." into gingerbread

* commit '40ddd4a6':
  Implemented getSize() to return max ndef size.
parents 2f3ed791 40ddd4a6
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -47,12 +47,22 @@ public final class Ndef extends BasicTagTechnology {
    /** @hide */
    public static final String EXTRA_NDEF_MSG = "ndefmsg";

    /** @hide */
    public static final String EXTRA_NDEF_MAXLENGTH = "ndefmaxlength";

    private final int maxNdefSize;

    /**
     * Internal constructor, to be used by NfcAdapter
     * @hide
     */
    public Ndef(NfcAdapter adapter, Tag tag, int tech, Bundle extras) throws RemoteException {
        super(adapter, tag, tech);
        if (extras != null) {
            maxNdefSize = extras.getInt(EXTRA_NDEF_MAXLENGTH);
        } else {
            maxNdefSize = 0;  //TODO: throw exception
        }
    }

    /**
@@ -95,7 +105,7 @@ public final class Ndef extends BasicTagTechnology {
     * Get maximum NDEF message size in bytes
     */
    public int getSize() {
        throw new UnsupportedOperationException();
        return maxNdefSize;
    }

    /**