Commit Graph

20 Commits

Author SHA1 Message Date
Phil Burk
f765984c69 Bluetooth MIDI test: flush packets
The simulation of the device timing was not very accurate.
That caused two encoder tests to fail:
testTwoNoteOnsTwoChannels and testTwoNoteOnsSameChannel.

This patch simulates a delayed completion
and is more accurate.

Bug: 35669198
Test: atest BluetoothMidiTests

Change-Id: I8d04900a792ffc29928ed0e358536f8d961bcb77
2020-05-04 23:54:25 +00:00
Phil Burk
678847b3af BluetoothMidiService: remove java_api_finder tag
This was an unintentional build artifact that
was causing Mainline tests to fail.

Bug: 154289918
Test: dashboard mentioned in the bug should start passing
Change-Id: I09934abb3e0c785144aa6ca557592542354c69b4
2020-04-29 16:28:23 -07:00
TreeHugger Robot
7bfa49bf27 Merge "BluetoothMidi test: test encoder and decoder" into rvc-dev 2020-04-04 03:46:15 +00:00
Phil Burk
6c0aff044d BluetoothMidi test: test encoder and decoder
Also test MidiFramer
Add end-to-end test through encoder and decoder.
Add test for reserved bit in header.

Bug: 35669198
Bug: 140638458
Bug: 149927520
Test: atest BluetoothMidiTests
Change-Id: I767deab6847d2b45e01bed29f5eed3df0f0e46c0
Merged-In: I767deab6847d2b45e01bed29f5eed3df0f0e46c0
2020-04-04 00:43:20 +00:00
Phil Burk
a576959497 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
2020-03-31 15:40:12 -07:00
Phil Burk
51aaf2e89e BLE-MIDI: fix timestamps for sysex data
Blocks of data in the middle of a SysEx used to get a zero timestamp.
Now they get a proper timestamp.

Thanks to Teenage Engineering for suggesting this fix.

I also cleaned up the code to make it easier to understand.

Bug: 140638458
Test: Send long, >50 byte, SysEx over BLE to an Android
Test: device running the MIDI scope. Check timestamps
Test: for the data blocks. See bug for more details.
Change-Id: I1a553d54cc76025f854e53229d233a033ab7c297
Merged-In: I1a553d54cc76025f854e53229d233a033ab7c297
(cherry picked from commit 5664e50ac9)
2020-03-26 19:04:46 +00:00
Sasha Smundak
c3d9efbe3a Convert Android.mk file to Android.bp
See build/soong/README.md for more information.
NOTE: MediaFrameworkTest/, MtpTests/, NativeMidiDemo/ have to be fixed in
internal master first.

Bug: 122332340
Test: treehugger
Change-Id: I7451696b2fc3f1384e255e35280e66850f3f01a3
2019-03-12 11:30:43 -07:00
Anton Hansson
a3e79fbb8c frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: Ibcffec873a693d1c792ca210fb597d2bf37e9068
Merged-In: I4233b9091d9066c4fa69f3d24aaf367ea500f760
2018-02-28 17:15:21 +00:00
Phil Burk
1f99a3277b BluetoothMidi: request higher priority, for lower latency
Request a higher connection priority.
This will result in a Connection Interval below 15 msec
vs 45 msec for some devices.

Fix: 34710538
Test: Connect a BLE-MIDI device using the MIDI+BTLE test app. See bug.
Change-Id: I846a76a36c864f82969173a94d86b05059a786ad
Signed-off-by: Phil Burk <philburk@google.com>
2017-04-14 14:16:39 -07:00
Phil Burk
94ec584bed bluetoothmidiservice: fix timestamp for BLE-MIDI transmitted packets
Transmitted packets that contained multiple MIDI messages and that did not
use running status were missing a timestamp! This CL fixes that bug.

Bug: 34708799
Test: a manual test using MidiMatrix is described in the bug report
Change-Id: Iddb55e01c60625787c5907fe8e4b202ef1415e59
Signed-off-by: Phil Burk <philburk@google.com>
2017-02-21 16:15:33 -08:00
Phil Burk
f7781b913b Merge "BluetoothMidiDevice: change write type to support JamStik" 2015-09-22 22:11:53 +00:00
Phil Burk
95129f50c6 BluetoothMidiDevice: change write type to support JamStik
Temporarily use a Request instead of a Command so that the JamStik
will be properly enabled.

