diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2024-10-17 09:31:12 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-10-17 11:53:26 +0530 |
commit | baa3641d5f8e64288f45432d6e4989701dbbcc0f (patch) | |
tree | 1ba8efafae76794db4d0853462f04c71d1f2e3e6 /gps/pla | |
parent | 360bc96adec406327820363cd5f79d3d0edbddf7 (diff) |
msm8996-common: Import newer GPS stack from xiaomi_msm8996-common
Change-Id: I5afe78048c4af3648b2d267d71a58b63b9decbc9
Diffstat (limited to 'gps/pla')
-rw-r--r-- | gps/pla/Android.mk | 15 | ||||
-rw-r--r-- | gps/pla/android/loc_pla.h | 9 | ||||
-rw-r--r-- | gps/pla/oe/loc_pla.h | 36 |
3 files changed, 56 insertions, 4 deletions
diff --git a/gps/pla/Android.mk b/gps/pla/Android.mk index 5d6bb97..a57861d 100644 --- a/gps/pla/Android.mk +++ b/gps/pla/Android.mk @@ -1,6 +1,19 @@ GNSS_CFLAGS := \ -Werror \ - -Wno-undefined-bool-conversion + -Wno-error=unused-parameter \ + -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) diff --git a/gps/pla/android/loc_pla.h b/gps/pla/android/loc_pla.h index 9caae73..ab8c75e 100644 --- a/gps/pla/android/loc_pla.h +++ b/gps/pla/android/loc_pla.h @@ -39,8 +39,15 @@ extern "C" { #endif #include <cutils/properties.h> -#include <cutils/threads.h> #include <cutils/sched_policy.h> +#include <cutils/android_filesystem_config.h> +#include <string.h> +#include <stdlib.h> + +#define UID_GPS (AID_GPS) +#define GID_GPS (AID_GPS) +#define UID_LOCCLIENT (4021) +#define GID_LOCCLIENT (4021) #define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" #define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" diff --git a/gps/pla/oe/loc_pla.h b/gps/pla/oe/loc_pla.h index 3ca1964..1e3d6c5 100644 --- a/gps/pla/oe/loc_pla.h +++ b/gps/pla/oe/loc_pla.h @@ -30,16 +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/threads.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 @@ -51,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" @@ -60,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 */ |