Merge "Adding UNPROCESSED to the available audio_sources and SUPPORT_AUDIO_SOURCE_UNPROCESSED property"

This commit is contained in:
Ricardo Garcia
2016-01-17 20:07:15 +00:00
committed by Android (Google) Code Review
8 changed files with 31 additions and 5 deletions

View File

@@ -19365,6 +19365,7 @@ package android.media {
field public static final deprecated int NUM_STREAMS = 5; // 0x5
field public static final java.lang.String PROPERTY_OUTPUT_FRAMES_PER_BUFFER = "android.media.property.OUTPUT_FRAMES_PER_BUFFER";
field public static final java.lang.String PROPERTY_OUTPUT_SAMPLE_RATE = "android.media.property.OUTPUT_SAMPLE_RATE";
field public static final java.lang.String PROPERTY_SUPPORT_AUDIO_SOURCE_UNPROCESSED = "android.media.property.SUPPORT_AUDIO_SOURCE_UNPROCESSED";
field public static final java.lang.String PROPERTY_SUPPORT_MIC_NEAR_ULTRASOUND = "android.media.property.SUPPORT_MIC_NEAR_ULTRASOUND";
field public static final java.lang.String PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND = "android.media.property.SUPPORT_SPEAKER_NEAR_ULTRASOUND";
field public static final java.lang.String RINGER_MODE_CHANGED_ACTION = "android.media.RINGER_MODE_CHANGED";
@@ -20725,6 +20726,7 @@ package android.media {
field public static final int DEFAULT = 0; // 0x0
field public static final int MIC = 1; // 0x1
field public static final int REMOTE_SUBMIX = 8; // 0x8
field public static final int UNPROCESSED = 9; // 0x9
field public static final int VOICE_CALL = 4; // 0x4
field public static final int VOICE_COMMUNICATION = 7; // 0x7
field public static final int VOICE_DOWNLINK = 3; // 0x3

View File

@@ -20670,6 +20670,7 @@ package android.media {
field public static final deprecated int NUM_STREAMS = 5; // 0x5
field public static final java.lang.String PROPERTY_OUTPUT_FRAMES_PER_BUFFER = "android.media.property.OUTPUT_FRAMES_PER_BUFFER";
field public static final java.lang.String PROPERTY_OUTPUT_SAMPLE_RATE = "android.media.property.OUTPUT_SAMPLE_RATE";
field public static final java.lang.String PROPERTY_SUPPORT_AUDIO_SOURCE_UNPROCESSED = "android.media.property.SUPPORT_AUDIO_SOURCE_UNPROCESSED";
field public static final java.lang.String PROPERTY_SUPPORT_MIC_NEAR_ULTRASOUND = "android.media.property.SUPPORT_MIC_NEAR_ULTRASOUND";
field public static final java.lang.String PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND = "android.media.property.SUPPORT_SPEAKER_NEAR_ULTRASOUND";
field public static final java.lang.String RINGER_MODE_CHANGED_ACTION = "android.media.RINGER_MODE_CHANGED";
@@ -22035,6 +22036,7 @@ package android.media {
field public static final int MIC = 1; // 0x1
field public static final int RADIO_TUNER = 1998; // 0x7ce
field public static final int REMOTE_SUBMIX = 8; // 0x8
field public static final int UNPROCESSED = 9; // 0x9
field public static final int VOICE_CALL = 4; // 0x4
field public static final int VOICE_COMMUNICATION = 7; // 0x7
field public static final int VOICE_DOWNLINK = 3; // 0x3

View File

@@ -19373,6 +19373,7 @@ package android.media {
field public static final deprecated int NUM_STREAMS = 5; // 0x5
field public static final java.lang.String PROPERTY_OUTPUT_FRAMES_PER_BUFFER = "android.media.property.OUTPUT_FRAMES_PER_BUFFER";
field public static final java.lang.String PROPERTY_OUTPUT_SAMPLE_RATE = "android.media.property.OUTPUT_SAMPLE_RATE";
field public static final java.lang.String PROPERTY_SUPPORT_AUDIO_SOURCE_UNPROCESSED = "android.media.property.SUPPORT_AUDIO_SOURCE_UNPROCESSED";
field public static final java.lang.String PROPERTY_SUPPORT_MIC_NEAR_ULTRASOUND = "android.media.property.SUPPORT_MIC_NEAR_ULTRASOUND";
field public static final java.lang.String PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND = "android.media.property.SUPPORT_SPEAKER_NEAR_ULTRASOUND";
field public static final java.lang.String RINGER_MODE_CHANGED_ACTION = "android.media.RINGER_MODE_CHANGED";
@@ -20733,6 +20734,7 @@ package android.media {
field public static final int DEFAULT = 0; // 0x0
field public static final int MIC = 1; // 0x1
field public static final int REMOTE_SUBMIX = 8; // 0x8
field public static final int UNPROCESSED = 9; // 0x9
field public static final int VOICE_CALL = 4; // 0x4
field public static final int VOICE_COMMUNICATION = 7; // 0x7
field public static final int VOICE_DOWNLINK = 3; // 0x3

View File

@@ -2362,6 +2362,9 @@
(range of 18 - 21 kHz). -->
<bool name="config_supportSpeakerNearUltrasound">true</bool>
<!-- Whether the Unprocessed audio source supports the required frequency range and level -->
<bool name="config_supportAudioSourceUnprocessed">false</bool>
<!-- Flag indicating device support for EAP SIM, AKA, AKA' -->
<bool name="config_eap_sim_based_auth_supported">true</bool>

View File

@@ -303,6 +303,7 @@
<java-symbol type="bool" name="config_wifi_turn_off_during_emergency_call" />
<java-symbol type="bool" name="config_supportMicNearUltrasound" />
<java-symbol type="bool" name="config_supportSpeakerNearUltrasound" />
<java-symbol type="bool" name="config_supportAudioSourceUnprocessed" />
<java-symbol type="bool" name="config_freeformWindowManagement" />
<java-symbol type="string" name="config_defaultPictureInPictureBounds" />
<java-symbol type="string" name="config_centeredPictureInPictureBounds" />

View File

@@ -529,8 +529,9 @@ public final class AudioAttributes implements Parcelable {
* instance with {@link AudioRecord#AudioRecord(AudioAttributes, AudioFormat, int)}.
* @param preset one of {@link MediaRecorder.AudioSource#DEFAULT},
* {@link MediaRecorder.AudioSource#MIC}, {@link MediaRecorder.AudioSource#CAMCORDER},
* {@link MediaRecorder.AudioSource#VOICE_RECOGNITION} or
* {@link MediaRecorder.AudioSource#VOICE_COMMUNICATION}.
* {@link MediaRecorder.AudioSource#VOICE_RECOGNITION},
* {@link MediaRecorder.AudioSource#VOICE_COMMUNICATION} or
* {@link MediaRecorder.AudioSource#UNPROCESSED}
* @return the same Builder instance.
*/
@SystemApi
@@ -541,6 +542,7 @@ public final class AudioAttributes implements Parcelable {
case MediaRecorder.AudioSource.CAMCORDER:
case MediaRecorder.AudioSource.VOICE_RECOGNITION:
case MediaRecorder.AudioSource.VOICE_COMMUNICATION:
case MediaRecorder.AudioSource.UNPROCESSED:
mSource = preset;
break;
default:

View File

@@ -3304,13 +3304,20 @@ public class AudioManager {
public static final String PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND =
"android.media.property.SUPPORT_SPEAKER_NEAR_ULTRASOUND";
/**
* Used as a key for {@link #getProperty} to determine if the unprocessed audio source is
* available and supported with the expected frequency range and level response.
*/
public static final String PROPERTY_SUPPORT_AUDIO_SOURCE_UNPROCESSED =
"android.media.property.SUPPORT_AUDIO_SOURCE_UNPROCESSED";
/**
* Returns the value of the property with the specified key.
* @param key One of the strings corresponding to a property key: either
* {@link #PROPERTY_OUTPUT_SAMPLE_RATE},
* {@link #PROPERTY_OUTPUT_FRAMES_PER_BUFFER},
* {@link #PROPERTY_SUPPORT_MIC_NEAR_ULTRASOUND}, or
* {@link #PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND}.
* {@link #PROPERTY_SUPPORT_MIC_NEAR_ULTRASOUND},
* {@link #PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND}, or
* {@link #PROPERTY_SUPPORT_AUDIO_SOURCE_UNPROCESSED}.
* @return A string representing the associated value for that property key,
* or null if there is no value for that key.
*/
@@ -3329,6 +3336,9 @@ public class AudioManager {
} else if (PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND.equals(key)) {
return String.valueOf(getContext().getResources().getBoolean(
com.android.internal.R.bool.config_supportSpeakerNearUltrasound));
} else if (PROPERTY_SUPPORT_AUDIO_SOURCE_UNPROCESSED.equals(key)) {
return String.valueOf(getContext().getResources().getBoolean(
com.android.internal.R.bool.config_supportAudioSourceUnprocessed));
} else {
// null or unknown key
return null;

View File

@@ -251,6 +251,10 @@ public class MediaRecorder
*/
public static final int REMOTE_SUBMIX = 8;
/** Microphone audio source tuned for unprocessed (raw) sound if available, behaves like
* {@link #DEFAULT} otherwise. */
public static final int UNPROCESSED = 9;
/**
* Audio source for capturing broadcast radio tuner output.
* @hide
@@ -405,7 +409,7 @@ public class MediaRecorder
* @see android.media.MediaRecorder.AudioSource
*/
public static final int getAudioSourceMax() {
return AudioSource.REMOTE_SUBMIX;
return AudioSource.UNPROCESSED;
}
/**