refactor AudioRecord and AudioFlinger openRecord()

Refactor the mechanism used by audio record tracks to query and
attach to an input mixer/stream in audio flinger. This will:
 - reduce the number of binder transactions needed to create a record track
 - move sample rate, framecount and flags validations to audio server side
 - move audio session allocation to audio server side
 - prepare restriction of certain binder transactions to audioserver only

Also:
 - renamed openRecord() to createRecord() for consistency with AudioTrack
 - make AudioRecord mStatus update consistent when calling default
 contructor + set() or constructor with arguments
 - make AudioClient, CreateTrackXXX and  CreateRecordXXX classes derive
 from Parcelable
 - restore audio session ID validity check in AudioFlinger::createTrack()

Test: CTS tests: AudioRecordTest, AudioRecordingConfigurationTest, AudioPreProcessingTest
Test: manual test for capture use cases: camcorder, OK Google, VoIP calls
Change-Id: I72edaa7ddef1da11c77df21e88378e3aa9012d58
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 506420c..bc73ffd 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -118,23 +118,9 @@
                                         CreateTrackOutput& output,
                                         status_t *status);
 
-    virtual sp<media::IAudioRecord> openRecord(
-                                audio_io_handle_t input,
-                                uint32_t sampleRate,
-                                audio_format_t format,
-                                audio_channel_mask_t channelMask,
-                                const String16& opPackageName,
-                                size_t *pFrameCount,
-                                audio_input_flags_t *flags,
-                                pid_t pid,
-                                pid_t tid,
-                                int clientUid,
-                                audio_session_t *sessionId,
-                                size_t *notificationFrames,
-                                sp<IMemory>& cblk,
-                                sp<IMemory>& buffers,
-                                status_t *status /*non-NULL*/,
-                                audio_port_handle_t portId);
+    virtual sp<media::IAudioRecord> createRecord(const CreateRecordInput& input,
+                                                 CreateRecordOutput& output,
+                                                 status_t *status);
 
     virtual     uint32_t    sampleRate(audio_io_handle_t ioHandle) const;
     virtual     audio_format_t format(audio_io_handle_t output) const;