Fix NdefRecord flags handling.

NdefMessages created from byte arrays set the wrong flags on
NdefRecord: every record had at least FLAG_MB|FLAG_ME set, instead of actually
setting the flags from the byte-stream itself. Fixed by creating an internal
constructor which can take the flags.

Public constructor remains the same, as we don't want to bother application
writers with these flags - they can be inferred from the context in which the
record is used. Getting the flags is not a public operation on an NdefRecord
either. However, applications can get the byte[] representation and it
is reasonable for them to expect the flags byte to be set correctly.

Change-Id: Ic32411688dd092c55b1aeccbba9635792e15a671
3 files changed