Merge "android.media.AudioRecord.Builder: no "capture preset"" into mnc-dev
diff --git a/api/current.txt b/api/current.txt
index fe16844..40bc4e9 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -15029,8 +15029,8 @@
     ctor public AudioRecord.Builder();
     method public android.media.AudioRecord build() throws java.lang.UnsupportedOperationException;
     method public android.media.AudioRecord.Builder setAudioFormat(android.media.AudioFormat) throws java.lang.IllegalArgumentException;
+    method public android.media.AudioRecord.Builder setAudioSource(int) throws java.lang.IllegalArgumentException;
     method public android.media.AudioRecord.Builder setBufferSizeInBytes(int) throws java.lang.IllegalArgumentException;
-    method public android.media.AudioRecord.Builder setCapturePreset(int) throws java.lang.IllegalArgumentException;
   }
 
   public static abstract interface AudioRecord.OnRecordPositionUpdateListener {
diff --git a/api/system-current.txt b/api/system-current.txt
index b23efa9..485888a 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -16250,8 +16250,8 @@
     method public android.media.AudioRecord build() throws java.lang.UnsupportedOperationException;
     method public android.media.AudioRecord.Builder setAudioAttributes(android.media.AudioAttributes) throws java.lang.IllegalArgumentException;
     method public android.media.AudioRecord.Builder setAudioFormat(android.media.AudioFormat) throws java.lang.IllegalArgumentException;
+    method public android.media.AudioRecord.Builder setAudioSource(int) throws java.lang.IllegalArgumentException;
     method public android.media.AudioRecord.Builder setBufferSizeInBytes(int) throws java.lang.IllegalArgumentException;
-    method public android.media.AudioRecord.Builder setCapturePreset(int) throws java.lang.IllegalArgumentException;
     method public android.media.AudioRecord.Builder setSessionId(int) throws java.lang.IllegalArgumentException;
   }
 
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java
index c720e2a..216d9b9 100644
--- a/media/java/android/media/AudioRecord.java
+++ b/media/java/android/media/AudioRecord.java
@@ -246,8 +246,8 @@
      * Though some invalid parameters will result in an {@link IllegalArgumentException} exception,
      * other errors do not.  Thus you should call {@link #getState()} immediately after construction
      * to confirm that the object is usable.
-     * @param audioSource the recording source (also referred to as capture preset).
-     *    See {@link MediaRecorder.AudioSource} for the capture preset definitions.
+     * @param audioSource the recording source.
+     *   See {@link MediaRecorder.AudioSource} for the recording source definitions.
      * @param sampleRateInHz the sample rate expressed in Hertz. 44100Hz is currently the only
      *   rate that is guaranteed to work on all devices, but other rates such as 22050,
      *   16000, and 11025 may work on some devices.
@@ -285,8 +285,8 @@
      * @hide
      * Class constructor with {@link AudioAttributes} and {@link AudioFormat}.
      * @param attributes a non-null {@link AudioAttributes} instance. Use
-     *     {@link AudioAttributes.Builder#setCapturePreset(int)} for configuring the capture
-     *     preset for this instance.
+     *     {@link AudioAttributes.Builder#setAudioSource(int)} for configuring the audio
+     *     source for this instance.
      * @param format a non-null {@link AudioFormat} instance describing the format of the data
      *     that will be recorded through this AudioRecord. See {@link AudioFormat.Builder} for
      *     configuring the audio format parameters such as encoding, channel mask and sample rate.
@@ -394,14 +394,14 @@
     /**
      * Builder class for {@link AudioRecord} objects.
      * Use this class to configure and create an <code>AudioRecord</code> instance. By setting the
-     * recording preset (a.k.a. recording source) and audio format parameters, you indicate which of
-     *  those vary from the default behavior on the device.
+     * recording source and audio format parameters, you indicate which of
+     * those vary from the default behavior on the device.
      * <p> Here is an example where <code>Builder</code> is used to specify all {@link AudioFormat}
      * parameters, to be used by a new <code>AudioRecord</code> instance:
      *
      * <pre class="prettyprint">
      * AudioRecord recorder = new AudioRecord.Builder()
-     *         .setCapturePreset(MediaRecorder.AudioSource.VOICE_COMMUNICATION)
+     *         .setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION)
      *         .setAudioFormat(new AudioFormat.Builder()
      *                 .setEncoding(AudioFormat.ENCODING_PCM_16BIT)
      *                 .setSampleRate(32000)
@@ -411,7 +411,7 @@
      *         .build();
      * </pre>
      * <p>
-     * If the capture preset is not set with {@link #setCapturePreset(int)},
+     * If the audio source is not set with {@link #setAudioSource(int)},
      * {@link MediaRecorder.AudioSource#DEFAULT} is used.
      * <br>If the audio format is not specified or is incomplete, its sample rate will be the
      * default output sample rate of the device (see
@@ -433,18 +433,18 @@
         }
 
         /**
-         * @param preset the capture preset (also referred to as the recording source).
-         * See {@link MediaRecorder.AudioSource} for the supported capture preset definitions.
+         * @param source the audio source.
+         * See {@link MediaRecorder.AudioSource} for the supported audio source definitions.
          * @return the same Builder instance.
          * @throws IllegalArgumentException
          */
-        public Builder setCapturePreset(int preset) throws IllegalArgumentException {
-            if ( (preset < MediaRecorder.AudioSource.DEFAULT) ||
-                    (preset > MediaRecorder.getAudioSourceMax()) ) {
-                throw new IllegalArgumentException("Invalid audio source " + preset);
+        public Builder setAudioSource(int source) throws IllegalArgumentException {
+            if ( (source < MediaRecorder.AudioSource.DEFAULT) ||
+                    (source > MediaRecorder.getAudioSourceMax()) ) {
+                throw new IllegalArgumentException("Invalid audio source " + source);
             }
             mAttributes = new AudioAttributes.Builder()
-                    .setInternalCapturePreset(preset)
+                    .setInternalCapturePreset(source)
                     .build();
             return this;
         }
diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java
index 206c171..f27e635 100644
--- a/media/java/android/media/MediaRecorder.java
+++ b/media/java/android/media/MediaRecorder.java
@@ -185,9 +185,9 @@
     /**
      * Defines the audio source.
      * An audio source defines both a default physical source of audio signal, and a recording
-     * configuration; it's also known as a capture preset. These constants are for instance used
+     * configuration. These constants are for instance used
      * in {@link MediaRecorder#setAudioSource(int)} or
-     * {@link AudioRecord.Builder#setCapturePreset(int)}.
+     * {@link AudioRecord.Builder#setAudioSource(int)}.
      */
     public final class AudioSource {