diff options
Diffstat (limited to 'src/com/android/nfc/handover/HandoverManager.java')
-rw-r--r-- | src/com/android/nfc/handover/HandoverManager.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/nfc/handover/HandoverManager.java b/src/com/android/nfc/handover/HandoverManager.java index 9836cdc..51b123c 100644 --- a/src/com/android/nfc/handover/HandoverManager.java +++ b/src/com/android/nfc/handover/HandoverManager.java @@ -657,8 +657,12 @@ public class HandoverManager implements BluetoothProfile.ServiceListener, NdefRecord createBluetoothOobDataRecord() { byte[] payload = new byte[8]; - payload[0] = 0; - payload[1] = (byte)payload.length; + // Note: this field should be little-endian per the BTSSP spec + // The Android 4.1 implementation used big-endian order here. + // No single Android implementation has ever interpreted this + // length field when parsing this record though. + payload[0] = (byte) (payload.length & 0xFF); + payload[1] = (byte) ((payload.length >> 8) & 0xFF); synchronized (HandoverManager.this) { if (mLocalBluetoothAddress == null) { |