sanders: gps: switch to LA.UM.6.6.r1-04300-89xx.0 branch
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
#include <sys/time.h>
|
||||
#include "platform_lib_time.h"
|
||||
|
||||
int64_t systemTime(int clock)
|
||||
int64_t systemTime(int /*clock*/)
|
||||
{
|
||||
struct timeval t;
|
||||
t.tv_sec = t.tv_usec = 0;
|
||||
|
||||
10
gps/utils/platform_lib_abstractions/loc_pla/Makefile.am
Normal file
10
gps/utils/platform_lib_abstractions/loc_pla/Makefile.am
Normal file
@@ -0,0 +1,10 @@
|
||||
# Makefile.am for gps loc-pla
|
||||
#
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = loc-pla.pc
|
||||
EXTRA_DIST = $(pkgconfig_DATA)
|
||||
61
gps/utils/platform_lib_abstractions/loc_pla/configure.ac
Normal file
61
gps/utils/platform_lib_abstractions/loc_pla/configure.ac
Normal file
@@ -0,0 +1,61 @@
|
||||
# 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
|
||||
@@ -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_ANDROID_RUNTIME_H__
|
||||
#define __PLATFORM_LIB_ANDROID_RUNTIME_H__
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
pthread_t platform_lib_abstraction_createJavaThread(const char* name, void (*start)(void *), void* arg);
|
||||
#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION platform_lib_abstraction_createJavaThread
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /*__PLATFORM_LIB_ANDROID_RUNTIME_H__ */
|
||||
@@ -34,6 +34,10 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifdef USE_GLIB
|
||||
const char* getprogname();
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
pid_t platform_lib_abstraction_gettid();
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#ifndef __PLATFORM_LIB_INCLUDES_H__
|
||||
#define __PLATFORM_LIB_INCLUDES_H__
|
||||
|
||||
#include "platform_lib_android_runtime.h"
|
||||
#include "platform_lib_gettid.h"
|
||||
#include "platform_lib_log_util.h"
|
||||
#include "platform_lib_macros.h"
|
||||
|
||||
@@ -98,46 +98,24 @@ char* get_timestamp(char* str, unsigned long buf_size);
|
||||
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("E/" __VA_ARGS__); } \
|
||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("E/" __VA_ARGS__); }
|
||||
|
||||
#define LOC_LOGW(...) \
|
||||
IF_LOC_LOGW { ALOGE("W/" __VA_ARGS__); } \
|
||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/" __VA_ARGS__); }
|
||||
|
||||
#define LOC_LOGI(...) \
|
||||
IF_LOC_LOGI { ALOGE("I/" __VA_ARGS__); } \
|
||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/" __VA_ARGS__); }
|
||||
|
||||
#define LOC_LOGD(...) \
|
||||
IF_LOC_LOGD { ALOGE("D/" __VA_ARGS__); } \
|
||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/" __VA_ARGS__); }
|
||||
|
||||
#define LOC_LOGV(...) \
|
||||
IF_LOC_LOGV { ALOGE("V/" __VA_ARGS__); } \
|
||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); }
|
||||
#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("E/" __VA_ARGS__)
|
||||
|
||||
#define LOC_LOGW(...) ALOGW("W/" __VA_ARGS__)
|
||||
|
||||
#define LOC_LOGI(...) ALOGI("I/" __VA_ARGS__)
|
||||
|
||||
#define LOC_LOGD(...) ALOGD("D/" __VA_ARGS__)
|
||||
|
||||
#define LOC_LOGV(...) ALOGV("V/" __VA_ARGS__)
|
||||
#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 */
|
||||
|
||||
@@ -158,32 +136,32 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); }
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define LOC_LOG_HEAD(tag,fmt) "%s:%d][" tag "] " fmt "\n"
|
||||
#define LOC_LOGv(tag,fmt,...) LOC_LOGV(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define LOC_LOGw(tag,fmt,...) LOC_LOGW(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define LOC_LOGd(tag,fmt,...) LOC_LOGD(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define LOC_LOGe(tag,fmt,...) LOC_LOGE(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
#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, __func__, %s, "")
|
||||
#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, 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, __func__, SPEC, VAL); \
|
||||
LOG_E(EXIT_ERROR_TAG, __FUNCTION__, SPEC, VAL); \
|
||||
} else { \
|
||||
LOG_V(EXIT_TAG, __func__, SPEC, VAL); \
|
||||
LOG_V(EXIT_TAG, __FUNCTION__, SPEC, VAL); \
|
||||
}
|
||||
|
||||
|
||||
// Used for logging callflow from Android Framework
|
||||
#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "")
|
||||
#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, __func__, SPEC, VAL)
|
||||
// Used for logging callflow from Modem(TO_MODEM, __func__, %s, "")
|
||||
#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __func__, SPEC, VAL)
|
||||
#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)
|
||||
|
||||
|
||||
@@ -66,6 +66,18 @@ extern "C" {
|
||||
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
|
||||
// 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 */
|
||||
|
||||
@@ -31,5 +31,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
int64_t platform_lib_abstraction_elapsed_millis_since_boot();
|
||||
int64_t platform_lib_abstraction_elapsed_micros_since_boot();
|
||||
|
||||
#endif /* __PLATFORM_LIB_TIME_H__ */
|
||||
|
||||
10
gps/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in
Normal file
10
gps/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in
Normal file
@@ -0,0 +1,10 @@
|
||||
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
|
||||
@@ -1,3 +1,22 @@
|
||||
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
|
||||
|
||||
@@ -10,11 +29,9 @@ LOCAL_SHARED_LIBRARIES := \
|
||||
libutils \
|
||||
libcutils \
|
||||
liblog \
|
||||
libloc_stub \
|
||||
libandroid_runtime
|
||||
libloc_stub
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
platform_lib_android_runtime.cpp \
|
||||
platform_lib_gettid.cpp \
|
||||
platform_lib_log_util.cpp \
|
||||
platform_lib_property_service.cpp \
|
||||
@@ -26,29 +43,26 @@ LOCAL_CFLAGS += \
|
||||
-D_ANDROID_ \
|
||||
-std=c++11
|
||||
|
||||
|
||||
## Includes
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/../include \
|
||||
$(TARGET_OUT_HEADERS)/gps.utils \
|
||||
$(TARGET_OUT_HEADERS)/libloc_stub
|
||||
|
||||
LOCAL_COPY_HEADERS_TO:= libloc_pla/
|
||||
LOCAL_COPY_HEADERS:= \
|
||||
../include/platform_lib_android_runtime.h \
|
||||
../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
|
||||
$(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
|
||||
|
||||
39
gps/utils/platform_lib_abstractions/loc_pla/src/Makefile.am
Normal file
39
gps/utils/platform_lib_abstractions/loc_pla/src/Makefile.am
Normal file
@@ -0,0 +1,39 @@
|
||||
AM_CFLAGS = \
|
||||
$(LOCSTUB_CFLAGS) \
|
||||
-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
|
||||
@@ -1,40 +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_android_runtime.h"
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <loc_stub_android_runtime.h>
|
||||
#else
|
||||
#include <android_runtime/AndroidRuntime.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
pthread_t platform_lib_abstraction_createJavaThread(const char* name, void (*start)(void *), void* arg)
|
||||
{
|
||||
return (pthread_t)android::AndroidRuntime::createJavaThread(name, start, arg);
|
||||
}
|
||||
@@ -30,6 +30,12 @@
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <loc_stub_gettid.h>
|
||||
|
||||
#include <errno.h>
|
||||
const char* getprogname() {
|
||||
return program_invocation_short_name;
|
||||
}
|
||||
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
* 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)
|
||||
{
|
||||
@@ -40,3 +41,38 @@ char * get_timestamp(char *str, unsigned long buf_size)
|
||||
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;
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
* 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_property_service.h"
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <loc_stub_property_service.h>
|
||||
#else
|
||||
#include <cutils/properties.h>
|
||||
#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);
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <loc_stub_time.h>
|
||||
#else
|
||||
#include <utils/SystemClock.h>
|
||||
#include <utils/Timers.h>
|
||||
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
int64_t platform_lib_abstraction_elapsed_millis_since_boot()
|
||||
@@ -41,7 +43,17 @@ int64_t platform_lib_abstraction_elapsed_millis_since_boot()
|
||||
|
||||
#else
|
||||
|
||||
return android::elapsedRealtime();
|
||||
|
||||
//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
|
||||
}
|
||||
|
||||
9
gps/utils/platform_lib_abstractions/loc_stub/Makefile.am
Normal file
9
gps/utils/platform_lib_abstractions/loc_stub/Makefile.am
Normal file
@@ -0,0 +1,9 @@
|
||||
# Makefile.am for gps loc-stub
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = loc-stub.pc
|
||||
EXTRA_DIST = $(pkgconfig_DATA)
|
||||
67
gps/utils/platform_lib_abstractions/loc_stub/configure.ac
Normal file
67
gps/utils/platform_lib_abstractions/loc_stub/configure.ac
Normal file
@@ -0,0 +1,67 @@
|
||||
# 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
|
||||
@@ -37,6 +37,7 @@ extern "C" {
|
||||
|
||||
int64_t systemTime(int clock);
|
||||
int64_t elapsedMillisSinceBoot();
|
||||
int64_t elapsedMicrosSinceBoot();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
10
gps/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in
Normal file
10
gps/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in
Normal file
@@ -0,0 +1,10 @@
|
||||
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
|
||||
@@ -1,3 +1,4 @@
|
||||
ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
|
||||
ifneq ($(BUILD_TINY_ANDROID),true)
|
||||
#Compile this library only for builds with the latest modem image
|
||||
|
||||
@@ -30,20 +31,19 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/../include \
|
||||
|
||||
|
||||
LOCAL_COPY_HEADERS_TO:= libloc_stub/
|
||||
LOCAL_COPY_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
|
||||
|
||||
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
|
||||
|
||||
40
gps/utils/platform_lib_abstractions/loc_stub/src/Makefile.am
Normal file
40
gps/utils/platform_lib_abstractions/loc_stub/src/Makefile.am
Normal file
@@ -0,0 +1,40 @@
|
||||
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
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
namespace android {
|
||||
|
||||
pthread_t AndroidRuntime::createJavaThread(const char* name,
|
||||
pthread_t AndroidRuntime::createJavaThread(const char* /*name*/,
|
||||
void (*start)(void *), void* arg)
|
||||
{
|
||||
pthread_t threadId = 0;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int property_get(const char *key, char * value, const char *default_value)
|
||||
int property_get(const char *key, char * value, const char */*default_value*/)
|
||||
{
|
||||
/* This will disable gps interface
|
||||
value[0] = '1';
|
||||
|
||||
@@ -44,7 +44,7 @@ SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
int set_sched_policy(int tid, SchedPolicy policy)
|
||||
int set_sched_policy(int /*tid*/, SchedPolicy /*policy*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
#include "loc_stub_time.h"
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
int64_t systemTime(int clock)
|
||||
int64_t systemTime(int /*clock*/)
|
||||
{
|
||||
struct timeval t;
|
||||
t.tv_sec = t.tv_usec = 0;
|
||||
@@ -38,9 +39,17 @@ int64_t systemTime(int clock)
|
||||
return t.tv_sec*1000000LL + t.tv_usec;
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
int64_t t_us = systemTime(0);
|
||||
return (int64_t) t_us / 1000LL;
|
||||
return (int64_t) (elapsedMicrosSinceBoot() /1000000LL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user