Loading core/java/android/nfc/technology/Ndef.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -47,12 +47,22 @@ public final class Ndef extends BasicTagTechnology { /** @hide */ /** @hide */ public static final String EXTRA_NDEF_MSG = "ndefmsg"; 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 * Internal constructor, to be used by NfcAdapter * @hide * @hide */ */ public Ndef(NfcAdapter adapter, Tag tag, int tech, Bundle extras) throws RemoteException { public Ndef(NfcAdapter adapter, Tag tag, int tech, Bundle extras) throws RemoteException { super(adapter, tag, tech); super(adapter, tag, tech); if (extras != null) { maxNdefSize = extras.getInt(EXTRA_NDEF_MAXLENGTH); } else { maxNdefSize = 0; //TODO: throw exception } } } /** /** Loading Loading @@ -95,7 +105,7 @@ public final class Ndef extends BasicTagTechnology { * Get maximum NDEF message size in bytes * Get maximum NDEF message size in bytes */ */ public int getSize() { public int getSize() { throw new UnsupportedOperationException(); return maxNdefSize; } } /** /** Loading Loading
core/java/android/nfc/technology/Ndef.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -47,12 +47,22 @@ public final class Ndef extends BasicTagTechnology { /** @hide */ /** @hide */ public static final String EXTRA_NDEF_MSG = "ndefmsg"; 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 * Internal constructor, to be used by NfcAdapter * @hide * @hide */ */ public Ndef(NfcAdapter adapter, Tag tag, int tech, Bundle extras) throws RemoteException { public Ndef(NfcAdapter adapter, Tag tag, int tech, Bundle extras) throws RemoteException { super(adapter, tag, tech); super(adapter, tag, tech); if (extras != null) { maxNdefSize = extras.getInt(EXTRA_NDEF_MAXLENGTH); } else { maxNdefSize = 0; //TODO: throw exception } } } /** /** Loading Loading @@ -95,7 +105,7 @@ public final class Ndef extends BasicTagTechnology { * Get maximum NDEF message size in bytes * Get maximum NDEF message size in bytes */ */ public int getSize() { public int getSize() { throw new UnsupportedOperationException(); return maxNdefSize; } } /** /** Loading