summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPaul McLean <pmclean@google.com>2014-04-11 21:18:51 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-11 21:18:51 +0000
commitfd7d31087bcd40b825b0eee3058e2298d8648e9f (patch)
tree4fa9258a227f21d6a88ba9133c074cce3f03815f /core
parentd1d7c491601a3fd1547c31606e1b8386db068b9c (diff)
parentdf3614693dd4fe52a116dcd28bd74eae80818a4f (diff)
downloadframeworks_base-fd7d31087bcd40b825b0eee3058e2298d8648e9f.zip
frameworks_base-fd7d31087bcd40b825b0eee3058e2298d8648e9f.tar.gz
frameworks_base-fd7d31087bcd40b825b0eee3058e2298d8648e9f.tar.bz2
Merge "Implement USB Audio across Nexus Devices Fix issues with connecting non-audio USB devices."
Diffstat (limited to 'core')
-rw-r--r--core/java/android/alsa/AlsaDevicesParser.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/core/java/android/alsa/AlsaDevicesParser.java b/core/java/android/alsa/AlsaDevicesParser.java
index 3835942..094c8a2 100644
--- a/core/java/android/alsa/AlsaDevicesParser.java
+++ b/core/java/android/alsa/AlsaDevicesParser.java
@@ -205,14 +205,49 @@ public class AlsaDevicesParser {
return mHasPlaybackDevices;
}
+ public boolean hasPlaybackDevices(int card) {
+ for (int index = 0; index < deviceRecords_.size(); index++) {
+ AlsaDeviceRecord deviceRecord = deviceRecords_.get(index);
+ if (deviceRecord.mCardNum == card &&
+ deviceRecord.mDeviceType == AlsaDeviceRecord.kDeviceType_Audio &&
+ deviceRecord.mDeviceDir == AlsaDeviceRecord.kDeviceDir_Playback) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public boolean hasCaptureDevices() {
return mHasCaptureDevices;
}
+ public boolean hasCaptureDevices(int card) {
+ for (int index = 0; index < deviceRecords_.size(); index++) {
+ AlsaDeviceRecord deviceRecord = deviceRecords_.get(index);
+ if (deviceRecord.mCardNum == card &&
+ deviceRecord.mDeviceType == AlsaDeviceRecord.kDeviceType_Audio &&
+ deviceRecord.mDeviceDir == AlsaDeviceRecord.kDeviceDir_Capture) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public boolean hasMIDIDevices() {
return mHasMIDIDevices;
}
+ public boolean hasMIDIDevices(int card) {
+ for (int index = 0; index < deviceRecords_.size(); index++) {
+ AlsaDeviceRecord deviceRecord = deviceRecords_.get(index);
+ if (deviceRecord.mCardNum == card &&
+ deviceRecord.mDeviceType == AlsaDeviceRecord.kDeviceType_MIDI) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public void scan() {
deviceRecords_.clear();