Merge "KW Warning Fixes"
diff --git a/Makefile.am b/Makefile.am
index 7bc06b1..f64790e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,7 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = core loc_api
+SUBDIRS = core location gnss
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = loc-hal.pc
diff --git a/configure.ac b/configure.ac
index cf991c6..ec41c86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,9 +82,9 @@
 
 AC_CONFIG_FILES([ \
         Makefile \
-        utils/Makefile \
         core/Makefile \
-        loc_api/Makefile \
+        location/Makefile \
+        gnss/Makefile \
         loc-hal.pc \
         ])
 
diff --git a/core/Makefile.am b/core/Makefile.am
index 61abac4..5d52c40 100644
--- a/core/Makefile.am
+++ b/core/Makefile.am
@@ -1,10 +1,12 @@
 AM_CFLAGS = -I./ \
             -I../utils \
+            -I../location \
             $(LOCPLA_CFLAGS) \
             $(GPSUTILS_CFLAGS) \
             -I$(WORKSPACE)/gps-noship/flp \
             -D__func__=__PRETTY_FUNCTION__ \
-            -fno-short-enums
+            -fno-short-enums \
+            -std=c++11
 
 libloc_core_la_h_sources = \
            LocApiBase.h \
diff --git a/gnss/Makefile.am b/gnss/Makefile.am
new file mode 100644
index 0000000..69f7c76
--- /dev/null
+++ b/gnss/Makefile.am
@@ -0,0 +1,98 @@
+AM_CFLAGS = \
+     $(LOCPLA_CFLAGS) \
+     $(LOCHAL_CFLAGS) \
+     -I./ \
+     -I../utils \
+     -I../core \
+     -I../location \
+     -std=c++11
+
+libgnss_la_SOURCES = \
+    location_gnss.cpp \
+    GnssAdapter.cpp \
+    Agps.cpp
+
+if USE_GLIB
+libgnss_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
+libgnss_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -avoid-version
+libgnss_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
+else
+libgnss_la_CFLAGS = $(AM_CFLAGS)
+libgnss_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
+libgnss_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
+endif
+
+libgnss_la_LIBADD = -lstdc++ $(LOCPLA_LIBS) $(LOCHAL_LIBS)
+
+
+#Create and Install libraries
+#lib_LTLIBRARIES = libgnss.la
+
+#library_includedir = $(pkgincludedir)
+#pkgconfigdir = $(libdir)/pkgconfig
+#pkgconfig_DATA = location-api.pc
+#EXTRA_DIST = $(pkgconfig_DATA)
+
+
+libloc_ds_api_CFLAGS = \
+     $(QMIF_CFLAGS) \
+     $(QMI_CFLAGS) \
+     $(DATA_CFLAGS) \
+     -I$(WORKSPACE)/qcom-opensource/location/loc_api/ds_api
+
+libloc_ds_api_la_SOURCES = \
+     $(WORKSPACE)/qcom-opensource/location/loc_api/ds_api/ds_client.c
+
+if USE_GLIB
+libloc_ds_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_ds_api_CFLAGS) @GLIB_CFLAGS@
+libloc_ds_api_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
+libloc_ds_api_la_LDFLAGS += -Wl,--export-dynamic
+libloc_ds_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_ds_api_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
+else
+libloc_ds_api_la_CFLAGS = $(AM_CFLAGS) $(libloc_ds_api_CFLAGS)
+libloc_ds_api_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread -Wl,--export-dynamic -shared -version-info 1:0:0
+libloc_ds_api_la_LDFLAGS += -Wl,--export-dynamic
+libloc_ds_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) $(libloc_ds_api_CFLAGS)
+endif
+
+libloc_ds_api_la_LIBADD = -lstdc++ $(QMIF_LIBS) -lqmiservices -ldsi_netctrl $(GPSUTILS_LIBS) $(LOCPLA_LIBS) \
+$(GPSUTILS_LIBS)
+
+libloc_api_v02_CFLAGS = \
+     $(QMIF_CFLAGS) \
+     -I$(WORKSPACE)/qcom-opensource/location/loc_api/ds_api \
+     -I$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02
+
+libloc_api_v02_la_SOURCES = \
+    $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/LocApiV02.cpp \
+    $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_log.c \
+    $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_client.c \
+    $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_sync_req.c \
+    $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/location_service_v02.c
+
+if USE_GLIB
+libloc_api_v02_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_api_v02_CFLAGS) @GLIB_CFLAGS@
+libloc_api_v02_la_LDFLAGS = -lstdc++ -g -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
+libloc_api_v02_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_api_v02_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
+else
+libloc_api_v02_la_CFLAGS = $(AM_CFLAGS) $(libloc_api_v02_CFLAGS)
+libloc_api_v02_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread -shared -version-info 1:0:0
+libloc_api_v02_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) $(libloc_api_v02_CFLAGS)
+endif
+
+libloc_api_v02_la_CXXFLAGS = -std=c++0x
+libloc_api_v02_la_LIBADD = -lstdc++ -lqmi_cci -lqmi_common_so $(QMIF_LIBS) $(LOCPLA_LIBS) ../core/libloc_core.la libloc_ds_api.la
+
+library_include_HEADERS = \
+   $(WORKSPACE)/qcom-opensource/location/loc_api/ds_api/ds_client.h \
+   $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/location_service_v02.h \
+   $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_log.h \
+   $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_client.h \
+   $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_sync_req.h \
+   $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/LocApiV02.h \
+   $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_util_log.h
+
+library_includedir = $(pkgincludedir)
+
+#Create and Install libraries
+lib_LTLIBRARIES = libgnss.la libloc_ds_api.la libloc_api_v02.la
diff --git a/loc-hal.pc.in b/loc-hal.pc.in
index c6ece74..64750db 100644
--- a/loc-hal.pc.in
+++ b/loc-hal.pc.in
@@ -6,5 +6,5 @@
 Name: loc-hal
 Description: QTI GPS Loc HAL
 Version: @VERSION
