I found that in Android 2.2 (and higher), they introduced an undocumented flag in the AudioRecord() class, called “VoiceRecogntionQuality”. In the code, there is a note to expose and document that flag (it just hasn’t been done yet.) So I expect that it is supported (and will continue to be.) My guess is that AGC was added to 2.2 and this is the flag that disables it.
Here’s the code I used to adjust my recordings for it:
// We use our version to attempt "VoiceRecogntionQuality" recordings (to disable AGC)
int version = Integer.parseInt(android.os.Build.VERSION.SDK);
// Try to get the audio record for Android 2.2 and greater using 'voice recognition quality'
if (version >= 7)
{
recordInstance = new AudioRecord(6, m_frequency, m_channelConfiguration, m_audioEncoding, bufferSizeBytes * m_bufferCount);
}
// For older versions of Android (or failed attempts of the voice recognition quality recordings)
if (version < 7 || recordInstance.getState() == AudioRecord.STATE_UNINITIALIZED)
{
recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC, m_frequency, m_channelConfiguration, m_audioEncoding, bufferSizeBytes * m_bufferCount);
}