From 61de97e13003a5dea9917cb6e943ecd8e142b05b Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 12 Sep 2016 17:20:55 -0700 Subject: LE clean up separated utils, core, ds and loc-api-v02 from loc-hal into their own independent packages; simplified loc-pla; moved pla to the root of project; removed loc-stub. Change-Id: I373f02f9306646addf55ae90d71c4ba8e3741d09 CRs-Fixed: 2172544 --- Makefile.am | 2 +- android/Android.mk | 1 - configure.ac | 34 ++-- core/Android.mk | 3 +- core/ContextBase.cpp | 2 +- core/LocAdapterBase.cpp | 2 +- core/LocApiBase.cpp | 2 +- core/LocApiBase.h | 2 +- core/LocDualContext.cpp | 2 +- core/Makefile.am | 19 ++- core/SystemStatus.cpp | 4 +- core/SystemStatus.h | 5 +- core/SystemStatusOsObserver.h | 3 +- core/configure.ac | 82 ++++++++++ core/data-items/DataItemsFactoryProxy.cpp | 3 +- core/data-items/common/ClientIndex.cpp | 3 +- core/data-items/common/DataItemIndex.cpp | 3 +- core/loc-core.pc.in | 10 ++ core/loc_core_log.cpp | 3 +- gnss/Agps.cpp | 2 +- gnss/Agps.h | 3 +- gnss/Makefile.am | 85 +--------- loc-hal.pc.in | 4 +- location/LocationAPI.cpp | 3 +- location/LocationAPIClientBase.cpp | 3 +- location/LocationAPIClientBase.h | 3 +- location/Makefile.am | 22 ++- location/configure.ac | 82 ++++++++++ location/location-api.pc.in | 10 ++ pla/Android.mk | 30 ++++ pla/android/loc_pla.h | 58 +++++++ pla/oe/loc_pla.h | 67 ++++++++ utils/Android.mk | 5 +- utils/LocIpc.cpp | 3 +- utils/LocThread.cpp | 2 +- utils/LocTimer.cpp | 4 +- utils/LocTimer.h | 2 +- utils/Makefile.am | 42 ++--- utils/MsgTask.cpp | 5 +- utils/configure.ac | 29 +++- utils/gps-utils.pc.in | 2 +- utils/linked_list.c | 7 +- utils/loc_cfg.cpp | 15 +- utils/loc_cfg.h | 11 ++ utils/loc_log.cpp | 3 +- utils/loc_misc_utils.cpp | 2 +- utils/loc_nmea.cpp | 3 +- utils/loc_target.cpp | 5 +- utils/loc_timer.h | 3 +- utils/log_util.h | 5 +- utils/msg_q.c | 8 +- utils/platform_lib_abstractions/Android.mk | 5 - .../elapsed_millis_since_boot.cpp | 47 ------ utils/platform_lib_abstractions/loc_pla/Android.mk | 5 - .../platform_lib_abstractions/loc_pla/Makefile.am | 10 -- .../platform_lib_abstractions/loc_pla/configure.ac | 61 -------- .../loc_pla/include/platform_lib_gettid.h | 45 ------ .../loc_pla/include/platform_lib_includes.h | 39 ----- .../loc_pla/include/platform_lib_log_util.h | 174 --------------------- .../loc_pla/include/platform_lib_macros.h | 89 ----------- .../include/platform_lib_property_service.h | 44 ------ .../loc_pla/include/platform_lib_sched_policy.h | 46 ------ .../loc_pla/include/platform_lib_time.h | 36 ----- .../loc_pla/loc-pla.pc.in | 10 -- .../loc_pla/src/Android.mk | 68 -------- .../loc_pla/src/Makefile.am | 40 ----- .../loc_pla/src/platform_lib_gettid.cpp | 46 ------ .../loc_pla/src/platform_lib_log_util.cpp | 78 --------- .../loc_pla/src/platform_lib_property_service.cpp | 39 ----- .../loc_pla/src/platform_lib_sched_policy.cpp | 41 ----- .../loc_pla/src/platform_lib_time.cpp | 59 ------- .../platform_lib_abstractions/loc_stub/Android.mk | 5 - .../platform_lib_abstractions/loc_stub/Makefile.am | 9 -- .../loc_stub/configure.ac | 67 -------- .../loc_stub/include/loc_stub_android_runtime.h | 45 ------ .../loc_stub/include/loc_stub_gettid.h | 44 ------ .../loc_stub/include/loc_stub_property_service.h | 42 ----- .../loc_stub/include/loc_stub_sched_policy.h | 64 -------- .../loc_stub/include/loc_stub_time.h | 46 ------ .../loc_stub/loc-stub.pc.in | 10 -- .../loc_stub/src/Android.mk | 49 ------ .../loc_stub/src/Makefile.am | 40 ----- .../loc_stub/src/loc_stub_android_runtime.cpp | 41 ----- .../loc_stub/src/loc_stub_gettid.cpp | 37 ----- .../loc_stub/src/loc_stub_property_service.cpp | 42 ----- .../loc_stub/src/loc_stub_sched_policy.cpp | 50 ------ .../loc_stub/src/loc_stub_time.cpp | 55 ------- 87 files changed, 520 insertions(+), 1821 deletions(-) create mode 100644 core/configure.ac create mode 100644 core/loc-core.pc.in create mode 100644 location/configure.ac create mode 100644 location/location-api.pc.in create mode 100644 pla/Android.mk create mode 100644 pla/android/loc_pla.h create mode 100644 pla/oe/loc_pla.h delete mode 100644 utils/platform_lib_abstractions/Android.mk delete mode 100644 utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp delete mode 100644 utils/platform_lib_abstractions/loc_pla/Android.mk delete mode 100644 utils/platform_lib_abstractions/loc_pla/Makefile.am delete mode 100644 utils/platform_lib_abstractions/loc_pla/configure.ac delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/Android.mk delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/Makefile.am delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp delete mode 100644 utils/platform_lib_abstractions/loc_stub/Android.mk delete mode 100644 utils/platform_lib_abstractions/loc_stub/Makefile.am delete mode 100644 utils/platform_lib_abstractions/loc_stub/configure.ac delete mode 100644 utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h delete mode 100644 utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h delete mode 100644 utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h delete mode 100644 utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h delete mode 100644 utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h delete mode 100644 utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/Android.mk delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/Makefile.am delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp diff --git a/Makefile.am b/Makefile.am index f64790e..cd4a731 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = core location gnss +SUBDIRS = gnss pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = loc-hal.pc diff --git a/android/Android.mk b/android/Android.mk index 03ea1f3..46e2388 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -43,7 +43,6 @@ LOCAL_SHARED_LIBRARIES += \ libloc_core \ libgps.utils \ libdl \ - libloc_pla \ liblocation_api \ LOCAL_CFLAGS += $(GNSS_CFLAGS) diff --git a/configure.ac b/configure.ac index ec41c86..0ab8e68 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ AM_INIT_AUTOMAKE([foreign]) # Disables auto rebuilding of configure, Makefile.ins AM_MAINTAINER_MODE # Verifies the --srcdir is correct by checking for the path -AC_CONFIG_SRCDIR([utils/loc_cfg.cpp]) +AC_CONFIG_SRCDIR([Makefile.am]) # defines some macros variable to be included by source AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) @@ -29,26 +29,14 @@ AC_PROG_MAKE_SET PKG_PROG_PKG_CONFIG # Checks for libraries. -PKG_CHECK_MODULES([QMI], [qmi]) -AC_SUBST([QMI_CFLAGS]) -AC_SUBST([QMI_LIBS]) - -PKG_CHECK_MODULES([QMIF], [qmi-framework]) -AC_SUBST([QMIF_CFLAGS]) -AC_SUBST([QMIF_LIBS]) - -PKG_CHECK_MODULES([DATA], [data]) -AC_SUBST([DATA_CFLAGS]) -AC_SUBST([DATA_LIBS]) - -PKG_CHECK_MODULES([LOCPLA], [loc-pla]) -AC_SUBST([LOCPLA_CFLAGS]) -AC_SUBST([LOCPLA_LIBS]) - PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) AC_SUBST([GPSUTILS_CFLAGS]) AC_SUBST([GPSUTILS_LIBS]) +PKG_CHECK_MODULES([LOCCORE], [loc-core]) +AC_SUBST([LOCCORE_CFLAGS]) +AC_SUBST([LOCCORE_LIBS]) + AC_ARG_WITH([core_includes], AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], [Specify the location of the core headers]), @@ -59,6 +47,16 @@ if test "x$with_core_includes" != "xno"; then CPPFLAGS="${CPPFLAGS} -I${core_incdir}" fi +AC_ARG_WITH([locpla_includes], + AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], + [specify the path to locpla-includes in loc-pla_git.bb]), + [locpla_incdir=$withval], + with_locpla_includes=no) + +if test "x$with_locpla_includes" != "xno"; then + AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") +fi + AC_SUBST([CPPFLAGS]) AC_ARG_WITH([glib], @@ -82,8 +80,6 @@ AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") AC_CONFIG_FILES([ \ Makefile \ - core/Makefile \ - location/Makefile \ gnss/Makefile \ loc-hal.pc \ ]) diff --git a/core/Android.mk b/core/Android.mk index dba0b0a..1374b6c 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -22,8 +22,7 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ libgps.utils \ libdl \ - liblog \ - libloc_pla + liblog LOCAL_SRC_FILES += \ LocApiBase.cpp \ diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 05a0ad3..35e6585 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 3943819..f3c999c 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 4bc38e2..9576842 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocApiBase.h b/core/LocApiBase.h index f66bfe1..25d95b2 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include namespace loc_core { class ContextBase; diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index fd3450d..180d9dc 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/Makefile.am b/core/Makefile.am index 81ef2ee..dc540e9 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -1,12 +1,11 @@ +ACLOCAL_AMFLAGS = -I m4 + AM_CFLAGS = -I./ \ - -I../utils \ - -I../gnss \ - -I../location \ - -I./data-items \ - -I./data-items/common \ - -I./observer \ $(LOCPLA_CFLAGS) \ $(GPSUTILS_CFLAGS) \ + -I./data-items/ \ + -I./data-items/common \ + -I./observer \ -I$(WORKSPACE)/gps-noship/flp \ -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums \ @@ -44,7 +43,7 @@ libloc_core_la_c_sources = \ SystemStatusOsObserver.cpp \ SystemStatus.cpp -library_includedir = $(pkgincludedir)/core +library_includedir = $(pkgincludedir) library_include_HEADERS = $(libloc_core_la_h_sources) @@ -60,7 +59,11 @@ libloc_core_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif -libloc_core_la_LIBADD = -lstdc++ -ldl $(LOCPLA_LIBS) $(GPSUTILS_LIBS) +libloc_core_la_LIBADD = -ldl $(GPSUTILS_LIBS) #Create and Install libraries lib_LTLIBRARIES = libloc_core.la + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = loc-core.pc +EXTRA_DIST = $(pkgconfig_DATA) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 47923d6..6eb9968 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -34,8 +34,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 7e3309d..9500264 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -30,9 +30,10 @@ #define __SYSTEM_STATUS__ #include -#include +#include #include -#include +#include +#include #include #include #include diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index 33e668d..930ddc1 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -39,7 +39,8 @@ #include #include #include -#include +#include +#include namespace loc_core { diff --git a/core/configure.ac b/core/configure.ac new file mode 100644 index 0000000..ea0a128 --- /dev/null +++ b/core/configure.ac @@ -0,0 +1,82 @@ +# configure.ac -- Autoconf script for gps loc-core +# +# Process this file with autoconf to produce a configure script + +# Requires autoconf tool later than 2.61 +AC_PREREQ(2.61) +# Initialize the gps loc-hal package version 1.0.0 +AC_INIT([loc-core],1.0.0) +# Does not strictly follow GNU Coding standards +AM_INIT_AUTOMAKE([foreign]) +# Disables auto rebuilding of configure, Makefile.ins +AM_MAINTAINER_MODE +# Verifies the --srcdir is correct by checking for the path +AC_CONFIG_SRCDIR([loc-core.pc.in]) +# defines some macros variable to be included by source +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_MACRO_DIR([m4]) + +# Checks for programs. +AC_PROG_LIBTOOL +AC_PROG_CXX +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_AWK +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +PKG_PROG_PKG_CONFIG + +# Checks for libraries. +PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) +AC_SUBST([GPSUTILS_CFLAGS]) +AC_SUBST([GPSUTILS_LIBS]) + +AC_ARG_WITH([core_includes], + AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], + [Specify the location of the core headers]), + [core_incdir=$withval], + with_core_includes=no) + +if test "x$with_core_includes" != "xno"; then + CPPFLAGS="${CPPFLAGS} -I${core_incdir}" +fi + +AC_ARG_WITH([locpla_includes], + AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], + [specify the path to locpla-includes in loc-pla_git.bb]), + [locpla_incdir=$withval], + with_locpla_includes=no) + +if test "x$with_locpla_includes" != "xno"; then + AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") +fi + +AC_SUBST([CPPFLAGS]) + +AC_ARG_WITH([glib], + AC_HELP_STRING([--with-glib], + [enable glib, building HLOS systems which use glib])) + +if (test "x${with_glib}" = "xyes"); then + AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) + PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, + AC_MSG_ERROR(GThread >= 2.16 is required)) + PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, + AC_MSG_ERROR(GLib >= 2.16 is required)) + GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" + GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" + + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) +fi + +AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") + +AC_CONFIG_FILES([ \ + Makefile \ + loc-core.pc \ + ]) + +AC_OUTPUT diff --git a/core/data-items/DataItemsFactoryProxy.cpp b/core/data-items/DataItemsFactoryProxy.cpp index 130eecf..d5e4150 100644 --- a/core/data-items/DataItemsFactoryProxy.cpp +++ b/core/data-items/DataItemsFactoryProxy.cpp @@ -32,7 +32,8 @@ #include #include #include -#include +#include +#include namespace loc_core { diff --git a/core/data-items/common/ClientIndex.cpp b/core/data-items/common/ClientIndex.cpp index ffb5e1d..d4bd11e 100644 --- a/core/data-items/common/ClientIndex.cpp +++ b/core/data-items/common/ClientIndex.cpp @@ -29,7 +29,8 @@ #include #include #include -#include +#include +#include #include #include #include diff --git a/core/data-items/common/DataItemIndex.cpp b/core/data-items/common/DataItemIndex.cpp index 7869b43..462bf74 100644 --- a/core/data-items/common/DataItemIndex.cpp +++ b/core/data-items/common/DataItemIndex.cpp @@ -31,7 +31,8 @@ #include #include #include -#include +#include +#include #include #include diff --git a/core/loc-core.pc.in b/core/loc-core.pc.in new file mode 100644 index 0000000..76b514c --- /dev/null +++ b/core/loc-core.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: loc-core +Description: QTI GPS Loc Core +Version: @VERSION@ +Libs: -L${libdir} -lloc_core +Cflags: -I${includedir}/loc-core diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 5a627dd..37045ad 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -30,9 +30,10 @@ #define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_core_log" +#include #include #include -#include +#include void LocPosMode::logv() const { diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 72ce293..6ce0c34 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -30,7 +30,7 @@ #define LOG_TAG "LocSvc_Agps" #include -#include +#include #include #include diff --git a/gnss/Agps.h b/gnss/Agps.h index 862769a..703a475 100644 --- a/gnss/Agps.h +++ b/gnss/Agps.h @@ -34,7 +34,8 @@ #include #include #include -#include +#include +#include /* ATL callback function pointers * Passed in by Adapter to AgpsManager */ diff --git a/gnss/Makefile.am b/gnss/Makefile.am index 2365e4c..c818cae 100644 --- a/gnss/Makefile.am +++ b/gnss/Makefile.am @@ -1,11 +1,11 @@ AM_CFLAGS = \ $(LOCPLA_CFLAGS) \ $(LOCHAL_CFLAGS) \ + $(GPSUTILS_CFLAGS) \ + $(LOCCORE_CFLAGS) \ -I./ \ -I../utils \ - -I../core \ - -I../core/data-items \ - -I../core/observer \ + -I$(WORKSPACE)/hardware/qcom/gps/core/data-items \ -I../location \ -std=c++11 @@ -17,86 +17,15 @@ libgnss_la_SOURCES = \ if USE_GLIB libgnss_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libgnss_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -avoid-version +libgnss_la_LDFLAGS = -lstdc++ -Wl,-z,defs -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_LDFLAGS = -Wl,-z,defs -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) \ - $(GPSUTILS_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) - -libloc_api_v02_CFLAGS = \ - $(QMIF_CFLAGS) \ - $(GPSUTILS_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) $(GPSUTILS_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) +libgnss_la_LIBADD = -lstdc++ $(GPSUTILS_LIBS) $(LOCCORE_LIBS) #Create and Install libraries -lib_LTLIBRARIES = libgnss.la libloc_ds_api.la libloc_api_v02.la +lib_LTLIBRARIES = libgnss.la diff --git a/loc-hal.pc.in b/loc-hal.pc.in index 64750db..22d174b 100644 --- a/loc-hal.pc.in +++ b/loc-hal.pc.in @@ -6,5 +6,5 @@ includedir=@includedir@ Name: loc-hal Description: QTI GPS Loc HAL Version: @VERSION -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 +Libs: -L${libdir} -lgnss +Cflags: -I${includedir} -I${includedir}/utils -I${includedir}/core -I${includedir}/loc-hal diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 21d2de0..0111a9c 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -29,7 +29,8 @@ #include #include -#include +#include +#include #include #include diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index bb51238..e53a6b8 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -29,7 +29,8 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_APIClientBase" -#include +#include +#include #include #include #include "LocationAPIClientBase.h" diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 99c7c87..4bd1466 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -36,7 +36,8 @@ #include #include "LocationAPI.h" -#include "platform_lib_log_util.h" +#include +#include enum SESSION_MODE { SESSION_MODE_NONE = 0, diff --git a/location/Makefile.am b/location/Makefile.am index d1d0131..3688cc8 100644 --- a/location/Makefile.am +++ b/location/Makefile.am @@ -1,9 +1,10 @@ +ACLOCAL_AMFLAGS = -I m4 + AM_CFLAGS = \ - $(LOCPLA_CFLAGS) \ - $(GPSUTILS_CFLAGS) \ - $(LOCHAL_CFLAGS) \ -I./ \ -I../utils \ + $(LOCPLA_CFLAGS) \ + $(GPSUTILS_CFLAGS) \ -std=c++11 liblocation_api_la_SOURCES = \ @@ -12,15 +13,15 @@ liblocation_api_la_SOURCES = \ 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_LDFLAGS = -lstdc++ -Wl,-z,defs -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_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 liblocation_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif -liblocation_api_la_LIBADD = -lstdc++ $(LOCPLA_LIBS) $(GPSUTILS_LIBS) $(LOCHAL_LIBS) +liblocation_api_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) library_include_HEADERS = \ LocationAPI.h \ @@ -31,10 +32,7 @@ library_include_HEADERS = \ lib_LTLIBRARIES = liblocation_api.la library_includedir = $(pkgincludedir) -#pkgconfigdir = $(libdir)/pkgconfig -#pkgconfig_DATA = location-api.pc -#EXTRA_DIST = $(pkgconfig_DATA) - - - +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = location-api.pc +EXTRA_DIST = $(pkgconfig_DATA) diff --git a/location/configure.ac b/location/configure.ac new file mode 100644 index 0000000..6391d65 --- /dev/null +++ b/location/configure.ac @@ -0,0 +1,82 @@ +# configure.ac -- Autoconf script for gps location-api-iface +# +# Process this file with autoconf to produce a configure script + +# Requires autoconf tool later than 2.61 +AC_PREREQ(2.61) +# Initialize the gps location-api-iface package version 1.0.0 +AC_INIT([location-api-iface],1.0.0) +# Does not strictly follow GNU Coding standards +AM_INIT_AUTOMAKE([foreign]) +# Disables auto rebuilding of configure, Makefile.ins +AM_MAINTAINER_MODE +# Verifies the --srcdir is correct by checking for the path +AC_CONFIG_SRCDIR([location-api.pc.in]) +# defines some macros variable to be included by source +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_MACRO_DIR([m4]) + +# Checks for programs. +AC_PROG_LIBTOOL +AC_PROG_CXX +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_AWK +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +PKG_PROG_PKG_CONFIG + +# Checks for libraries. +PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) +AC_SUBST([GPSUTILS_CFLAGS]) +AC_SUBST([GPSUTILS_LIBS]) + +AC_ARG_WITH([core_includes], + AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], + [Specify the location of the core headers]), + [core_incdir=$withval], + with_core_includes=no) + +if test "x$with_core_includes" != "xno"; then + CPPFLAGS="${CPPFLAGS} -I${core_incdir}" +fi + +AC_ARG_WITH([locpla_includes], + AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], + [Specify the path to locpla-includes in loc-pla_git.bb]), + [locpla_incdir=$withval], + with_locpla_includes=no) + +if test "x${with_locpla_includes}" != "xno"; then + AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") +fi + +AC_SUBST([CPPFLAGS]) + +AC_ARG_WITH([glib], + AC_HELP_STRING([--with-glib], + [enable glib, building HLOS systems which use glib])) + +if (test "x${with_glib}" = "xyes"); then + AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) + PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, + AC_MSG_ERROR(GThread >= 2.16 is required)) + PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, + AC_MSG_ERROR(GLib >= 2.16 is required)) + GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" + GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" + + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) +fi + +AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") + +AC_CONFIG_FILES([ \ + Makefile \ + location-api.pc \ + ]) + +AC_OUTPUT diff --git a/location/location-api.pc.in b/location/location-api.pc.in new file mode 100644 index 0000000..c7b146a --- /dev/null +++ b/location/location-api.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: location-api +Description: Location API +Version: @VERSION +Libs: -L${libdir} -llocation_api +Cflags: -I${includedir}/location-api diff --git a/pla/Android.mk b/pla/Android.mk new file mode 100644 index 0000000..ce062bb --- /dev/null +++ b/pla/Android.mk @@ -0,0 +1,30 @@ +GNSS_CFLAGS := \ + -Werror \ + -Wno-error=unused-parameter \ + -Wno-error=format \ + -Wno-error=macro-redefined \ + -Wno-error=reorder \ + -Wno-error=missing-braces \ + -Wno-error=self-assign \ + -Wno-error=enum-conversion \ + -Wno-error=logical-op-parentheses \ + -Wno-error=null-arithmetic \ + -Wno-error=null-conversion \ + -Wno-error=parentheses-equality \ + -Wno-error=undefined-bool-conversion \ + -Wno-error=tautological-compare \ + -Wno-error=switch \ + -Wno-error=date-time + +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := libloc_pla_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/android +include $(BUILD_HEADER_LIBRARY) + +endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/pla/android/loc_pla.h b/pla/android/loc_pla.h new file mode 100644 index 0000000..9caae73 --- /dev/null +++ b/pla/android/loc_pla.h @@ -0,0 +1,58 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __LOC_PLA__ +#define __LOC_PLA__ + +#ifdef __cplusplus +#include +#define uptimeMillis android::uptimeMillis +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" +#define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" +#define LOC_PATH_FLP_CONF_STR "/vendor/etc/flp.conf" +#define LOC_PATH_LOWI_CONF_STR "/vendor/etc/lowi.conf" +#define LOC_PATH_SAP_CONF_STR "/vendor/etc/sap.conf" +#define LOC_PATH_APDR_CONF_STR "/vendor/etc/apdr.conf" +#define LOC_PATH_XTWIFI_CONF_STR "/vendor/etc/xtwifi.conf" +#define LOC_PATH_QUIPC_CONF_STR "/vendor/etc/quipc.conf" + +#ifdef __cplusplus +} +#endif /*__cplusplus */ + +#endif /* __LOC_PLA__ */ diff --git a/pla/oe/loc_pla.h b/pla/oe/loc_pla.h new file mode 100644 index 0000000..3ca1964 --- /dev/null +++ b/pla/oe/loc_pla.h @@ -0,0 +1,67 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __LOC_PLA__ +#define __LOC_PLA__ + +#ifdef __cplusplus +#include +#define uptimeMillis android::uptimeMillis + +extern "C" { +#endif + +#include +#include +#include +#include +#include +#include +#ifndef OFF_TARGET +#include +#define strlcat g_strlcat +#define strlcpy g_strlcpy +#else +#define strlcat strncat +#define strlcpy strncpy +#endif + +#define LOC_PATH_GPS_CONF_STR "/etc/gps.conf" +#define LOC_PATH_IZAT_CONF_STR "/etc/izat.conf" +#define LOC_PATH_FLP_CONF_STR "/etc/flp.conf" +#define LOC_PATH_LOWI_CONF_STR "/etc/lowi.conf" +#define LOC_PATH_SAP_CONF_STR "/etc/sap.conf" +#define LOC_PATH_APDR_CONF_STR "/etc/apdr.conf" +#define LOC_PATH_XTWIFI_CONF_STR "/etc/xtwifi.conf" +#define LOC_PATH_QUIPC_CONF_STR "/etc/quipc.conf" + +#ifdef __cplusplus +} +#endif /*__cplusplus */ + +#endif /* __LOC_PLA__ */ diff --git a/utils/Android.mk b/utils/Android.mk index 1352076..9607aaa 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -11,8 +11,7 @@ include $(CLEAR_VARS) LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ - liblog \ - libloc_pla + liblog LOCAL_SRC_FILES += \ loc_log.cpp \ @@ -20,7 +19,6 @@ LOCAL_SRC_FILES += \ msg_q.c \ linked_list.c \ loc_target.cpp \ - platform_lib_abstractions/elapsed_millis_since_boot.cpp \ LocHeap.cpp \ LocTimer.cpp \ LocThread.cpp \ @@ -61,6 +59,5 @@ LOCAL_MODULE := libgps.utils_headers LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) include $(BUILD_HEADER_LIBRARY) -include $(addsuffix /Android.mk, $(addprefix $(LOCAL_PATH)/, platform_lib_abstractions)) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 1df1546..26a2076 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -36,7 +36,8 @@ #include #include #include -#include +#include +#include #include #include #include "gps_extended_c.h" diff --git a/utils/LocThread.cpp b/utils/LocThread.cpp index d112f61..c1052cb 100644 --- a/utils/LocThread.cpp +++ b/utils/LocThread.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include class LocThreadDelegate { LocRunnable* mRunnable; diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 5b653eb..93775d0 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -27,13 +27,15 @@ * */ +#include #include #include #include #include -#include #include #include +#include +#include #include #include #include diff --git a/utils/LocTimer.h b/utils/LocTimer.h index c6a6362..abc7f64 100644 --- a/utils/LocTimer.h +++ b/utils/LocTimer.h @@ -31,7 +31,7 @@ #define __LOC_TIMER_CPP_H__ #include -#include +#include // opaque class to provide service implementation. class LocTimerDelegate; diff --git a/utils/Makefile.am b/utils/Makefile.am index 506309c..3801fdd 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,15 +1,17 @@ -AM_CFLAGS = -Wundef \ - -I./ \ - -I$(WORKSPACE)/system/core/include \ - -std=c++11 \ - $(LOCPLA_CFLAGS) +ACLOCAL_AMFLAGS = -I m4 -AM_CPPFLAGS = -Wundef \ +AM_CFLAGS = -Wundef \ + -MD \ + -Wno-trigraphs \ + -g -O0 \ + -fno-inline \ + -fno-short-enums \ + -fpic \ -I./ \ -std=c++11 \ $(LOCPLA_CFLAGS) -libgps_utils_so_la_h_sources = \ +libgps_utils_la_h_sources = \ msg_q.h \ linked_list.h \ loc_cfg.h \ @@ -28,7 +30,7 @@ libgps_utils_so_la_h_sources = \ loc_gps.h \ log_util.h -libgps_utils_so_la_c_sources = \ +libgps_utils_la_c_sources = \ linked_list.c \ msg_q.c \ loc_cfg.cpp \ @@ -42,27 +44,27 @@ libgps_utils_so_la_c_sources = \ loc_misc_utils.cpp \ loc_nmea.cpp +library_includedir = $(pkgincludedir) -library_include_HEADERS = $(libgps_utils_so_la_h_sources) +library_include_HEADERS = $(libgps_utils_la_h_sources) -libgps_utils_so_la_SOURCES = $(libgps_utils_so_la_c_sources) +libgps_utils_la_SOURCES = $(libgps_utils_la_c_sources) if USE_GLIB -libgps_utils_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libgps_utils_so_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libgps_utils_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +libgps_utils_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libgps_utils_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +libgps_utils_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ else -libgps_utils_so_la_CFLAGS = $(AM_CFLAGS) -libgps_utils_so_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 -libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +libgps_utils_la_CFLAGS = $(AM_CFLAGS) +libgps_utils_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 +libgps_utils_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif -libgps_utils_so_la_LIBADD = -lcutils -lstdc++ -llog $(LOCPLA_LIBS) +libgps_utils_la_LIBADD = $(CUTILS_LIBS) #Create and Install libraries -lib_LTLIBRARIES = libgps_utils_so.la -library_includedir = $(pkgincludedir) -pkgconfigdir = $(libdir)/pkgconfig +lib_LTLIBRARIES = libgps_utils.la +pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gps-utils.pc EXTRA_DIST = $(pkgconfig_DATA) diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index 80abeec..eaead5c 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -32,8 +32,9 @@ #include #include #include +#include #include -#include +#include static void LocMsgDestroy(void* msg) { delete (LocMsg*)msg; @@ -82,7 +83,7 @@ void MsgTask::sendMsg(const LocMsg* msg) const { void MsgTask::prerun() { // make sure we do not run in background scheduling group - platform_lib_abstraction_set_sched_policy(platform_lib_abstraction_gettid(), PLA_SP_FOREGROUND); + set_sched_policy(gettid(), SP_FOREGROUND); } bool MsgTask::run() { diff --git a/utils/configure.ac b/utils/configure.ac index a7ab9b4..639f8c4 100644 --- a/utils/configure.ac +++ b/utils/configure.ac @@ -28,9 +28,32 @@ AC_PROG_LN_S AC_PROG_MAKE_SET PKG_PROG_PKG_CONFIG -PKG_CHECK_MODULES([LOCPLA], [loc-pla]) -AC_SUBST([LOCPLA_CFLAGS]) -AC_SUBST([LOCPLA_LIBS]) +# Checks for libraries. +PKG_CHECK_MODULES([CUTILS], [libcutils]) +AC_SUBST([CUTILS_CFLAGS]) +AC_SUBST([CUTILS_LIBS]) + +AC_ARG_WITH([core_includes], + AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], + [Specify the location of the core headers]), + [core_incdir=$withval], + with_core_includes=no) + +if test "x$with_core_includes" != "xno"; then + CPPFLAGS="${CPPFLAGS} -I${core_incdir}" +fi + +AC_ARG_WITH([locpla_includes], + AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], + [specify the path to locpla-includes in loc-pla_git.bb]), + [locpla_incdir=$withval], + with_locpla_includes=no) + +if test "x$with_locpla_includes" != "xno"; then + AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") +fi + +AC_SUBST([CPPFLAGS]) AC_ARG_WITH([glib], AC_HELP_STRING([--with-glib], diff --git a/utils/gps-utils.pc.in b/utils/gps-utils.pc.in index 3ed3d90..a988731 100644 --- a/utils/gps-utils.pc.in +++ b/utils/gps-utils.pc.in @@ -6,5 +6,5 @@ includedir=@includedir@ Name: gps-utils Description: QTI GPS Location utils Version: @VERSION -Libs: -L${libdir} -lgps_utils_so +Libs: -L${libdir} -lgps_utils Cflags: -I${includedir}/gps-utils diff --git a/utils/linked_list.c b/utils/linked_list.c index 33185d0..02e1463 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -26,14 +26,15 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define LOG_TAG "LocSvc_utils_ll" + #include "linked_list.h" #include #include - -#define LOG_TAG "LocSvc_utils_ll" -#include #include #include +#include +#include typedef struct list_element { struct list_element* next; diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index d2364f6..9fb993f 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -38,12 +38,12 @@ #include #include #include -#include +#include #include #ifdef USE_GLIB #include #endif -#include "platform_lib_includes.h" +#include "log_util.h" /*============================================================================= * @@ -71,6 +71,17 @@ typedef struct loc_param_v_type double param_double_value; }loc_param_v_type; +// Reference below arrays wherever needed to avoid duplicating +// same conf path string over and again in location code. +const char LOC_PATH_GPS_CONF[] = LOC_PATH_GPS_CONF_STR; +const char LOC_PATH_IZAT_CONF[] = LOC_PATH_IZAT_CONF_STR; +const char LOC_PATH_FLP_CONF[] = LOC_PATH_FLP_CONF_STR; +const char LOC_PATH_LOWI_CONF[] = LOC_PATH_LOWI_CONF_STR; +const char LOC_PATH_SAP_CONF[] = LOC_PATH_SAP_CONF_STR; +const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; +const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; +const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR; + /*=========================================================================== FUNCTION loc_set_config_entry diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index 0a0f100..b3613cf 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -84,6 +84,17 @@ int loc_read_conf_r(FILE *conf_fp, const loc_param_s_type* config_table, uint32_t table_length); int loc_update_conf(const char* conf_data, int32_t length, const loc_param_s_type* config_table, uint32_t table_length); + +// Below are the location conf file paths +extern const char LOC_PATH_GPS_CONF[]; +extern const char LOC_PATH_IZAT_CONF[]; +extern const char LOC_PATH_FLP_CONF[]; +extern const char LOC_PATH_LOWI_CONF[]; +extern const char LOC_PATH_SAP_CONF[]; +extern const char LOC_PATH_APDR_CONF[]; +extern const char LOC_PATH_XTWIFI_CONF[]; +extern const char LOC_PATH_QUIPC_CONF[]; + #ifdef __cplusplus } #endif diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 9fad9e6..ab28998 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -32,9 +32,10 @@ #include #include #include +#include "log_util.h" #include "loc_log.h" #include "msg_q.h" -#include +#include #define BUFFER_SIZE 120 diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp index fd3ee6b..b7c8406 100644 --- a/utils/loc_misc_utils.cpp +++ b/utils/loc_misc_utils.cpp @@ -30,7 +30,7 @@ #define LOG_TAG "LocSvc_misc_utils" #include #include -#include +#include #include #include diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 6d34b51..7fe043c 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -31,7 +31,8 @@ #define LOG_TAG "LocSvc_nmea" #include #include -#include +#include +#include #define GLONASS_SV_ID_OFFSET 64 #define MAX_SATELLITES_IN_USE 12 diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index cf42932..d31f887 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -27,6 +27,7 @@ * */ +#include #include #include #include @@ -34,10 +35,10 @@ #include #include #include -#include +#include #include "loc_target.h" #include "loc_log.h" -#include +#include #define APQ8064_ID_1 "109" #define APQ8064_ID_2 "153" diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 25fd179..fff0c46 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -34,7 +34,8 @@ extern "C" { #endif /* __cplusplus */ #include -#include +#include +#include /* user_data: client context pointer, passthrough. Originally received from calling client when loc_timer_start() is called. diff --git a/utils/log_util.h b/utils/log_util.h index d5884b7..460d6e7 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -37,13 +37,14 @@ #elif defined (USE_GLIB) // LE targets with no logcat support #include +#include #include #include +#include #ifndef LOG_TAG #define LOG_TAG "GPS_UTILS" - -#endif // LOG_TAG +#endif /* LOG_TAG */ #endif /* #if defined (USE_ANDROID_LOGGING) || defined (ANDROID) */ diff --git a/utils/msg_q.c b/utils/msg_q.c index e8b4ffe..76c1478 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -26,14 +26,14 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "msg_q.h" - #define LOG_TAG "LocSvc_utils_q" -#include -#include "linked_list.h" #include #include #include +#include +#include +#include "linked_list.h" +#include "msg_q.h" typedef struct msg_q { void* msg_list; /* Linked list to store information */ diff --git a/utils/platform_lib_abstractions/Android.mk b/utils/platform_lib_abstractions/Android.mk deleted file mode 100644 index b923a4c..0000000 --- a/utils/platform_lib_abstractions/Android.mk +++ /dev/null @@ -1,5 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -include $(call all-subdir-makefiles) - -endif diff --git a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp deleted file mode 100644 index 4b35f51..0000000 --- a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include "platform_lib_time.h" - -int64_t systemTime(int /*clock*/) -{ - struct timespec t; - t.tv_sec = t.tv_nsec = 0; - clock_gettime(CLOCK_MONOTONIC, &t); - return t.tv_sec*1000000LL + t.tv_nsec/1000LL; -} - - -int64_t elapsedMillisSinceBoot() -{ - int64_t t_us = systemTime(0); - return (int64_t) t_us / 1000LL; -} diff --git a/utils/platform_lib_abstractions/loc_pla/Android.mk b/utils/platform_lib_abstractions/loc_pla/Android.mk deleted file mode 100644 index b923a4c..0000000 --- a/utils/platform_lib_abstractions/loc_pla/Android.mk +++ /dev/null @@ -1,5 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -include $(call all-subdir-makefiles) - -endif diff --git a/utils/platform_lib_abstractions/loc_pla/Makefile.am b/utils/platform_lib_abstractions/loc_pla/Makefile.am deleted file mode 100644 index 8996763..0000000 --- a/utils/platform_lib_abstractions/loc_pla/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -# Makefile.am for gps loc-pla -# - -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = src - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = loc-pla.pc -EXTRA_DIST = $(pkgconfig_DATA) diff --git a/utils/platform_lib_abstractions/loc_pla/configure.ac b/utils/platform_lib_abstractions/loc_pla/configure.ac deleted file mode 100644 index a8b892b..0000000 --- a/utils/platform_lib_abstractions/loc_pla/configure.ac +++ /dev/null @@ -1,61 +0,0 @@ -# configure.ac -- Autoconf script for gps loc-pla -# -# Process this file with autoconf to produce a configure script - -# Requires autoconf tool later than 2.61 -AC_PREREQ(2.61) -# Initialize the gps loc-pla package version 1.0.0 -AC_INIT([loc-pla],1.0.0) -# Does not strictly follow GNU Coding standards -AM_INIT_AUTOMAKE([foreign]) -# Disables auto rebuilding of configure, Makefile.ins -AM_MAINTAINER_MODE -# Verifies the --srcdir is correct by checking for the path -AC_CONFIG_SRCDIR([include/platform_lib_includes.h]) -# defines some macros variable to be included by source -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -# Checks for programs. -AC_PROG_LIBTOOL -AC_PROG_CXX -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_AWK -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -PKG_PROG_PKG_CONFIG - -# Checks for libraries. -PKG_CHECK_MODULES([LOCSTUB], [loc-stub]) -AC_SUBST([LOCSTUB_CFLAGS]) -AC_SUBST([LOCSTUB_LIBS]) - -AC_ARG_WITH([glib], - AC_HELP_STRING([--with-glib], - [enable glib, building HLOS systems which use glib])) - -if (test "x${with_glib}" = "xyes"); then - AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) - PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GThread >= 2.16 is required)) - PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GLib >= 2.16 is required)) - GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" - GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" - - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) -fi - -AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") - -AC_CONFIG_FILES([ \ - Makefile \ - src/Makefile \ - loc-pla.pc \ - ]) - -AC_OUTPUT diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h deleted file mode 100644 index 340c3c5..0000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_GETTID_H__ -#define __PLATFORM_LIB_GETTID_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif -#ifdef USE_GLIB -const char* getprogname(); -#endif /* USE_GLIB */ - -pid_t platform_lib_abstraction_gettid(); -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* __PLATFORM_LIB_GETTID_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h deleted file mode 100644 index ebb7119..0000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_INCLUDES_H__ -#define __PLATFORM_LIB_INCLUDES_H__ - -#include "platform_lib_gettid.h" -#include "platform_lib_log_util.h" -#include "platform_lib_macros.h" -#include "platform_lib_property_service.h" -#include "platform_lib_sched_policy.h" -#include "platform_lib_time.h" - -#endif /* __PLATFORM_LIB_INCLUDES_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h deleted file mode 100644 index 08a9585..0000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_LOG_UTIL_H__ -#define __PLATFORM_LIB_LOG_UTIL_H__ - -#include "platform_lib_macros.h" -#include -#include -#include -#include -#include -#include - -#ifndef LOG_TAG -#define LOG_TAG "GPS_UTILS" -#endif /* LOG_TAG */ - -#if defined (USE_ANDROID_LOGGING) || defined (ANDROID) -// Android and LE targets with logcat support -#include -#else -// LE targets without logcat support -#ifdef __cplusplus -extern "C" -{ -#endif -/*============================================================================= - * - * LOC LOGGER TYPE DECLARATION - * - *============================================================================*/ -/* LOC LOGGER */ -typedef struct loc_logger_s -{ - unsigned long DEBUG_LEVEL; - unsigned long TIMESTAMP; -} loc_logger_s_type; - -/*============================================================================= - * - * EXTERNAL DATA - * - *============================================================================*/ -extern loc_logger_s_type loc_logger; - -// Logging Improvements -extern const char *loc_logger_boolStr[]; - -extern const char *boolStr[]; -extern const char VOID_RET[]; -extern const char FROM_AFW[]; -extern const char TO_MODEM[]; -extern const char FROM_MODEM[]; -extern const char TO_AFW[]; -extern const char EXIT_TAG[]; -extern const char ENTRY_TAG[]; -extern const char EXIT_ERROR_TAG[]; - -/*============================================================================= - * - * MODULE EXPORTED FUNCTIONS - * - *============================================================================*/ -void loc_logger_init(unsigned long debug, unsigned long timestamp); -char* get_timestamp(char* str, unsigned long buf_size); - -#ifndef DEBUG_DMN_LOC_API - -/* LOGGING MACROS */ -/*loc_logger.DEBUG_LEVEL is initialized to 0xff in loc_cfg.cpp - if that value remains unchanged, it means gps.conf did not - provide a value and we default to the initial value to use - Android's logging levels*/ -#define IF_LOC_LOGE if((loc_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5)) -#define IF_LOC_LOGW if((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5)) -#define IF_LOC_LOGI if((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5)) -#define IF_LOC_LOGD if((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5)) -#define IF_LOC_LOGV if((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define LOC_LOGE(...) IF_LOC_LOGE { ALOGE(__VA_ARGS__); } -#define LOC_LOGW(...) IF_LOC_LOGW { ALOGW(__VA_ARGS__); } -#define LOC_LOGI(...) IF_LOC_LOGI { ALOGI(__VA_ARGS__); } -#define LOC_LOGD(...) IF_LOC_LOGD { ALOGD(__VA_ARGS__); } -#define LOC_LOGV(...) IF_LOC_LOGV { ALOGV(__VA_ARGS__); } - -#else /* DEBUG_DMN_LOC_API */ - -#define LOC_LOGE(...) ALOGE(__VA_ARGS__) -#define LOC_LOGW(...) ALOGW(__VA_ARGS__) -#define LOC_LOGI(...) ALOGI(__VA_ARGS__) -#define LOC_LOGD(...) ALOGD(__VA_ARGS__) -#define LOC_LOGV(...) ALOGV(__VA_ARGS__) - -#endif /* DEBUG_DMN_LOC_API */ - -/*============================================================================= - * - * LOGGING IMPROVEMENT MACROS - * - *============================================================================*/ -#define LOG_(LOC_LOG, ID, WHAT, SPEC, VAL) \ - do { \ - if (loc_logger.TIMESTAMP) { \ - char ts[32]; \ - LOC_LOG("[%s] %s %s line %d " #SPEC, \ - get_timestamp(ts, sizeof(ts)), ID, WHAT, __LINE__, VAL); \ - } else { \ - LOC_LOG("%s %s line %d " #SPEC, \ - ID, WHAT, __LINE__, VAL); \ - } \ - } while(0) - -#define LOC_LOG_HEAD(fmt) "%s:%d] " fmt -#define LOC_LOGv(fmt,...) LOC_LOGV(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGw(fmt,...) LOC_LOGW(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGd(fmt,...) LOC_LOGD(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGe(fmt,...) LOC_LOGE(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) - -#define LOG_I(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGI, ID, WHAT, SPEC, VAL) -#define LOG_V(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGV, ID, WHAT, SPEC, VAL) -#define LOG_E(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGE, ID, WHAT, SPEC, VAL) - -#define ENTRY_LOG() LOG_V(ENTRY_TAG, __FUNCTION__, %s, "") -#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __FUNCTION__, SPEC, VAL) -#define EXIT_LOG_WITH_ERROR(SPEC, VAL) \ - if (VAL != 0) { \ - LOG_E(EXIT_ERROR_TAG, __FUNCTION__, SPEC, VAL); \ - } else { \ - LOG_V(EXIT_TAG, __FUNCTION__, SPEC, VAL); \ - } - - -// Used for logging callflow from Android Framework -#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __FUNCTION__, %s, "") -// Used for logging callflow to Modem -#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __FUNCTION__, SPEC, VAL) -// Used for logging callflow from Modem(TO_MODEM, __FUNCTION__, %s, "") -#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __FUNCTION__, SPEC, VAL) -// Used for logging callflow to Android Framework -#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL) - -#ifdef __cplusplus -} -#endif - -#endif /* else of #if defined (USE_ANDROID_LOGGING) || defined (ANDROID) */ - -#endif /* __PLATFORM_LIB_LOG_UTIL_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h deleted file mode 100644 index 9a806bf..0000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_MACROS_H__ -#define __PLATFORM_LIB_MACROS_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#ifdef USE_GLIB -#include -#ifndef OFF_TARGET -#define strlcat g_strlcat -#define strlcpy g_strlcpy -#else -#define strlcat strncat -#define strlcpy strncpy -#endif -#endif /* USE_GLIB */ - -#if defined (USE_GLIB) && !defined (USE_ANDROID_LOGGING) -// LE targets with no logcat support -#define TS_PRINTF(format, x...) \ -{ \ - struct timeval tv; \ - struct timezone tz; \ - int hh, mm, ss; \ - gettimeofday(&tv, &tz); \ - hh = tv.tv_sec/3600%24; \ - mm = (tv.tv_sec%3600)/60; \ - ss = tv.tv_sec%60; \ - fprintf(stdout,"%02d:%02d:%02d.%06ld]" format "\n", hh, mm, ss, tv.tv_usec, ##x); \ -} - -#define ALOGE(format, x...) TS_PRINTF("E/%s (%d): " format , LOG_TAG, getpid(), ##x) -#define ALOGW(format, x...) TS_PRINTF("W/%s (%d): " format , LOG_TAG, getpid(), ##x) -#define ALOGI(format, x...) TS_PRINTF("I/%s (%d): " format , LOG_TAG, getpid(), ##x) -#define ALOGD(format, x...) TS_PRINTF("D/%s (%d): " format , LOG_TAG, getpid(), ##x) -#define ALOGV(format, x...) TS_PRINTF("V/%s (%d): " format , LOG_TAG, getpid(), ##x) - -#endif /* #if defined (USE_GLIB) && !defined (USE_ANDROID_LOGGING) */ - - -// Below are the location conf file paths -extern const char LOC_PATH_GPS_CONF[]; -extern const char LOC_PATH_IZAT_CONF[]; -extern const char LOC_PATH_FLP_CONF[]; -extern const char LOC_PATH_LOWI_CONF[]; -extern const char LOC_PATH_SAP_CONF[]; -extern const char LOC_PATH_APDR_CONF[]; -extern const char LOC_PATH_XTWIFI_CONF[]; -extern const char LOC_PATH_QUIPC_CONF[]; - - -#ifdef __cplusplus -} -#endif /*__cplusplus */ - -#endif /* __PLATFORM_LIB_MACROS_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h deleted file mode 100644 index ed2041f..0000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_PROPERTY_SERVICE_H__ -#define __PLATFORM_LIB_PROPERTY_SERVICE_H__ - -#ifdef __cplusplus -extern "C" { -#endif -#ifndef PROPERTY_VALUE_MAX -#define PROPERTY_VALUE_MAX 92 -#endif -int platform_lib_abstraction_property_get(const char *key, char *value, const char *default_value); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __PLATFORM_LIB_PROPERTY_SERVICE_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h deleted file mode 100644 index d10f151..0000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_SCHED_POLICY_H__ -#define __PLATFORM_LIB_SCHED_POLICY_H__ - -#ifdef __cplusplus -extern "C" { -#endif -typedef enum { - PLA_SP_BACKGROUND = 0, - PLA_SP_FOREGROUND = 1, -} PLASchedPolicy; - -int platform_lib_abstraction_set_sched_policy(int tid, PLASchedPolicy policy); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __PLATFORM_LIB_SCHED_POLICY_H__ */ - diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h deleted file mode 100644 index ae25ae6..0000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_TIME_H__ -#define __PLATFORM_LIB_TIME_H__ - -#include -int64_t platform_lib_abstraction_elapsed_millis_since_boot(); -int64_t platform_lib_abstraction_elapsed_micros_since_boot(); - -#endif /* __PLATFORM_LIB_TIME_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in b/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in deleted file mode 100644 index 9ec510d..0000000 --- a/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: loc-pla -Description: QTI GPS Location Platform Library Abstractions -Version: @VERSION@ -Libs: -L${libdir} -lloc_pla -Cflags: -I${includedir}/loc-pla -I${includedir}/gps-utils diff --git a/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/utils/platform_lib_abstractions/loc_pla/src/Android.mk deleted file mode 100644 index ab13717..0000000 --- a/utils/platform_lib_abstractions/loc_pla/src/Android.mk +++ /dev/null @@ -1,68 +0,0 @@ -GNSS_CFLAGS := \ - -Werror \ - -Wno-error=unused-parameter \ - -Wno-error=format \ - -Wno-error=macro-redefined \ - -Wno-error=reorder \ - -Wno-error=missing-braces \ - -Wno-error=self-assign \ - -Wno-error=enum-conversion \ - -Wno-error=logical-op-parentheses \ - -Wno-error=null-arithmetic \ - -Wno-error=null-conversion \ - -Wno-error=parentheses-equality \ - -Wno-error=undefined-bool-conversion \ - -Wno-error=tautological-compare \ - -Wno-error=switch \ - -Wno-error=date-time - -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) -ifneq ($(BUILD_TINY_ANDROID),true) -#Compile this library only for builds with the latest modem image - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -## Libs -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - liblog \ - libloc_stub - -LOCAL_SRC_FILES += \ - platform_lib_gettid.cpp \ - platform_lib_log_util.cpp \ - platform_lib_property_service.cpp \ - platform_lib_sched_policy.cpp \ - platform_lib_time.cpp - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ \ - -std=c++11 - -## Includes -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/../include -LOCAL_HEADER_LIBRARIES := \ - libgps.utils_headers \ - libloc_stub_headers - -LOCAL_MODULE := libloc_pla -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 -LOCAL_MODULE_TAGS := optional - -LOCAL_PRELINK_MODULE := false -LOCAL_CFLAGS += $(GNSS_CFLAGS) -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := libloc_pla_headers -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include -include $(BUILD_HEADER_LIBRARY) - -endif # not BUILD_TINY_ANDROID -endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am deleted file mode 100644 index ac7f8a0..0000000 --- a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -AM_CFLAGS = \ - $(LOCSTUB_CFLAGS) \ - -I$(WORKSPACE)/hardware/qcom/gps/utils/ \ - -I../include \ - -D__func__=__PRETTY_FUNCTION__ \ - -fno-short-enums - -h_sources = \ - ../include/platform_lib_gettid.h \ - ../include/platform_lib_includes.h \ - ../include/platform_lib_log_util.h \ - ../include/platform_lib_macros.h \ - ../include/platform_lib_property_service.h \ - ../include/platform_lib_sched_policy.h \ - ../include/platform_lib_time.h - -library_includedir = $(pkgincludedir) -library_include_HEADERS = $(h_sources) - -libloc_pla_la_SOURCES = \ - platform_lib_gettid.cpp \ - platform_lib_log_util.cpp \ - platform_lib_property_service.cpp \ - platform_lib_sched_policy.cpp \ - platform_lib_time.cpp - -if USE_GLIB -libloc_pla_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_pla_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_pla_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_pla_la_CFLAGS = $(AM_CFLAGS) -libloc_pla_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 -libloc_pla_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_pla_la_LIBADD = -lstdc++ -ldl -llog $(LOCSTUB_LIBS) - -#Create and Install libraries -lib_LTLIBRARIES = libloc_pla.la diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp deleted file mode 100644 index 1b7aa32..0000000 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "platform_lib_gettid.h" - -#ifdef USE_GLIB -#include - -#include -const char* getprogname() { - return program_invocation_short_name; -} - -#else -#include -#endif /* USE_GLIB */ - -pid_t platform_lib_abstraction_gettid() -{ - return gettid(); -} diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp deleted file mode 100644 index 3cb51a3..0000000 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include "platform_lib_log_util.h" -#include "platform_lib_macros.h" - -char * get_timestamp(char *str, unsigned long buf_size) -{ - struct timeval tv; - struct timezone tz; - int hh, mm, ss; - gettimeofday(&tv, &tz); - hh = tv.tv_sec/3600%24; - mm = (tv.tv_sec%3600)/60; - ss = tv.tv_sec%60; - snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_usec); - return str; -} - -// Below are the location conf file paths -#ifdef __ANDROID__ - -#define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" -#define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" -#define LOC_PATH_FLP_CONF_STR "/vendor/etc/flp.conf" -#define LOC_PATH_LOWI_CONF_STR "/vendor/etc/lowi.conf" -#define LOC_PATH_SAP_CONF_STR "/vendor/etc/sap.conf" -#define LOC_PATH_APDR_CONF_STR "/vendor/etc/apdr.conf" -#define LOC_PATH_XTWIFI_CONF_STR "/vendor/etc/xtwifi.conf" -#define LOC_PATH_QUIPC_CONF_STR "/vendor/etc/quipc.conf" - -#else - -#define LOC_PATH_GPS_CONF_STR "/etc/gps.conf" -#define LOC_PATH_IZAT_CONF_STR "/etc/izat.conf" -#define LOC_PATH_FLP_CONF_STR "/etc/flp.conf" -#define LOC_PATH_LOWI_CONF_STR "/etc/lowi.conf" -#define LOC_PATH_SAP_CONF_STR "/etc/sap.conf" -#define LOC_PATH_APDR_CONF_STR "/etc/apdr.conf" -#define LOC_PATH_XTWIFI_CONF_STR "/etc/xtwifi.conf" -#define LOC_PATH_QUIPC_CONF_STR "/etc/quipc.conf" - -#endif // __ANDROID__ - -// Reference below arrays wherever needed to avoid duplicating -// same conf path string over and again in location code. -const char LOC_PATH_GPS_CONF[] = LOC_PATH_GPS_CONF_STR; -const char LOC_PATH_IZAT_CONF[] = LOC_PATH_IZAT_CONF_STR; -const char LOC_PATH_FLP_CONF[] = LOC_PATH_FLP_CONF_STR; -const char LOC_PATH_LOWI_CONF[] = LOC_PATH_LOWI_CONF_STR; -const char LOC_PATH_SAP_CONF[] = LOC_PATH_SAP_CONF_STR; -const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; -const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; -const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR; diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp deleted file mode 100644 index dccdebc..0000000 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifdef USE_GLIB -#include -#else -#include -#endif /* USE_GLIB */ - -#include "platform_lib_property_service.h" - -int platform_lib_abstraction_property_get(const char *key, char *value, const char *default_value) -{ - return property_get(key, value, default_value); -} diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp deleted file mode 100644 index ba6b350..0000000 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "platform_lib_sched_policy.h" - -#ifdef USE_GLIB -#include -#else -#include -#endif /* USE_GLIB */ - -int platform_lib_abstraction_set_sched_policy(int tid, PLASchedPolicy policy) -{ - return set_sched_policy(tid, (SchedPolicy)policy); -} - diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp deleted file mode 100644 index 3dcd4d3..0000000 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include "platform_lib_time.h" - -#ifdef USE_GLIB -#include -#else -#include -#include - -#endif /* USE_GLIB */ - -int64_t platform_lib_abstraction_elapsed_millis_since_boot() -{ -#ifdef USE_GLIB - - return elapsedMillisSinceBoot(); - -#else - - //return android::nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME))/1000; - return nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME))/1000; -#endif -} -int64_t platform_lib_abstraction_elapsed_micros_since_boot() -{ -#ifdef USE_GLIB - return elapsedMicrosSinceBoot(); - -#else - //return android::nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME)); - return nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME)); -#endif -} diff --git a/utils/platform_lib_abstractions/loc_stub/Android.mk b/utils/platform_lib_abstractions/loc_stub/Android.mk deleted file mode 100644 index b923a4c..0000000 --- a/utils/platform_lib_abstractions/loc_stub/Android.mk +++ /dev/null @@ -1,5 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -include $(call all-subdir-makefiles) - -endif diff --git a/utils/platform_lib_abstractions/loc_stub/Makefile.am b/utils/platform_lib_abstractions/loc_stub/Makefile.am deleted file mode 100644 index d81e363..0000000 --- a/utils/platform_lib_abstractions/loc_stub/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -# Makefile.am for gps loc-stub - -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = src - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = loc-stub.pc -EXTRA_DIST = $(pkgconfig_DATA) diff --git a/utils/platform_lib_abstractions/loc_stub/configure.ac b/utils/platform_lib_abstractions/loc_stub/configure.ac deleted file mode 100644 index 8900f04..0000000 --- a/utils/platform_lib_abstractions/loc_stub/configure.ac +++ /dev/null @@ -1,67 +0,0 @@ -# configure.ac -- Autoconf script for gps loc-stub -# -# Process this file with autoconf to produce a configure script - -# Requires autoconf tool later than 2.61 -AC_PREREQ(2.61) -# Initialize the gps loc-stub package version 1.0.0 -AC_INIT([loc-stub],1.0.0) -# Does not strictly follow GNU Coding standards -AM_INIT_AUTOMAKE([foreign]) -# Disables auto rebuilding of configure, Makefile.ins -AM_MAINTAINER_MODE -# Verifies the --srcdir is correct by checking for the path -AC_CONFIG_SRCDIR([Makefile.am]) -# defines some macros variable to be included by source -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -# Checks for programs. -AC_PROG_LIBTOOL -AC_PROG_CXX -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_AWK -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -PKG_PROG_PKG_CONFIG - -# Checks for libraries. -AC_ARG_WITH([hardware_include], - AC_HELP_STRING([--with-hardware-include=@<:@dir@:>@], - [Specify the location of the hardware headers]), - [hardware_incdir=$withval], - with_hardware_include=no) - -if test "x$with_hardware_include" != "xno"; then - CPPFLAGS="${CPPFLAGS} -I${hardware_incdir}" -fi - -AC_ARG_WITH([glib], - AC_HELP_STRING([--with-glib], - [enable glib, building HLOS systems which use glib])) - -if (test "x${with_glib}" = "xyes"); then - AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) - PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GThread >= 2.16 is required)) - PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GLib >= 2.16 is required)) - GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" - GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" - - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) -fi - -AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") - -AC_CONFIG_FILES([ \ - Makefile \ - src/Makefile \ - loc-stub.pc - ]) - -AC_OUTPUT diff --git a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h deleted file mode 100644 index c8764ee..0000000 --- a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LOC_STUB_ANDROID_RUNTIME_H__ -#define __LOC_STUB_ANDROID_RUNTIME_H__ - -#include - -namespace android { - -class AndroidRuntime -{ -public: - /** create a new thread that is visible from Java */ - static pthread_t createJavaThread(const char* name, void (*start)(void *), - void* arg); -}; - -} -#endif /* __LOC_STUB_ANDROID_RUNTIME_H__ */ diff --git a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h deleted file mode 100644 index 677bc81..0000000 --- a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LOC_STUB_GETTID_H__ -#define __LOC_STUB_GETTID_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -pid_t gettid(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __LOC_STUB_GETTID_H__ */ diff --git a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h deleted file mode 100644 index 3677cdf..0000000 --- a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LOC_STUB_PROPERTY_SERVICE_H__ -#define __LOC_STUB_PROPERTY_SERVICE_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -int property_get(const char *key, char *value, const char *default_value); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LOC_STUB_PROPERTY_SERVICE_H__ */ diff --git a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h deleted file mode 100644 index a42b117..0000000 --- a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LOC_STUB_SCHED_POLICY_H__ -#define __LOC_STUB_SCHED_POLICY_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - SP_BACKGROUND = 0, - SP_FOREGROUND = 1, -} SchedPolicy; - -/*=========================================================================== -FUNCTION set_sched_policy - -DESCRIPTION - Local copy of this function which bypasses android set_sched_policy - -DEPENDENCIES - None - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int set_sched_policy(int tid, SchedPolicy policy); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LOC_STUB_SCHED_POLICY_H__ */ - diff --git a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h deleted file mode 100644 index f00a49b..0000000 --- a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LOC_STUB_TIME_H__ -#define __LOC_STUB_TIME_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int64_t systemTime(int clock); -int64_t elapsedMillisSinceBoot(); -int64_t elapsedMicrosSinceBoot(); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LOC_STUB_TIME_H__ */ diff --git a/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in b/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in deleted file mode 100644 index c2ae764..0000000 --- a/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: loc-stub -Description: QTI GPS Location Stub -Version: @VERSION -Libs: -L${libdir} -lloc_stub -Cflags: -I${includedir}/loc-stub diff --git a/utils/platform_lib_abstractions/loc_stub/src/Android.mk b/utils/platform_lib_abstractions/loc_stub/src/Android.mk deleted file mode 100644 index 08697cb..0000000 --- a/utils/platform_lib_abstractions/loc_stub/src/Android.mk +++ /dev/null @@ -1,49 +0,0 @@ -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) -ifneq ($(BUILD_TINY_ANDROID),true) -#Compile this library only for builds with the latest modem image - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -## Libs -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - liblog - -LOCAL_SRC_FILES += \ - loc_stub_android_runtime.cpp \ - loc_stub_gettid.cpp \ - loc_stub_property_service.cpp \ - loc_stub_sched_policy.cpp \ - loc_stub_time.cpp - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ \ - -std=c++11 - - -LOCAL_LDFLAGS += -Wl,--export-dynamic - -## Includes -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/../include \ - -LOCAL_MODULE := libloc_stub -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 -LOCAL_MODULE_TAGS := optional - -LOCAL_PRELINK_MODULE := false -LOCAL_CFLAGS += $(GNSS_CFLAGS) -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := libloc_stub_headers -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include -include $(BUILD_HEADER_LIBRARY) - -endif # not BUILD_TINY_ANDROID -endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/platform_lib_abstractions/loc_stub/src/Makefile.am b/utils/platform_lib_abstractions/loc_stub/src/Makefile.am deleted file mode 100644 index ba823a2..0000000 --- a/utils/platform_lib_abstractions/loc_stub/src/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -AM_CFLAGS = \ - -I../include \ - -D__func__=__PRETTY_FUNCTION__ \ - -fno-short-enums - -libloc_stub_la_extra_h = \ - ../include/utils/Log.h - -libloc_stub_la_c_sources = \ - loc_stub_android_runtime.cpp \ - loc_stub_gettid.cpp \ - loc_stub_property_service.cpp \ - loc_stub_sched_policy.cpp \ - loc_stub_time.cpp - -libloc_stub_la_SOURCES = $(libloc_stub_la_c_sources) $(libloc_stub_la_extra_h) - -library_include_HEADERS = \ - ../include/loc_stub_android_runtime.h \ - ../include/loc_stub_gettid.h \ - ../include/loc_stub_property_service.h \ - ../include/loc_stub_sched_policy.h \ - ../include/loc_stub_time.h - -library_includedir = $(pkgincludedir) - -if USE_GLIB -libloc_stub_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_stub_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_stub_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_stub_la_CFLAGS = $(AM_CFLAGS) -libloc_stub_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 -libloc_stub_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_stub_la_LIBADD = -lstdc++ -ldl -llog - -#Create and Install libraries -lib_LTLIBRARIES = libloc_stub.la diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp deleted file mode 100644 index 068df4e..0000000 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "loc_stub_android_runtime.h" - -namespace android { - -pthread_t AndroidRuntime::createJavaThread(const char* /*name*/, - void (*start)(void *), void* arg) -{ - pthread_t threadId = 0; - pthread_create(&threadId, NULL, (void *(*)(void*))start, arg); - return threadId; -} - -} diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp deleted file mode 100644 index 55ef48a..0000000 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "loc_stub_gettid.h" -#include -#include - -// Required for off-target environment to compile properly -pid_t gettid(void) -{ - return syscall(SYS_gettid); -} diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp deleted file mode 100644 index 907ab02..0000000 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "loc_stub_property_service.h" -#include -#include - -int property_get(const char *key, char * value, const char */*default_value*/) -{ - /* This will disable gps interface - value[0] = '1'; - */ - if (strcmp(key, "ro.baseband") == 0) { - memcpy(value, "msm", 4); - } - return 0; -} diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp deleted file mode 100644 index 5e26245..0000000 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "loc_stub_sched_policy.h" - -/*=========================================================================== -FUNCTION set_sched_policy - -DESCRIPTION - Local copy of this function which bypasses android set_sched_policy - -DEPENDENCIES - None - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int set_sched_policy(int /*tid*/, SchedPolicy /*policy*/) -{ - return 0; -} diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp deleted file mode 100644 index 0db41ca..0000000 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "loc_stub_time.h" -#include -#include -#include - -int64_t systemTime(int /*clock*/) -{ - struct timespec t; - t.tv_sec = t.tv_nsec = 0; - clock_gettime(CLOCK_MONOTONIC, &t); - return t.tv_sec*1000000LL + t.tv_nsec/1000LL; -} - -int64_t elapsedMicrosSinceBoot() -{ - struct timespec ts; - int64_t time_ms = 0; - clock_gettime(CLOCK_BOOTTIME, &ts); - time_ms += (ts.tv_sec * 1000000000LL); /* Seconds to nanoseconds */ - time_ms += ts.tv_nsec; /* Add Nanoseconds */ - return time_ms; -} - -int64_t elapsedMillisSinceBoot() -{ - return (int64_t) (elapsedMicrosSinceBoot() /1000000LL); -} -- cgit v1.2.3