summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorPhil Burk <philburk@google.com>2015-08-05 23:32:54 -0700
committerSteve Kondik <shade@chemlab.org>2015-11-10 10:57:07 -0800
commit6427a1534f48b732cea0f93cc1a15c9c02f86b0e (patch)
treea4d4796bc31c2b7fde8441c9287969178b482120 /media
parentecb6fdda826485fee45ee1c73cf3941bc1e490f6 (diff)
downloadframeworks_base-6427a1534f48b732cea0f93cc1a15c9c02f86b0e.zip
frameworks_base-6427a1534f48b732cea0f93cc1a15c9c02f86b0e.tar.gz
frameworks_base-6427a1534f48b732cea0f93cc1a15c9c02f86b0e.tar.bz2
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> (cherry picked from commit b2355940e3e697deeecd1b6511cd5094f9dc553a)
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/midi/MidiManager.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/java/android/media/midi/MidiManager.java b/media/java/android/media/midi/MidiManager.java
index 7197dc0..29863d4 100644
--- a/media/java/android/media/midi/MidiManager.java
+++ b/media/java/android/media/midi/MidiManager.java
@@ -169,6 +169,13 @@ public final class MidiManager {
/**
* Registers a callback to receive notifications when MIDI devices are added and removed.
*
+ * The {@link DeviceCallback#onDeviceStatusChanged} method will be called immediately
+ * for any devices that have open ports. This allows applications to know which input
+ * ports are already in use and, therefore, unavailable.
+ *
+ * Applications should call {@link #getDevices} before registering the callback
+ * to get a list of devices already added.
+ *
* @param callback a {@link DeviceCallback} for MIDI device notifications
* @param handler The {@link android.os.Handler Handler} that will be used for delivering the
* device notifications. If handler is null, then the thread used for the