Bug: 24207964
Change-Id: I3d11732958c46e6039405b5969d5af0db8032fb9
Signed-off-by: Phil Burk <philburk@google.com>
2015-09-22 12:30:52 -07:00
Phil Burk
7cd06c0b9e BLE-MIDI: change binding for BluetoothMidiService
Add a remote call addBluetoothDevice() using AIDL.
This was needed because onBind() is only called once.

Bug: 23219556
Bug: 23760886
Change-Id: Id7554ca55d596352d11dbd6ae3e403138a29c864
Signed-off-by: Phil Burk <philburk@google.com>
2015-09-08 13:48:16 -07:00
Phil Burk
e5f722e55c MidiBluetoothService: add new device to HashMap
The HashMap is being used but devices never added to the map.

Bug: 23429459
Change-Id: I1da5305a56f5bd48e1c5d9345e721ea8dd2eed4e
Signed-off-by: Phil Burk <philburk@google.com>
2015-08-25 23:15:17 +00:00
Mike Lockwood
e0a6ca64fa MidiManager: proxy all requests to open devices through MidiService
Previously when a MidiManager client opened a virtual or Bluetooth device,
the client bound directly to the virtual device's MidiDeviceService
or BluetoothMidiDevice's IMidiDeviceServer for the given BluetoothDevice.
Only USB devices were opened in MidiService.

Now opening any type of MIDI device is done via IMidiManager.openDevice() or
IMidiManager.openBluetoothDevice().  MidiService tracks all connnections between
clients and devices.

Services that implement virtual devices must now require android.permission.BIND_MIDI_DEVICE_SERVICE
so only MidiService can bind to these services.

Bug: 21044677

Change-Id: I7172f7b1e0cbfe4a2a87dff376c32dc9b41aa563
2015-06-04 19:16:23 -07:00
Mike Lockwood
7eb441cb4a MidiManager: Address API Council feedback:
Rename MidiDeviceInfo.getPortList() to getPorts()

Rename MidiManager.getDeviceList() to getDevices()

Rename MidiReceiver.onReceive() to onSend()

Replace MidiManager.DeviceOpenCallback and BluetoothOpenCallback
with new interface MidiManager.OnDeviceOpenedListener

Add MidiSender.onConnect() and onDisconnect()

Add MidiReceiver.onFlush()

Ensure that MidiReceiver max message size is immutable

Bug: 21044677
Change-Id: I7711734a45e831e9744849a6f569e906feff9f80
2015-05-12 13:39:56 -07:00
Mike Lockwood
9490eae3aa BluetoothMidiDevice: Cleanup and error handling improvements
Change-Id: I8b932f73e0230adfe576d1fc6735bd7b41e84010
2015-05-07 13:39:01 -07:00
Mike Lockwood
8c26d843a7 BluetoothMidiService: Add support for sending SysEx messages that span multiple Bluetooth packets
Change-Id: Id56f7c82ec97b6a46258111bbfd46ab1dc14dfe9
2015-05-01 16:16:42 -07:00
Mike Lockwood
ff001809f6 BluetoothMidiService: Use MidiBtleTimeTracker to interpret incoming Bluetooth MIDI timestamps
Also fixed some problems handling timestamp wrapping.

Change-Id: Ic0aefc54f2560425bea6d07ca0c4529d16699eaa
2015-04-21 13:28:08 -07:00
Mike Lockwood
f0a41d1c59 Add support for Bluetooth MIDI devices
The Bluetooth MIDI devices are handled in the BluetoothMidiService APK.
Apps wishing to connect to Bluetooth MIDI devices call MidiManager.openBluetoothDevice()
which binds to BluetoothMidiService in a similar way as virtual devices are implemented.

Change-Id: Ie3fbca757928fd7873a009f9bf9e0ce0be487da6
2015-04-09 11:49:51 -07:00