summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorPhil Burk <philburk@google.com>2015-08-05 23:32:54 -0700
committerPhil Burk <philburk@google.com>2015-10-12 20:59:57 +0000
commite39def480fd2d1bcc3a89751dd492d4634c38194 (patch)
treecbe9cf6a2e94de0985bd8217b015c7efe1c36af0 /media
parentc83a6121d214631c0a52be5b2c5c8ce2f6470ed0 (diff)
downloadframeworks_base-e39def480fd2d1bcc3a89751dd492d4634c38194.zip
frameworks_base-e39def480fd2d1bcc3a89751dd492d4634c38194.tar.gz
frameworks_base-e39def480fd2d1bcc3a89751dd492d4634c38194.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