am 1e62e476: am ce4483cb: [FM] Add FM_TUNER audio source to support L version FM radio app

* commit '1e62e476fa6600dbf8dd82a428efb424a9938177':
  [FM] Add FM_TUNER audio source to support L version FM radio app
This commit is contained in:
Benson Huang
2014-10-06 18:58:35 +00:00
committed by Android Git Automerger
3 changed files with 13 additions and 3 deletions

View File

@@ -518,14 +518,15 @@ public final class AudioAttributes implements Parcelable {
/**
* @hide
* Same as {@link #setCapturePreset(int)} but authorizes the use of HOTWORD and
* REMOTE_SUBMIX.
* Same as {@link #setCapturePreset(int)} but authorizes the use of HOTWORD,
* REMOTE_SUBMIX and FM_TUNER.
* @param preset
* @return the same Builder instance.
*/
public Builder setInternalCapturePreset(int preset) {
if ((preset == MediaRecorder.AudioSource.HOTWORD)
|| (preset == MediaRecorder.AudioSource.REMOTE_SUBMIX)) {
|| (preset == MediaRecorder.AudioSource.REMOTE_SUBMIX)
|| (preset == MediaRecorder.AudioSource.FM_TUNER)) {
mSource = preset;
} else {
setCapturePreset(preset);

View File

@@ -351,6 +351,7 @@ public class AudioRecord
// audio source
if ( (audioSource < MediaRecorder.AudioSource.DEFAULT) ||
((audioSource > MediaRecorder.getAudioSourceMax()) &&
(audioSource != MediaRecorder.AudioSource.FM_TUNER) &&
(audioSource != MediaRecorder.AudioSource.HOTWORD)) ) {
throw new IllegalArgumentException("Invalid audio source.");
}

View File

@@ -221,6 +221,14 @@ public class MediaRecorder
*/
public static final int REMOTE_SUBMIX = 8;
/**
* Audio source for FM, which is used to capture current FM tuner output by FMRadio app.
* There are two use cases, one is for record FM stream for later listening, another is
* for FM indirect mode(the routing except FM to headset(headphone) device routing).
* @hide
*/
public static final int FM_TUNER = 1998;
/**
* Audio source for preemptible, low-priority software hotword detection
* It presents the same gain and pre processing tuning as {@link #VOICE_RECOGNITION}.