diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2014-12-22 18:55:39 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-12-22 18:55:40 +0000 |
commit | 996af72b0c2c161e66cee00560e5ba00459f39bf (patch) | |
tree | 471a0401b93407f7490709f5713f9169022cc1cf /media/java | |
parent | 2c8c47daefc881c5603689be39b10cb93a0cabdf (diff) | |
parent | 43bcd8fa74711dddfc27d696e7b9c0a9c4beff08 (diff) | |
download | frameworks_base-996af72b0c2c161e66cee00560e5ba00459f39bf.zip frameworks_base-996af72b0c2c161e66cee00560e5ba00459f39bf.tar.gz frameworks_base-996af72b0c2c161e66cee00560e5ba00459f39bf.tar.bz2 |
Merge "AudioRecord: filter attributes" into lmp-mr1-dev
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioRecord.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java index ce78bb6..de10ef9 100644 --- a/media/java/android/media/AudioRecord.java +++ b/media/java/android/media/AudioRecord.java @@ -273,18 +273,23 @@ public class AudioRecord mInitializationLooper = Looper.getMainLooper(); } - mAudioAttributes = attributes; - // is this AudioRecord using REMOTE_SUBMIX at full volume? - if (mAudioAttributes.getCapturePreset() == MediaRecorder.AudioSource.REMOTE_SUBMIX) { - final Iterator<String> tagsIter = mAudioAttributes.getTags().iterator(); + if (attributes.getCapturePreset() == MediaRecorder.AudioSource.REMOTE_SUBMIX) { + final AudioAttributes.Builder filteredAttr = new AudioAttributes.Builder(); + final Iterator<String> tagsIter = attributes.getTags().iterator(); while (tagsIter.hasNext()) { - if (tagsIter.next().equalsIgnoreCase(SUBMIX_FIXED_VOLUME)) { + final String tag = tagsIter.next(); + if (tag.equalsIgnoreCase(SUBMIX_FIXED_VOLUME)) { mIsSubmixFullVolume = true; Log.v(TAG, "Will record from REMOTE_SUBMIX at full fixed volume"); - break; + } else { // SUBMIX_FIXED_VOLUME: is not to be propagated to the native layers + filteredAttr.addTag(tag); } } + filteredAttr.setInternalCapturePreset(attributes.getCapturePreset()); + mAudioAttributes = filteredAttr.build(); + } else { + mAudioAttributes = attributes; } int rate = 0; |