-Libs: -L${libdir} -lloc_core -lloc_eng_so -lloc_ds_api -lloc_api_v02
-Cflags: -I${includedir} -I${includedir}/loc-hal/utils -I${includedir}/loc-hal/core -I${includedir}/loc-hal
+Libs: -L${libdir} -lloc_core -llocation_api -lgnss -lloc_ds_api -lloc_api_v02
+Cflags: -I${includedir} -I${includedir}/loc-hal -I${includedir}/loc-hal/location -I${includedir}/loc-hal/gnss -I${includedir}/loc-hal/core
diff --git a/location/Android.mk b/location/Android.mk
index ad66aff..728bdb4 100644
--- a/location/Android.mk
+++ b/location/Android.mk
@@ -25,6 +25,7 @@
      -fno-short-enums
 
 LOCAL_HEADER_LIBRARIES := \
+    libloc_pla_headers \
     libgps.utils_headers
 
 LOCAL_PRELINK_MODULE := false
diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp
index a977f70..21d2de0 100644
--- a/location/LocationAPI.cpp
+++ b/location/LocationAPI.cpp
@@ -29,7 +29,7 @@
 
 #include <location_interface.h>
 #include <dlfcn.h>
-#include <log_util.h>
+#include <platform_lib_log_util.h>
 #include <pthread.h>
 #include <map>
 
diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp
index f8a05aa..d8eae3f 100644
--- a/location/LocationAPIClientBase.cpp
+++ b/location/LocationAPIClientBase.cpp
@@ -29,7 +29,7 @@
 #define LOG_NDDEBUG 0
 #define LOG_TAG "LocSvc_APIClientBase"
 
-#include <log_util.h>
+#include <platform_lib_log_util.h>
 #include <loc_cfg.h>
 #include "LocationAPIClientBase.h"
 
diff --git a/location/Makefile.am b/location/Makefile.am
new file mode 100644
index 0000000..d520309
--- /dev/null
+++ b/location/Makefile.am
@@ -0,0 +1,39 @@
+AM_CFLAGS = \
+     $(LOCPLA_CFLAGS) \
+     $(LOCHAL_CFLAGS) \
+     -I./ \
+     -I../utils \
+     -std=c++11
+
+liblocation_api_la_SOURCES = \
+    LocationAPI.cpp \
+    LocationAPIClientBase.cpp
+
+if USE_GLIB
+liblocation_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
+liblocation_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
+liblocation_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
+else
+liblocation_api_la_CFLAGS = $(AM_CFLAGS)
+liblocation_api_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
+liblocation_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
+endif
+
+liblocation_api_la_LIBADD = -lstdc++ $(LOCPLA_LIBS) $(LOCHAL_LIBS)
+
+library_include_HEADERS = \
+    LocationAPI.h \
+    LocationAPIClientBase.h \
+    location_interface.h
+
+#Create and Install libraries
+lib_LTLIBRARIES = liblocation_api.la
+
+library_includedir = $(pkgincludedir)
+#pkgconfigdir = $(libdir)/pkgconfig
+#pkgconfig_DATA = location-api.pc
+#EXTRA_DIST = $(pkgconfig_DATA)
+
+
+
+
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 14c3e48..33a87da 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -1,9 +1,11 @@
 AM_CFLAGS = -Wundef \
          -I./ \
+         -std=c++11 \
          $(LOCPLA_CFLAGS)
 
 AM_CPPFLAGS = -Wundef \
          -I./ \
+         -std=c++11 \
          $(LOCPLA_CFLAGS)
 
 libgps_utils_so_la_h_sources = \
diff --git a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am
index d82aa55..30c4b4c 100644
--- a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am
+++ b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am
@@ -5,7 +5,6 @@
      -fno-short-enums
 
 h_sources = \
-    ../include/platform_lib_android_runtime.h \
     ../include/platform_lib_gettid.h \
     ../include/platform_lib_includes.h \
     ../include/platform_lib_log_util.h \
@@ -18,7 +17,6 @@
 library_include_HEADERS = $(h_sources)
 
 libloc_pla_la_SOURCES = \
-    platform_lib_android_runtime.cpp \
     platform_lib_gettid.cpp \
     platform_lib_log_util.cpp \
     platform_lib_property_service.cpp \