From bdc34b8440d1c79fcdb4e075137a528abd630cf5 Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Wed, 10 Jun 2015 08:49:02 +0200 Subject: [PATCH] Make peer LLCP version an int. And split major/minor. Bug: 21343778 Change-Id: Ie9f0ecc9172849d3b088a0c1ce6d872b2f607919 --- api/current.txt | 3 ++- api/system-current.txt | 3 ++- core/java/android/nfc/NfcEvent.java | 13 +++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/api/current.txt b/api/current.txt index e1c83e563723a..3f35e08a51b28 100644 --- a/api/current.txt +++ b/api/current.txt @@ -19642,7 +19642,8 @@ package android.nfc { public final class NfcEvent { field public final android.nfc.NfcAdapter nfcAdapter; - field public final byte peerLlcpVersion; + field public final int peerLlcpMajorVersion; + field public final int peerLlcpMinorVersion; } public final class NfcManager { diff --git a/api/system-current.txt b/api/system-current.txt index 2839f68093cca..2aa137ca98dd0 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -21560,7 +21560,8 @@ package android.nfc { public final class NfcEvent { field public final android.nfc.NfcAdapter nfcAdapter; - field public final byte peerLlcpVersion; + field public final int peerLlcpMajorVersion; + field public final int peerLlcpMinorVersion; } public final class NfcManager { diff --git a/core/java/android/nfc/NfcEvent.java b/core/java/android/nfc/NfcEvent.java index cf1d71a8b5e87..aff4f52f2bab9 100644 --- a/core/java/android/nfc/NfcEvent.java +++ b/core/java/android/nfc/NfcEvent.java @@ -39,13 +39,18 @@ public final class NfcEvent { public final NfcAdapter nfcAdapter; /** - * The LLCP version of the peer associated with the NFC event. - * The major version is in the top nibble, the minor version is in the bottom nibble. + * The major LLCP version number of the peer associated with the NFC event. */ - public final byte peerLlcpVersion; + public final int peerLlcpMajorVersion; + + /** + * The minor LLCP version number of the peer associated with the NFC event. + */ + public final int peerLlcpMinorVersion; NfcEvent(NfcAdapter nfcAdapter, byte peerLlcpVersion) { this.nfcAdapter = nfcAdapter; - this.peerLlcpVersion = peerLlcpVersion; + this.peerLlcpMajorVersion = (peerLlcpVersion & 0xF0) >> 4; + this.peerLlcpMinorVersion = peerLlcpVersion & 0x0F; } }