History log of /frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
aab4c1ad489a8b62186215d826293e9cbcbaeb85 17-Jun-2016 Mikhail Naganov <mnaganov@google.com> UsbMidiDevice: Clean up terminology and fix comments

When working with physical MIDI devices, an *input* stream is used
for reading from *output* port of the device, and vice versa. Thus,
using "input" and "output" without specifying whether it's a stream
or a port is confusing.

Clarify names of counter variables, and fix a couple of comments
that were incorrect due to this confusion. No functional changes.

Change-Id: If561eaca4bade94e9296d2c703c9fcebc91296e2
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
de2922468be26ab649ee44e7af291d97aebf0701 05-Apr-2016 Phil Burk <philburk@google.com> UsbMidiDevice: fix MIDI flush()

The proxy MidiReceiver in the USB device was not forwarding the flush
command to the event scheduler.

Bug: 25511696
Change-Id: I6a4759b71bc8f9ae3e20aed1238f62a2ed405e24
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
6456a65afed66819b73df7eb605037402b91fc3f 30-Jul-2015 Phil Burk <philburk@google.com> UsbMidiDevice: add timestamps for input events

This will improve the accuracy of recorded MIDI performances.

Bug: 22801515
Change-Id: Ib78bc929224f2f27938c83a815eaa62f6b5f9560
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
6d5a0f916499a69f28b860fd66d09b5025c30450 08-Jun-2015 Mike Lockwood <lockwood@google.com> UsbMidiDevice: Only keep ALSA devices open when device is in use

This should fix contention problems for apps using USB APIs to implement MIDI support

Bug: 20949468
Bug: 21630625
Change-Id: I32b44330ca0310a4693fd56a4b01ad399f82c1c9
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
b6f50d357bd3d4d296be6bb047f5ce93a79cbca1 08-Apr-2015 Mike Lockwood <lockwood@google.com> Add support for flushing MIDI all scheduled MIDI events on a port

Change-Id: I39d7862540d4d4b9e2df1265f9dd253541adb4c2
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
2776133be7ac60dc8d6aea5b12e35449ca331836 31-Mar-2015 Mike Lockwood <lockwood@google.com> Add event scheduling support to USB MIDI Manager code

Change-Id: I9fdaaac35c296acc67ee0cf346b0c7b56bf58393
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
d1b16fe2fb7527eee214898263ec4d6dabbfb0b4 30-Mar-2015 Mike Lockwood <lockwood@google.com> Move MIDI utilities for internal use to com.android.internal.midi package

Change-Id: I7393ae1d4bca61667fb6ee809a7aa22c5c48de56
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
b7ce094c9e546c4a802bd8ce3a43592979a5e3df 25-Mar-2015 Mike Lockwood <lockwood@google.com> MIDI Manager: remove USB peripheral MIDI device when USB is disconnected

Otherwise, the MIDI device would appear available always, rather than
only when USB is connected.

Also fixed file descriptor leak in UsbMidiDevice

Change-Id: I0d38e81c488de4748eef36ca359635fa59e0e636
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
81b9f7d325a552c54e793b51f571ae3d65b26e94 11-Mar-2015 Mike Lockwood <lockwood@google.com> Add MidiManager to public API

Also made some small API changes based on feedback from the lint tool.

Change-Id: Ibcf1e9107d86d3a364f811ce47a13aa0da653366
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
f2cd8024028f602a5e4c27f3d9222e872e4e84f2 11-Mar-2015 Mike Lockwood <lockwood@google.com> MidiDeviceInfo meta-data improvements:

Add property for user visible device name
Add names for input and output ports
Rename "model" to "product" to match USB specification.

Change-Id: I8dc50da935f26825ffc73de456d34e7933aa987c
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
5ff9e2a1719f78cddc7a23d6572ab15ab595dafd 09-Mar-2015 Mike Lockwood <lockwood@google.com> MidiManager: Add MIDI device status notifications

MidiManager clients can be notified of device status changes via a new MidiDeviceStatus object.
MidiDeviceStatus contains the busy status of the device's input ports and number of
connections to the output ports.
MidiDeviceService now has an optional callback for receiving notifications when its ports change as well.

Change-Id: I1600df4464d82724bc026c27b9633ae9c412d3f0
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
0c7342f0153076c88ba8e6a1647999c248787906 09-Mar-2015 Mike Lockwood <lockwood@google.com> Add MidiReceiver.send() and MidiReceiver.getMaxMessageSize()

Change-Id: I10d4f5e2400fcaf41f455e56ca25bbc0c781a042
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
3b7664589be22ddad34b72e11ced937d48660ebb 04-Mar-2015 Mike Lockwood <lockwood@google.com> Make MidiSender and MidiReceiver abstract classes, rename MidiReceiver.post() to receive()

Change-Id: I1cef3bd48ca0acf2968c9de223f78445f3434404
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
20821ecbe81ba52b260ae232096bc2bfb3e92ad0 24-Feb-2015 Mike Lockwood <lockwood@google.com> Eliminate MidiPort base class for MidiInputPort and MidiOutputPort

