AudioRecord::getInputFramesLost() cleanup

Fixed bug that if the binder call failed (for example if the
IAudioFlinger binder is dead), then getInputFramesLost was returning
garbage.  Now it correctly returns zero, which is the error value for
this method.

The type declarations for getInputFramesLost were inconsistent:
a mixture of unsigned int, size_t, and uint32_t.  Now it returns uint32_t
everywhere, which is what the underlying HAL API returns.

Added a FIXME about the side effect behavior.  This will need review
for multi-client.

Change-Id: Ifa2e117a87dbd0c1f2c892a31d1c3dd919bf1a0a
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index 0439cb0..80cef8d 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -378,8 +378,10 @@
      * returning the current value by this function call.  Such loss typically occurs when the
      * user space process is blocked longer than the capacity of audio driver buffers.
      * Units: the number of input audio frames.
+     * FIXME The side-effect of resetting the counter may be incompatible with multi-client.
+     * Consider making it more like AudioTrack::getUnderrunFrames which doesn't have side effects.
      */
-            unsigned int  getInputFramesLost() const;
+            uint32_t    getInputFramesLost() const;
 
 private:
     /* copying audio record objects is not allowed */
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index ca9aaf7..706344a 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -138,7 +138,7 @@
                                       audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
 
     // return the number of input frames lost by HAL implementation, or 0 if the handle is invalid
-    static size_t getInputFramesLost(audio_io_handle_t ioHandle);
+    static uint32_t getInputFramesLost(audio_io_handle_t ioHandle);
 
     static int newAudioSessionId();
     static void acquireAudioSessionId(int audioSession);
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index 899d79f..c9cffe3 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -170,7 +170,7 @@
     virtual status_t getRenderPosition(size_t *halFrames, size_t *dspFrames,
                                     audio_io_handle_t output) const = 0;
 
-    virtual size_t getInputFramesLost(audio_io_handle_t ioHandle) const = 0;
+    virtual uint32_t getInputFramesLost(audio_io_handle_t ioHandle) const = 0;
 
     virtual int newAudioSessionId() = 0;