History log of /frameworks/base/media/java/android/media/midi/MidiDeviceService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
acd4321872387212bbd956e134faf22eee4bbadc 11-Jun-2015 Mike Lockwood <lockwood@google.com> MidiDeviceServer: Fix race condition in setting device server's mDeviceInfo

This made it unsafe to open ports on a device from the MidiManager onDeviceOpened callback

Bug: 21760692
Change-Id: I536acdf574a3ccecdb66a8fde87089538e8bb1ef
/frameworks/base/media/java/android/media/midi/MidiDeviceService.java
e0a6ca64fac5bd4f10139321604031816e90adb4 04-Jun-2015 Mike Lockwood <lockwood@google.com> 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
/frameworks/base/media/java/android/media/midi/MidiDeviceService.java
9189f5f0252e1ef3e7d00978ef12e964565dd6f1 10-Apr-2015 Mike Lockwood <lockwood@google.com> Add MidiDeviceInfo.getPortList()

This replaces MidiDeviceInfo.getInputPortInfo() and getOutputPortInfo()

Change-Id: I0a9bc7c34a172a072e86718d465967c6c618fb3b
/frameworks/base/media/java/android/media/midi/MidiDeviceService.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/media/java/android/media/midi/MidiDeviceService.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/media/java/android/media/midi/MidiDeviceService.java
eebc98ff18c1ee92dff3fcd505158ea161d552be 06-Mar-2015 Mike Lockwood <lockwood@google.com> MidiDeviceService: Add getDeviceInfo() accessor method

so service implementations can access their own device info object.

Change-Id: I93e0c449e72d76568d7b4c9f7f7db00a846b5a33
/frameworks/base/media/java/android/media/midi/MidiDeviceService.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/media/java/android/media/midi/MidiDeviceService.java