diff options
author | Phil Burk <philburk@google.com> | 2020-03-27 17:56:57 -0700 |
---|---|---|
committer | Phil Burk <philburk@google.com> | 2020-03-31 15:40:12 -0700 |
commit | a576959497e78b4094dbe901f39699b8e6326ffe (patch) | |
tree | 4a8a83a21ffdcc0c2394132201f1e3c9792614db | |
parent | 30c2f30f8335c52c691c2231b1eadcfcb1f237db (diff) |
BluetoothMidi: ignore reserved bit in header
The BLE-MIDI spec defines bit 6 as reserved.
The decoder was checking to make sure it was zero.
But that would prevent it from being used in the future.
So now it ignores the reserved bit.
Bug: 149927520
Test: atest BluetoothMidiTests
Change-Id: Ibd2054c4dbf01941da56727b49dec23dc65088c0
-rw-r--r-- | media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothPacketDecoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothPacketDecoder.java b/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothPacketDecoder.java index c51c8fa73c4e..8d18b77700b5 100644 --- a/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothPacketDecoder.java +++ b/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothPacketDecoder.java @@ -70,7 +70,9 @@ public class BluetoothPacketDecoder extends PacketDecoder { } byte header = buffer[0]; - if ((header & 0xC0) != 0x80) { + // Check for the header bit 7. + // Ignore the reserved bit 6. + if ((header & 0x80) != 0x80) { Log.e(TAG, "packet does not start with header"); return; } |