diff options
Diffstat (limited to 'gps/pla/oe/loc_pla.h')
-rw-r--r-- | gps/pla/oe/loc_pla.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/gps/pla/oe/loc_pla.h b/gps/pla/oe/loc_pla.h index 6c6dde9..1e3d6c5 100644 --- a/gps/pla/oe/loc_pla.h +++ b/gps/pla/oe/loc_pla.h @@ -30,15 +30,33 @@ #define __LOC_PLA__ #ifdef __cplusplus +#ifndef FEATURE_EXTERNAL_AP #include <utils/SystemClock.h> -#define uptimeMillis android::uptimeMillis +#endif /* FEATURE_EXTERNAL_AP */ +#include <inttypes.h> +#include <sys/time.h> +#include <time.h> + +inline int64_t uptimeMillis() +{ + struct timespec ts; + int64_t time_ms = 0; + clock_gettime(CLOCK_BOOTTIME, &ts); + time_ms += (ts.tv_sec * 1000000000LL); + time_ms += ts.tv_nsec + 500000LL; + return time_ms / 1000000LL; +} extern "C" { #endif +#ifndef FEATURE_EXTERNAL_AP #include <cutils/properties.h> #include <cutils/sched_policy.h> +#endif /* FEATURE_EXTERNAL_AP */ +#include <pthread.h> #include <sys/time.h> +#include <sys/types.h> #include <string.h> #include <stdlib.h> #ifndef OFF_TARGET @@ -50,6 +68,11 @@ extern "C" { #define strlcpy strncpy #endif +#define UID_GPS (1021) +#define GID_GPS (1021) +#define UID_LOCCLIENT (4021) +#define GID_LOCCLIENT (4021) + #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" @@ -59,6 +82,16 @@ extern "C" { #define LOC_PATH_XTWIFI_CONF_STR "/etc/xtwifi.conf" #define LOC_PATH_QUIPC_CONF_STR "/etc/quipc.conf" +#ifdef FEATURE_EXTERNAL_AP +#define PROPERTY_VALUE_MAX 92 + +inline int property_get(const char* key, char* value, const char* default_value) +{ + strlcpy(value, default_value, PROPERTY_VALUE_MAX - 1); + return strlen(value); +} +#endif /* FEATURE_EXTERNAL_AP */ + #ifdef __cplusplus } #endif /*__cplusplus */ |