AudioRecord::set and constructor now take flags

The new optional parameter 'flags' of type audio_input_flags_t will be
used for requesting a fast track.

Change-Id: Ia7e070cb57c833e608352da354fb30dc26df6918
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index 596cf93..bcf2039 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -144,6 +144,7 @@
      *                     frames are ready in record track output buffer.
      * sessionId:          Not yet supported.
      * transferType:       How data is transferred from AudioRecord.
+     * flags:              See comments on audio_input_flags_t in <system/audio.h>
      * threadCanCallJava:  Not present in parameter list, and so is fixed at false.
      */
 
@@ -156,7 +157,8 @@
                                     void* user = NULL,
                                     int notificationFrames = 0,
                                     int sessionId = 0,
-                                    transfer_type transferType = TRANSFER_DEFAULT);
+                                    transfer_type transferType = TRANSFER_DEFAULT,
+                                    audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE);
 
     /* Terminates the AudioRecord and unregisters it from AudioFlinger.
      * Also destroys all resources associated with the AudioRecord.
@@ -188,7 +190,8 @@
                             int notificationFrames = 0,
                             bool threadCanCallJava = false,
                             int sessionId = 0,
-                            transfer_type transferType = TRANSFER_DEFAULT);
+                            transfer_type transferType = TRANSFER_DEFAULT,
+                            audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE);
 
     /* Result of constructing the AudioRecord. This must be checked
      * before using any AudioRecord API (except for set()), because using
@@ -464,6 +467,7 @@
     audio_source_t          mInputSource;
     uint32_t                mLatency;           // in ms
     audio_channel_mask_t    mChannelMask;
+    audio_input_flags_t     mFlags;
     int                     mSessionId;
     transfer_type           mTransfer;
 
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 7be7529..d4495dc 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -87,7 +87,8 @@
         void* user,
         int notificationFrames,
         int sessionId,
-        transfer_type transferType)
+        transfer_type transferType,
+        audio_input_flags_t flags)
     : mStatus(NO_INIT), mSessionId(0),
       mPreviousPriority(ANDROID_PRIORITY_NORMAL),
       mPreviousSchedulingGroup(SP_DEFAULT),
@@ -129,7 +130,8 @@
         int notificationFrames,
         bool threadCanCallJava,
         int sessionId,
-        transfer_type transferType)
+        transfer_type transferType,
+        audio_input_flags_t flags)
 {
     switch (transferType) {
     case TRANSFER_DEFAULT:
@@ -218,6 +220,8 @@
     }
     ALOGV("set(): mSessionId %d", mSessionId);
 
+    mFlags = flags;
+
     audio_io_handle_t input = AudioSystem::getInput(inputSource,
                                                     sampleRate,
                                                     format,