diff options
author | Lorenz Hübschle-Schneider <l.huebschleschneider@gmail.com> | 2012-12-19 15:21:28 +0100 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-12-23 23:19:06 -0800 |
commit | f03967e60de7bf8ee2450e2f130d8d6c509e36e0 (patch) | |
tree | 0e76efa89f4c3bae3d5ac4e2ac7837cf2ffec8a7 /src/com/android/settings/profiles | |
parent | 29c34b5958bd66eac9115b8fc5d177af15c66bd8 (diff) | |
download | packages_apps_settings-f03967e60de7bf8ee2450e2f130d8d6c509e36e0.zip packages_apps_settings-f03967e60de7bf8ee2450e2f130d8d6c509e36e0.tar.gz packages_apps_settings-f03967e60de7bf8ee2450e2f130d8d6c509e36e0.tar.bz2 |
Use API Level 16 method for creating a MIME NDEF record
When writing a profile ID to an NFC tag to have it trigger a profile change,
use the NdefRecord.createMime()-method instead of manually creating the NDEF
record.
Change-Id: Iaa1f105c3f0b46a1d672e96224eafea4fd99d7d5
Diffstat (limited to 'src/com/android/settings/profiles')
-rw-r--r-- | src/com/android/settings/profiles/NFCProfileUtils.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/com/android/settings/profiles/NFCProfileUtils.java b/src/com/android/settings/profiles/NFCProfileUtils.java index 278b0ab..f6461d1 100644 --- a/src/com/android/settings/profiles/NFCProfileUtils.java +++ b/src/com/android/settings/profiles/NFCProfileUtils.java @@ -123,8 +123,7 @@ public class NFCProfileUtils { static NdefMessage getProfileAsNdef(Profile profile) { byte[] profileBytes = NFCProfileUtils.asByteArray(profile.getUuid()); - NdefRecord record = new NdefRecord(NdefRecord.TNF_MIME_MEDIA, - NFCProfile.PROFILE_MIME_TYPE.getBytes(), new byte[] {}, profileBytes); + NdefRecord record = NdefRecord.createMime(NFCProfile.PROFILE_MIME_TYPE, profileBytes); return new NdefMessage(new NdefRecord[] { record }); } } |