History log of /frameworks/base/media/java/android/media/midi/MidiManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c53962d4ede82a03b62f0c8bb86bd0da090a15eb 02-Mar-2016 Jeff Sharkey <jsharkey@android.com> When system server goes down, crash apps more.

Apps making calls into the system server may end up persisting
internal state or making security decisions based on the perceived
success or failure of a call, or the default values returned.

The reality is that if the system process just died, init will be
along shortly to kill all running apps, so we should have no problem
rethrowing the RemoteException as a RuntimeException.

Bug: 27364859
Change-Id: Ife0bcb079636c88d54c44d17eb580409fd79028b
/frameworks/base/media/java/android/media/midi/MidiManager.java
b2355940e3e697deeecd1b6511cd5094f9dc553a 06-Aug-2015 Phil Burk <philburk@google.com> MidiService: update listener with current status when registered

This will give an app an opportunity to learn whether an input port is busy
before the user tries to connect and then fails.

Bug: 22825043
Change-Id: Ifede60f166dfe66ea15453044fce06f4a8452b18
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/base/media/java/android/media/midi/MidiManager.java
0ca998d79fe95ded26ec4ff0a1e0a8dc4802684b 22-Aug-2015 Phil Burk <philburk@google.com> MidiManager: fix double BTLE callback

Stop openBluetoothDevice() from calling its callback twice.

Bug: 23218338
Change-Id: I2e738b22a124c0336c46bef05680a82ee1f59e79
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/base/media/java/android/media/midi/MidiManager.java
a95faf78bf810e0b4eb3cb211c414bfbbd1a8061 05-Aug-2015 Phil Burk <philburk@google.com> MidiManager: use ConcurrentHashMap

So that adding and removing device listeners is thread-safe.

Bug: 22909752
Change-Id: I1369ab53c865b54e6e5eb8ea3e8d437fdd1d7197
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/base/media/java/android/media/midi/MidiManager.java
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/MidiManager.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/MidiManager.java
7eb441cb4abcd3230a4d243469c5044f49e707c8 12-May-2015 Mike Lockwood <lockwood@google.com> 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
/frameworks/base/media/java/android/media/midi/MidiManager.java
f0a41d1c591193fbe02c9ddbaf24c79af4da9972 24-Mar-2015 Mike Lockwood <lockwood@google.com> 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
/frameworks/base/media/java/android/media/midi/MidiManager.java
9db9326ad47279709a0f7989addaf4b45221b6b9 04-Apr-2015 Mike Lockwood <lockwood@google.com> Add MidiManager and MidiDevice classes to public API.

Somehow we missed these two when we made the rest of the MIDI Manager public

Change-Id: I08e94762e155aa6a7f98bd05b363aee5e4744061
/frameworks/base/media/java/android/media/midi/MidiManager.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/media/java/android/media/midi/MidiManager.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/MidiManager.java
be215dd57282888b05b234c39bba44cc0a864b8a 07-Mar-2015 Mike Lockwood <lockwood@google.com> MIDI Manager changes:

Add CloseGuard support to MidiDevice and MidiDeviceServer
Make MidiDevice.close() thread safe
Make non-subclassable API classes final
Other misc cleanup

Change-Id: I7a5d31b06b8c2403cfbc5597c5c1395f0ac90194
/frameworks/base/media/java/android/media/midi/MidiManager.java
35110d1ed72ee7fe687125831b4dd91b87b515ee 05-Mar-2015 Mike Lockwood <lockwood@google.com> Add MidiDevice.close() method so we can clean up our ServiceConnection

Change-Id: I65cd4cfd940b02709daeffef6dab814305b8a6b0
/frameworks/base/media/java/android/media/midi/MidiManager.java
c623ec973b5e8d1fd2ff4162d5de8701a6490121 05-Mar-2015 Mike Lockwood <lockwood@google.com> Merge "MidiManager: Virtual MIDI devices are now implemented as Services"
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/MidiManager.java
08c7116ab9cd04ad6dd3c04aa1017237e7f409ac 28-Feb-2015 John Spurlock <jspurlock@google.com> Remove unused imports in frameworks/base.

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