File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
core/java/android/nfc/technology Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -47,12 +47,22 @@ public final class Ndef extends BasicTagTechnology {
4747 /** @hide */
4848 public static final String EXTRA_NDEF_MSG = "ndefmsg" ;
4949
50+ /** @hide */
51+ public static final String EXTRA_NDEF_MAXLENGTH = "ndefmaxlength" ;
52+
53+ private final int maxNdefSize ;
54+
5055 /**
5156 * Internal constructor, to be used by NfcAdapter
5257 * @hide
5358 */
5459 public Ndef (NfcAdapter adapter , Tag tag , int tech , Bundle extras ) throws RemoteException {
5560 super (adapter , tag , tech );
61+ if (extras != null ) {
62+ maxNdefSize = extras .getInt (EXTRA_NDEF_MAXLENGTH );
63+ } else {
64+ maxNdefSize = 0 ; //TODO: throw exception
65+ }
5666 }
5767
5868 /**
@@ -95,7 +105,7 @@ public NdefMessage[] getExtraNdefMessage() throws IOException, FormatException {
95105 * Get maximum NDEF message size in bytes
96106 */
97107 public int getSize () {
98- throw new UnsupportedOperationException () ;
108+ return maxNdefSize ;
99109 }
100110
101111 /**
You can’t perform that action at this time.
0 commit comments