fix screenrecord abort issues

Change-Id: Ic065d4cdd92cfa7abbaafd8e17f6e9d4cf397562
libstagefright: Fix timestamp corruption during offload playback

-Timestamp gets corrupted at EOS of offload playback.
-This happens because the number of samples played returned from
 HAL could be zero if playback has reached EOS and if compress
 handle is invalid / closed.
-If HAL has posted EOS  avoid the update of real time and media
 time with the timestamp from HAL.

CRs-Fixed: 570368
Change-Id: I5ea75f4eda1df0c110bce780e50e3c8ae9b4cd85
mediaserver: conditionally launch ListenService

Conditionally instantiate ListenService from MediaService.
ListenServiceruns as a singleton in its own thread that calls
AudioHAL which in turn accesses Listen Driver. It is the entry
point from Application processes that want so execute Listen
commands and receive Voice detection events. It manages Listen
application resources and global states across all Listen
applications.

ListenService is similar to AudioFlinger. That is why it is
instantiated from MediaServer. Listenservice talks to AudioHAL
to deal with concurrent usage of mic.

Change-Id: I71c346bb16e0ed3a7aae9c908e03c7f1c694fe0a
libstagefright: Fix intermittent pause during tunnel A-V playback

-Media time is used in onVideoEvent for A-V sync. In offload
 playback we only use realtime(time from DSP).
-Media time should be same as real time. If media time is not
 updated with the real time value A-V sync issues are seen.
-Update media time to real time value to avoid intermittent pause
 during playback.

CRs-Fixed: 572060
Change-Id: Ib1123b7554f3508230ca67cd20a68fa32c753057
libstagefright: Fix incorrect progress bar display during device switch

 -During offload to nonoffload playback switch (speakr to a2dp)
  audiotear down happens which reset current postion and duration.
 -do not reset the file duration during audio tear down and return
  the cached current position if audioplayer is not created.

Change-Id: I924d270d57aee1a9e79cea1c33bbd6bb731b201d