summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPaul McLean <pmclean@google.com>2014-04-10 16:02:55 -0700
committerPaul McLean <pmclean@google.com>2014-04-11 12:18:44 -0700
commitdf3614693dd4fe52a116dcd28bd74eae80818a4f (patch)
tree234ec132d13abc28462d206361b10b8290e289fb /core
parentc837a451946b64d70ed7c642fbde03c182c28b6f (diff)
downloadframeworks_base-df3614693dd4fe52a116dcd28bd74eae80818a4f.zip
frameworks_base-df3614693dd4fe52a116dcd28bd74eae80818a4f.tar.gz
frameworks_base-df3614693dd4fe52a116dcd28bd74eae80818a4f.tar.bz2
Implement USB Audio across Nexus Devices
Fix issues with connecting non-audio USB devices. https://b.corp.google.com/issue?id=13745966 https://b.corp.google.com/issue?id=8281454 https://b.corp.google.com/issue?id=13751080 https://b.corp.google.com/issue?id=4643412 Change-Id: I1186f69a6c5f50279a1225a77fb5d4f7a8eda3cb
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();