qcom/gps: Squashed updates/fixes from jb branch

GPS: Fixes a problem stopping the engine while an AGPS data is active

Sometimes the engine does not send the GPS_STATUS_ENGINE_OFF
message, so we end up blinking the GPS icon forever.  Deferring
the loc_eng_stop call until the AGPS activity is done works around
this problem.

Change-Id: I6f325ee8cd89dd6046c54843851f85a54c0d59ed

GPS: Changes to create loc_ni_thread locally

The thread callback reference is available only during
initialization. Hence the NI thread is created and
managed locally within libloc_api

Change-Id: Ie610143f7f0387043301e0254db4e42e0afb3e0d

Generate engine stop/start events when session ends/begins

This fixes the "lying" icon in the statusbar by generating the
engine events whenever a fix session state changes.

Change-Id: Ia2aea73513bcf3c3e7fbd632fe0f344003a8df71

GPS: Fixes mFixInterval = 0 issue in gingerbread

This change modifies the HAL driver so that even if the framework
passes in 0 for fix interval we will transalate it to 1 sec
internally. This is becuase the gps engine can report positions at
the max at 1 Hz frequency.

Change-Id: I8d14ee97cf20c43d050d230b9cc9fd6deac5486c
CRs-Fixed: 279363

libloc_api: fix status reporting

Completely rework the status reporting to be more robust, and enable
report muting.

Change-Id: I740c4ef0512be36ca6a7b774e8a23cc322c14791

libloc_api: xtra injection improvements

* Hold the locks only for copying buffer data to reduce the wait time
  for xtra injection.
* Remove some incorrect locks while doing deferred xtra injection.
* Switch to buffering the injection if the engine is on, as doing so
  now functions as intended.

Change-Id: I1b75945907242e960ce4b275f10b7f9f8dc17606

libloc_api: fix format for debug output

Change-Id: I74e081297ac2c6601be915e517230d0a52a75150

libloc: remove duplicate entry

Change-Id: I67239b322255242af799af5266b16786d83a11c2

qcom gps: Use standalone position mode if no agps servers are set

GpsLocationProvider defaults to the MSA and MSB assisted gps modes
if the device has the capability.  This library returns that the
device has the capability.  Check to see if any agps servers are
set; if not fall back to standalone mode.

Change-Id: I54a911b028cc685b282661837f1317119713d64a