Change-Id: I628c0468ac980eee909add53a4d6e55e9b358603
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
11fd96d6ff25bc1d710448eab545fe09da55a5f5 02-Mar-2015 Mike Lockwood <lockwood@google.com> MidiManager: Virtual MIDI devices are now implemented as Services

To implement a virtual MIDI device, include a subclass of MidiDeviceService in
your application. This service is identified by an intent filter and meta-data
in the application's manifest to allow the MIDI manager to register the virtual device
without actually running the application. Instead, the application's MidiDeviceService
subclass is started on demand when MIDI manager clients want to open the device.

Here is an example of how the MidiDeviceService might be described in the application manifest:

<service android:name="VirtualDeviceService">
<intent-filter>
<action android:name="android.media.midi.MidiDeviceService" />
</intent-filter>
<meta-data android:name="android.media.midi.MidiDeviceService"
android:resource="@xml/device_info" />
</service>

and the device_info.xml meta-data:

<devices>
<device manufacturer="Sample Manufacturer" model="Sample Model" private="false">
<input-port name="my input port" />
<output-port name="my output port" />
</device>
</devices>

(note that the <input-port> and <output-port> names are not currently used, but support for these
will be added in a subsequent change)

Client's of the virtual device will bind directly to the hosting application's MidiDeviceService subclass.
To support this, MidiManager.openDevice() now returns the MidiDevice asynchronously via a callback.

This change also adds a utility class called MidiDispatcher, which is a MidiReceiver
that dispatches all data it receives to a list of other MidiReceivers.
We now use this internally in MidiInputPort and MidiDeviceServer, but developers
may use it for other purposes as well.

Change-Id: Ic3009f06d56f3d5edbd87de3f0c330b51a1c217d
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
b673770f7172d4fca9bc05de1f36bc53e93eb247 20-Feb-2015 Mike Lockwood <lockwood@google.com> Add MIDI Manager API tweaks:

- Change the package name from android.midi to android.media.midi

- Add option for specifying a Handler for DeviceCallback notifications

Change-Id: Ia9e9817a651c06299f4e02ee1da3c9666ff64cb9
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
90b9a6a4ab30fc162aee71b4dc484b3839534369 12-Feb-2015 Mike Lockwood <lockwood@google.com> MidiManager API tweaks:

Rename MidiReceiver.onPost() to post()

Change MidiManager.DeviceCallback from an interface to a class

Change-Id: I939ba7a7d82e721b90a3d80252a88e7a650c9396
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
2a57bc7fd602853dc1a22dcee1ff50f92cc29060 19-Sep-2014 Mike Lockwood <lockwood@google.com> MidiManager: Add USB peripheral MIDI support

This allows the android device to appear as a USB MIDI device to
a USB host (like a Mac or a PC) using the f_midi USB gadget driver.

Change-Id: I14f1ba73bcce2c894e77efb8810beac4ffe246d8
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
cb096273734d96f4676014fa9030b57ea48b58d8 27-Jan-2015 Mike Lockwood <lockwood@google.com> MIDI Manager: Remove message packetization from MIDI transport

Instead of attempting to package exactly one MIDI message in each call to
MidiReceiver.onPost(), we now pass messages as a raw stream of bytes.
This means we may now receive multiple MIDI messages in MidiReceiver.onPost().

We make this change to avoid the complexity of taking the single message approach
with SysEx and realtime messages. This shifts some of the burden of parsing
MIDI messages to the client application. But the parsing is best handled in the
application anyway, rather than having the framework impose its own policy
on how the messages are parsed.

Change-Id: Idb6c200037f827cc618bc7d9455a7aa864b494a7
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
98cc8e5a6473b3a5802d97cc81020ec4e3cd23f3 15-Jan-2015 Mike Lockwood <lockwood@google.com> MidiManager bug fixing:

- fix off by one error that caused failure handling one byte messages

- poll thread now terminates properly in UsbMidiDevice

- fix cleanup logic in MidiDeviceServer

Change-Id: I0c13a98b6542cfb271b51678e81d1822c8da2985
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java
10024b3dc12a8552c1547b67810c77b865045cc8 11-Dec-2014 Mike Lockwood <lockwood@google.com> MidiManager updates:

MIDI ports are now implemented as file descriptors directly between the sender
and receiver, so the MidiService is no longer in the message path.

To facilitate the above, each port has its own file descriptor, rather than multiplexing
all ports on a device through a single socket.

Added a new class MidiDeviceServer, which is used by implementors of MIDI devices.
This replaces the MidiVirtualDevice class (which only was included in changes that were reviewed but never submitted).

The USB MIDI implementation has moved from the MIDI service to the USB service.
The USB MIDI implementation uses MidiDeviceServer as its interface, so we now have a common
interface for all MIDI device implementations.

Change-Id: I8effd1583f344beb6c940c3a24dbf20b477a6436
/frameworks/base/services/usb/java/com/android/server/usb/UsbMidiDevice.java