summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android/Android.mk2
-rw-r--r--android/location_api/GnssAPIClient.cpp4
-rw-r--r--core/Android.mk2
-rw-r--r--core/LocAdapterBase.cpp28
-rw-r--r--core/LocApiBase.cpp122
-rw-r--r--core/SystemStatus.cpp14
-rw-r--r--core/loc_core_log.cpp2
-rw-r--r--gnss/Android.mk2
-rw-r--r--gnss/GnssAdapter.cpp7
-rw-r--r--location/Android.mk1
-rw-r--r--location/LocationAPIClientBase.cpp13
-rw-r--r--utils/Android.mk2
-rw-r--r--utils/LocThread.cpp4
-rw-r--r--utils/LocTimer.cpp6
-rw-r--r--utils/loc_misc_utils.cpp4
-rw-r--r--utils/msg_q.c6
-rw-r--r--utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp2
-rw-r--r--utils/platform_lib_abstractions/loc_pla/src/Android.mk20
-rw-r--r--utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp4
-rw-r--r--utils/platform_lib_abstractions/loc_stub/src/Android.mk2
-rw-r--r--utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp2
-rw-r--r--utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp2
-rw-r--r--utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp2
-rw-r--r--utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp2
24 files changed, 146 insertions, 109 deletions
diff --git a/android/Android.mk b/android/Android.mk
index 58d30f0..03ea1f3 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -46,6 +46,7 @@ LOCAL_SHARED_LIBRARIES += \
libloc_pla \
liblocation_api \
+LOCAL_CFLAGS += $(GNSS_CFLAGS)
include $(BUILD_SHARED_LIBRARY)
BUILD_GNSS_HIDL_SERVICE := true
@@ -86,5 +87,6 @@ LOCAL_SHARED_LIBRARIES += \
libhidltransport \
android.hardware.gnss@1.0 \
+LOCAL_CFLAGS += $(GNSS_CFLAGS)
include $(BUILD_EXECUTABLE)
endif # BUILD_GNSS_HIDL_SERVICE
diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp
index 5270576..0cccb27 100644
--- a/android/location_api/GnssAPIClient.cpp
+++ b/android/location_api/GnssAPIClient.cpp
@@ -165,7 +165,7 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode,
else if (mode == IGnss::GnssPositionMode::MS_ASSISTED)
mLocationOptions.mode = GNSS_SUPL_MODE_MSA;
else {
- LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, mode);
+ LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, (int)mode);
retVal = false;
}
locAPIUpdateTrackingOptions(mLocationOptions);
@@ -185,7 +185,7 @@ void GnssAPIClient::gnssNiRespond(int32_t notifId,
else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP)
data = GNSS_NI_RESPONSE_NO_RESPONSE;
else {
- LOC_LOGD("%s]: invalid GnssUserResponseType: %d", __FUNCTION__, userResponse);
+ LOC_LOGD("%s]: invalid GnssUserResponseType: %d", __FUNCTION__, (int)userResponse);
return;
}
locAPIGnssNiResponse(notifId, data);
diff --git a/core/Android.mk b/core/Android.mk
index cc99333..ee07c19 100644
--- a/core/Android.mk
+++ b/core/Android.mk
@@ -42,6 +42,8 @@ LOCAL_HEADER_LIBRARIES := \
libloc_pla_headers \
liblocation_api_headers
+LOCAL_CFLAGS += $(GNSS_CFLAGS)
+
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp
index 7cb4086..9d89c4b 100644
--- a/core/LocAdapterBase.cpp
+++ b/core/LocAdapterBase.cpp
@@ -79,7 +79,7 @@ void LocAdapterBase::
const GpsLocationExtended& locationExtended,
enum loc_sess_status status,
LocPosTechMask loc_technology_mask,
- bool fromUlp) {
+ bool /*fromUlp*/) {
if (mLocAdapterProxyBase != NULL) {
mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location,
(GpsLocationExtended&)locationExtended,
@@ -91,29 +91,29 @@ void LocAdapterBase::
}
void LocAdapterBase::
- reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp)
+ reportSvEvent(const GnssSvNotification& /*svNotify*/, bool /*fromUlp*/)
DEFAULT_IMPL()
void LocAdapterBase::
- reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet)
+ reportSvMeasurementEvent(GnssSvMeasurementSet &/*svMeasurementSet*/)
DEFAULT_IMPL()
void LocAdapterBase::
- reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial)
+ reportSvPolynomialEvent(GnssSvPolynomial &/*svPolynomial*/)
DEFAULT_IMPL()
void LocAdapterBase::
- reportStatus(LocGpsStatusValue status)
+ reportStatus(LocGpsStatusValue /*status*/)
DEFAULT_IMPL()
void LocAdapterBase::
- reportNmeaEvent(const char* nmea, size_t length, bool fromUlp)
+ reportNmeaEvent(const char* /*nmea*/, size_t /*length*/, bool /*fromUlp*/)
DEFAULT_IMPL()
bool LocAdapterBase::
- reportXtraServer(const char* url1, const char* url2,
- const char* url3, const int maxlength)
+ reportXtraServer(const char* /*url1*/, const char* /*url2*/,
+ const char* /*url3*/, const int /*maxlength*/)
DEFAULT_IMPL(false)
bool LocAdapterBase::
@@ -129,15 +129,15 @@ bool LocAdapterBase::
DEFAULT_IMPL(false)
bool LocAdapterBase::
- requestATL(int connHandle, LocAGpsType agps_type)
+ requestATL(int /*connHandle*/, LocAGpsType /*agps_type*/)
DEFAULT_IMPL(false)
bool LocAdapterBase::
- releaseATL(int connHandle)
+ releaseATL(int /*connHandle*/)
DEFAULT_IMPL(false)
bool LocAdapterBase::
- requestSuplES(int connHandle)
+ requestSuplES(int /*connHandle*/)
DEFAULT_IMPL(false)
bool LocAdapterBase::
@@ -149,15 +149,15 @@ bool LocAdapterBase::
DEFAULT_IMPL(false)
bool LocAdapterBase::
- requestNiNotifyEvent(const GnssNiNotification &notify, const void* data)
+ requestNiNotifyEvent(const GnssNiNotification &/*notify*/, const void* /*data*/)
DEFAULT_IMPL(false)
void LocAdapterBase::
- reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify)
+ reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& /*measurementsNotify*/)
DEFAULT_IMPL()
bool LocAdapterBase::
- reportWwanZppFix(LocGpsLocation &zppLoc)
+ reportWwanZppFix(LocGpsLocation &/*zppLoc*/)
DEFAULT_IMPL(false)
} // namespace loc_core
diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp
index 2dcd4cd..6cc00b1 100644
--- a/core/LocApiBase.cpp
+++ b/core/LocApiBase.cpp
@@ -30,6 +30,7 @@
#define LOG_TAG "LocSvc_LocApiBase"
#include <dlfcn.h>
+#include <inttypes.h>
#include <LocApiBase.h>
#include <LocAdapterBase.h>
#include <platform_lib_log_util.h>
@@ -96,10 +97,10 @@ struct LocSsrMsg : public LocMsg {
mLocApi->close();
mLocApi->open(mLocApi->getEvtMask());
}
- inline void locallog() {
+ inline void locallog() const {
LOC_LOGV("LocSsrMsg");
}
- inline virtual void log() {
+ inline virtual void log() const {
locallog();
}
};
@@ -116,11 +117,11 @@ struct LocOpenMsg : public LocMsg {
inline virtual void proc() const {
mLocApi->open(mMask);
}
- inline void locallog() {
+ inline void locallog() const {
LOC_LOGV("%s:%d]: LocOpen Mask: %x\n",
__func__, __LINE__, mMask);
}
- inline virtual void log() {
+ inline virtual void log() const {
locallog();
}
};
@@ -128,8 +129,8 @@ struct LocOpenMsg : public LocMsg {
LocApiBase::LocApiBase(const MsgTask* msgTask,
LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
ContextBase* context) :
- mExcludedMask(excludedMask), mMsgTask(msgTask),
- mMask(0), mSupportedMsg(0), mContext(context)
+ mMsgTask(msgTask), mContext(context), mSupportedMsg(0),
+ mMask(0), mExcludedMask(excludedMask)
{
memset(mLocAdapters, 0, sizeof(mLocAdapters));
memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported));
@@ -235,9 +236,10 @@ void LocApiBase::reportPosition(UlpLocation& location,
// print the location info before delivering
LOC_LOGD("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n "
"altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n "
- "timestamp: %lld\n rawDataSize: %d\n rawData: %p\n "
+ "timestamp: %" PRId64 "\n rawDataSize: %d\n rawData: %p\n "
"Session status: %d\n Technology mask: %u\n "
- "SV used in fix (gps/glo/bds/gal/qzss) : (%x/%x/%x/%x/%x)",
+ "SV used in fix (gps/glo/bds/gal/qzss) : \
+ (%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 ")",
location.gpsLocation.flags, location.position_source,
location.gpsLocation.latitude, location.gpsLocation.longitude,
location.gpsLocation.altitude, location.gpsLocation.speed,
@@ -268,16 +270,16 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify)
"QZSS", "BEIDOU", "GALILEO" };
// print the SV info before delivering
- LOC_LOGV("num sv: %d\n"
+ LOC_LOGV("num sv: %zu\n"
" sv: constellation svid cN0"
" elevation azimuth flags",
svNotify.count);
- for (int i = 0; i < svNotify.count && i < LOC_GNSS_MAX_SVS; i++) {
+ for (size_t i = 0; i < svNotify.count && i < LOC_GNSS_MAX_SVS; i++) {
if (svNotify.gnssSvs[i].type >
sizeof(constellationString) / sizeof(constellationString[0]) - 1) {
svNotify.gnssSvs[i].type = GNSS_SV_TYPE_UNKNOWN;
}
- LOC_LOGV(" %03d: %*s %02d %f %f %f 0x%02X",
+ LOC_LOGV(" %03zu: %*s %02d %f %f %f 0x%02X",
i,
13,
constellationString[svNotify.gnssSvs[i].type],
@@ -406,7 +408,7 @@ void LocApiBase::reportGnssMeasurementData(GnssMeasurementsNotification& measure
}
enum loc_api_adapter_err LocApiBase::
- open(LOC_API_ADAPTER_EVENT_MASK_T mask)
+ open(LOC_API_ADAPTER_EVENT_MASK_T /*mask*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
@@ -414,7 +416,7 @@ enum loc_api_adapter_err LocApiBase::
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- startFix(const LocPosMode& posMode)
+ startFix(const LocPosMode& /*posMode*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
@@ -422,27 +424,27 @@ enum loc_api_adapter_err LocApiBase::
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
LocationError LocApiBase::
- deleteAidingData(const GnssAidingData& data)
+ deleteAidingData(const GnssAidingData& /*data*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- enableData(int enable)
+ enableData(int /*enable*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setAPN(char* apn, int len)
+ setAPN(char* /*apn*/, int /*len*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- injectPosition(double latitude, double longitude, float accuracy)
+ injectPosition(double /*latitude*/, double /*longitude*/, float /*accuracy*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty)
+ setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setXtraData(char* data, int length)
+ setXtraData(char* /*data*/, int /*length*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
@@ -450,83 +452,83 @@ enum loc_api_adapter_err LocApiBase::
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- atlOpenStatus(int handle, int is_succ, char* apn,
- AGpsBearerType bear, LocAGpsType agpsType)
+ atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/,
+ AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- atlCloseStatus(int handle, int is_succ)
+ atlCloseStatus(int /*handle*/, int /*is_succ*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setPositionMode(const LocPosMode& posMode)
+ setPositionMode(const LocPosMode& /*posMode*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
LocationError LocApiBase::
- setServer(const char* url, int len)
+ setServer(const char* /*url*/, int /*len*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
LocationError LocApiBase::
- setServer(unsigned int ip, int port, LocServerType type)
+ setServer(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
LocationError LocApiBase::
- informNiResponse(GnssNiResponse userResponse, const void* passThroughData)
+ informNiResponse(GnssNiResponse /*userResponse*/, const void* /*passThroughData*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
LocationError LocApiBase::
- setSUPLVersion(GnssConfigSuplVersion version)
+ setSUPLVersion(GnssConfigSuplVersion /*version*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setNMEATypes (uint32_t typesMask)
+ setNMEATypes (uint32_t /*typesMask*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
LocationError LocApiBase::
- setLPPConfig(GnssConfigLppProfile profile)
+ setLPPConfig(GnssConfigLppProfile /*profile*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setSensorControlConfig(int sensorUsage,
- int sensorProvider)
+ setSensorControlConfig(int /*sensorUsage*/,
+ int /*sensorProvider*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setSensorProperties(bool gyroBiasVarianceRandomWalk_valid,
- float gyroBiasVarianceRandomWalk,
- bool accelBiasVarianceRandomWalk_valid,
- float accelBiasVarianceRandomWalk,
- bool angleBiasVarianceRandomWalk_valid,
- float angleBiasVarianceRandomWalk,
- bool rateBiasVarianceRandomWalk_valid,
- float rateBiasVarianceRandomWalk,
- bool velocityBiasVarianceRandomWalk_valid,
- float velocityBiasVarianceRandomWalk)
+ setSensorProperties(bool /*gyroBiasVarianceRandomWalk_valid*/,
+ float /*gyroBiasVarianceRandomWalk*/,
+ bool /*accelBiasVarianceRandomWalk_valid*/,
+ float /*accelBiasVarianceRandomWalk*/,
+ bool /*angleBiasVarianceRandomWalk_valid*/,
+ float /*angleBiasVarianceRandomWalk*/,
+ bool /*rateBiasVarianceRandomWalk_valid*/,
+ float /*rateBiasVarianceRandomWalk*/,
+ bool /*velocityBiasVarianceRandomWalk_valid*/,
+ float /*velocityBiasVarianceRandomWalk*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setSensorPerfControlConfig(int controlMode,
- int accelSamplesPerBatch,
- int accelBatchesPerSec,
- int gyroSamplesPerBatch,
- int gyroBatchesPerSec,
- int accelSamplesPerBatchHigh,
- int accelBatchesPerSecHigh,
- int gyroSamplesPerBatchHigh,
- int gyroBatchesPerSecHigh,
- int algorithmConfig)
+ setSensorPerfControlConfig(int /*controlMode*/,
+ int /*accelSamplesPerBatch*/,
+ int /*accelBatchesPerSec*/,
+ int /*gyroSamplesPerBatch*/,
+ int /*gyroBatchesPerSec*/,
+ int /*accelSamplesPerBatchHigh*/,
+ int /*accelBatchesPerSecHigh*/,
+ int /*gyroSamplesPerBatchHigh*/,
+ int /*gyroBatchesPerSecHigh*/,
+ int /*algorithmConfig*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
LocationError LocApiBase::
- setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol)
+ setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
LocationError LocApiBase::
- setLPPeProtocolCp(GnssConfigLppeControlPlaneMask lppeCP)
+ setLPPeProtocolCp(GnssConfigLppeControlPlaneMask /*lppeCP*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
LocationError LocApiBase::
- setLPPeProtocolUp(GnssConfigLppeUserPlaneMask lppeUP)
+ setLPPeProtocolUp(GnssConfigLppeUserPlaneMask /*lppeUP*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
@@ -549,7 +551,7 @@ enum loc_api_adapter_err LocApiBase::
}
int LocApiBase::
- initDataServiceClient(bool isDueToSsr)
+ initDataServiceClient(bool /*isDueToSsr*/)
DEFAULT_IMPL(-1)
int LocApiBase::
@@ -569,13 +571,13 @@ void LocApiBase::
DEFAULT_IMPL()
LocationError LocApiBase::
- setGpsLock(GnssConfigGpsLock lock)
+ setGpsLock(GnssConfigGpsLock /*lock*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
void LocApiBase::
- installAGpsCert(const LocDerEncodedCertificate* pData,
- size_t length,
- uint32_t slotBitMask)
+ installAGpsCert(const LocDerEncodedCertificate* /*pData*/,
+ size_t /*length*/,
+ uint32_t /*slotBitMask*/)
DEFAULT_IMPL()
int LocApiBase::
@@ -583,7 +585,7 @@ int LocApiBase::
DEFAULT_IMPL(-1)
LocationError LocApiBase::
- setXtraVersionCheck(uint32_t check)
+ setXtraVersionCheck(uint32_t /*check*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
bool LocApiBase::
diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp
index 939005d..50cb4ed 100644
--- a/core/SystemStatus.cpp
+++ b/core/SystemStatus.cpp
@@ -28,6 +28,7 @@
*/
#define LOG_TAG "LocSvc_SystemStatus"
+#include <inttypes.h>
#include <string>
#include <stdlib.h>
#include <string.h>
@@ -183,7 +184,7 @@ public:
{
memset(&mM1, 0, sizeof(mM1));
if (mField.size() < eMax) {
- LOC_LOGE("PQWM1parser - invalid size=%d", mField.size());
+ LOC_LOGE("PQWM1parser - invalid size=%zu", mField.size());
mM1.mTimeValid = 0;
return;
}
@@ -615,7 +616,7 @@ public:
: SystemStatusNmeaBase(str_in, len_in)
{
if (mField.size() < eMax) {
- LOC_LOGE("PQWP7parser - invalid size=%d", mField.size());
+ LOC_LOGE("PQWP7parser - invalid size=%zu", mField.size());
return;
}
for (uint32_t i=0; i<SV_ALL_NUM; i++) {
@@ -944,7 +945,7 @@ bool SystemStatusXtra::equals(SystemStatusXtra& peer)
void SystemStatusXtra::dump()
{
- LOC_LOGV("SystemStatusXtra: u=%ld:%ld m=%x a=%d:%d:%d:%d:%d v=%x:%x:%x:%x:%x",
+ LOC_LOGV("SystemStatusXtra: u=%ld:%ld m=%x a=%d:%d:%d:%d:%d v=%x:%x:%" PRIx64 ":%" PRIx64":%x",
mUtcTime.tv_sec, mUtcTime.tv_nsec,
mXtraValidMask,
mGpsXtraAge,
@@ -986,7 +987,7 @@ bool SystemStatusEphemeris::equals(SystemStatusEphemeris& peer)
void SystemStatusEphemeris::dump()
{
- LOC_LOGV("Ephemeris: u=%ld:%ld ev=%x:%x:%x:%x:%x",
+ LOC_LOGV("Ephemeris: u=%ld:%ld ev=%x:%x:%" PRIx64 ":%" PRIx64 ":%x",
mUtcTime.tv_sec, mUtcTime.tv_nsec,
mGpsEpheValid,
mGloEpheValid,
@@ -1042,7 +1043,10 @@ bool SystemStatusSvHealth::equals(SystemStatusSvHealth& peer)
void SystemStatusSvHealth::dump()
{
- LOC_LOGV("SvHealth: u=%ld:%ld u=%x:%x:%x:%x:%x g=%x:%x:%x:%x:%x b=%x:%x:%x:%x:%x",
+ LOC_LOGV("SvHealth: u=%ld:%ld \
+ u=%x:%x:%" PRIx64 ":%" PRIx64 ":%x \
+ g=%x:%x:%" PRIx64 ":%" PRIx64 ":%x \
+ b=%x:%x:%" PRIx64 ":%" PRIx64 ":%x",
mUtcTime.tv_sec, mUtcTime.tv_nsec,
mGpsUnknownMask,
mGloUnknownMask,
diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp
index ae5948d..5a627dd 100644
--- a/core/loc_core_log.cpp
+++ b/core/loc_core_log.cpp
@@ -120,7 +120,7 @@ static const loc_name_val_s_type loc_eng_aiding_data_bits[] =
};
static const int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type);
-const char* loc_get_aiding_data_mask_names(LocGpsAidingData data)
+const char* loc_get_aiding_data_mask_names(LocGpsAidingData /*data*/)
{
return NULL;
}
diff --git a/gnss/Android.mk b/gnss/Android.mk
index 9585b73..fe89862 100644
--- a/gnss/Android.mk
+++ b/gnss/Android.mk
@@ -36,6 +36,8 @@ LOCAL_HEADER_LIBRARIES := \
libloc_pla_headers \
liblocation_api_headers
+LOCAL_CFLAGS += $(GNSS_CFLAGS)
+
LOCAL_PRELINK_MODULE := false
include $(BUILD_SHARED_LIBRARY)
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp
index 399e0ae..8dca6c6 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -28,6 +28,7 @@
*/
#define LOG_TAG "LocSvc_GnssAdapter"
+#include <inttypes.h>
#include <sys/stat.h>
#include <errno.h>
#include <ctype.h>
@@ -2453,7 +2454,7 @@ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){
return;
} else {
mAgpsCbInfo = cbInfo;
- LOC_LOGI("Registering AGPS CB 0x%x with priority %d",
+ LOC_LOGI("Registering AGPS CB %p with priority %d",
mAgpsCbInfo.statusV4Cb, mAgpsCbInfo.cbPriority);
}
@@ -2896,7 +2897,7 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r)
reports.mTimeAndClock.back().mLeapSecUnc)*1000);
r.mTime.frequencyUncertaintyNsPerSec =
(float)(reports.mTimeAndClock.back().mClockFreqBiasUnc);
- LOC_LOGV("getDebugReport - timeestimate=%ld unc=%f frequnc=%f",
+ LOC_LOGV("getDebugReport - timeestimate=%" PRIu64 " unc=%f frequnc=%f",
r.mTime.timeEstimate,
r.mTime.timeUncertaintyNs, r.mTime.frequencyUncertaintyNsPerSec);
}
@@ -2910,7 +2911,7 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r)
convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_QZSS, reports);
convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_BEIDOU, reports);
convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_GALILEO, reports);
- LOC_LOGV("getDebugReport - satellite=%lu", r.mSatelliteInfo.size());
+ LOC_LOGV("getDebugReport - satellite=%zu", r.mSatelliteInfo.size());
return true;
}
diff --git a/location/Android.mk b/location/Android.mk
index 728bdb4..6ac8e36 100644
--- a/location/Android.mk
+++ b/location/Android.mk
@@ -30,6 +30,7 @@ LOCAL_HEADER_LIBRARIES := \
LOCAL_PRELINK_MODULE := false
+LOCAL_CFLAGS += $(GNSS_CFLAGS)
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp
index d8eae3f..02bd3dd 100644
--- a/location/LocationAPIClientBase.cpp
+++ b/location/LocationAPIClientBase.cpp
@@ -30,6 +30,7 @@
#define LOG_TAG "LocSvc_APIClientBase"
#include <platform_lib_log_util.h>
+#include <inttypes.h>
#include <loc_cfg.h>
#include "LocationAPIClientBase.h"
@@ -598,7 +599,7 @@ void LocationAPIClientBase::locAPIRemoveGeofences(size_t count, uint32_t* ids)
if (mLocationAPI) {
uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count);
if (sessions == NULL) {
- LOC_LOGE("%s:%d] Failed to allocate %d bytes !",
+ LOC_LOGE("%s:%d] Failed to allocate %zu bytes !",
__FUNCTION__, __LINE__, sizeof(uint32_t) * count);
pthread_mutex_unlock(&mMutex);
return;
@@ -633,7 +634,7 @@ void LocationAPIClientBase::locAPIModifyGeofences(
if (mLocationAPI) {
uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count);
if (sessions == NULL) {
- LOC_LOGE("%s:%d] Failed to allocate %d bytes !",
+ LOC_LOGE("%s:%d] Failed to allocate %zu bytes !",
__FUNCTION__, __LINE__, sizeof(uint32_t) * count);
pthread_mutex_unlock(&mMutex);
return;
@@ -668,7 +669,7 @@ void LocationAPIClientBase::locAPIPauseGeofences(size_t count, uint32_t* ids)
if (mLocationAPI) {
uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count);
if (sessions == NULL) {
- LOC_LOGE("%s:%d] Failed to allocate %d bytes !",
+ LOC_LOGE("%s:%d] Failed to allocate %zu bytes !",
__FUNCTION__, __LINE__, sizeof(uint32_t) * count);
pthread_mutex_unlock(&mMutex);
return;
@@ -703,7 +704,7 @@ void LocationAPIClientBase::locAPIResumeGeofences(
if (mLocationAPI) {
uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count);
if (sessions == NULL) {
- LOC_LOGE("%s:%d] Failed to allocate %d bytes !",
+ LOC_LOGE("%s:%d] Failed to allocate %zu bytes !",
__FUNCTION__, __LINE__, sizeof(uint32_t) * count);
pthread_mutex_unlock(&mMutex);
return;
@@ -742,7 +743,7 @@ void LocationAPIClientBase::locAPIRemoveAllGeofences()
size_t count = sessionsVec.size();
uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count);
if (sessions == NULL) {
- LOC_LOGE("%s:%d] Failed to allocate %d bytes !",
+ LOC_LOGE("%s:%d] Failed to allocate %zu bytes !",
__FUNCTION__, __LINE__, sizeof(uint32_t) * count);
pthread_mutex_unlock(&mMutex);
return;
@@ -792,7 +793,7 @@ void LocationAPIClientBase::beforeGeofenceBreachCb(
geofenceBreachCallback genfenceCallback = nullptr;
if (ids == NULL) {
- LOC_LOGE("%s:%d] Failed to alloc %d bytes",
+ LOC_LOGE("%s:%d] Failed to alloc %zu bytes",
__FUNCTION__, __LINE__,
sizeof(uint32_t) * geofenceBreachNotification.count);
return;
diff --git a/utils/Android.mk b/utils/Android.mk
index eeef223..3f3b83a 100644
--- a/utils/Android.mk
+++ b/utils/Android.mk
@@ -51,6 +51,8 @@ LOCAL_MODULE_TAGS := optional
LOCAL_PRELINK_MODULE := false
+LOCAL_CFLAGS += $(GNSS_CFLAGS)
+
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
diff --git a/utils/LocThread.cpp b/utils/LocThread.cpp
index 685841e..d112f61 100644
--- a/utils/LocThread.cpp
+++ b/utils/LocThread.cpp
@@ -65,7 +65,7 @@ public:
// threashold approprietly for destroy(), e.g. mRefCount.
LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator,
const char* threadName, LocRunnable* runnable, bool joinable) :
- mRunnable(runnable), mJoinable(joinable), mThandle(NULL),
+ mRunnable(runnable), mJoinable(joinable), mThandle((pthread_t)NULL),
mMutex(PTHREAD_MUTEX_INITIALIZER), mRefCount(2) {
// set up thread name, if nothing is passed in
@@ -79,7 +79,7 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator,
mThandle = creator(threadName, threadMain, this);
} else if (pthread_create(&mThandle, NULL, threadMain, this)) {
// pthread_create() failed
- mThandle = NULL;
+ mThandle = (pthread_t)NULL;
}
if (mThandle) {
diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp
index c08bd35..5b653eb 100644
--- a/utils/LocTimer.cpp
+++ b/utils/LocTimer.cpp
@@ -283,7 +283,8 @@ void LocTimerContainer::updateSoonestTime(LocTimerDelegate* priorTop) {
// check if top has changed
if (curTop != priorTop) {
- struct itimerspec delay = {0};
+ struct itimerspec delay;
+ memset(&delay, 0, sizeof(struct itimerspec));
bool toSetTime = false;
// if tree is empty now, we remove poll and disarm timer
if (!curTop) {
@@ -374,7 +375,8 @@ void LocTimerContainer::expire() {
}
};
- struct itimerspec delay = {0};
+ struct itimerspec delay;
+ memset(&delay, 0, sizeof(struct itimerspec));
timerfd_settime(getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL);
mPollTask->removePoll(*this);
mMsgTask->sendMsg(new MsgTimerExpire(*this));
diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp
index 5d66991..fd3ee6b 100644
--- a/utils/loc_misc_utils.cpp
+++ b/utils/loc_misc_utils.cpp
@@ -26,14 +26,14 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+#define LOG_NDEBUG 0
+#define LOG_TAG "LocSvc_misc_utils"
#include <stdio.h>
#include <string.h>
#include <platform_lib_log_util.h>
#include <loc_misc_utils.h>
#include <ctype.h>
-#define LOG_NDEBUG 0
-#define LOG_TAG "LocSvc_misc_utils"
int loc_util_split_string(char *raw_string, char **split_strings_ptr,
int max_num_substrings, char delimiter)
diff --git a/utils/msg_q.c b/utils/msg_q.c
index 10c4e48..e8b4ffe 100644
--- a/utils/msg_q.c
+++ b/utils/msg_q.c
@@ -198,7 +198,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*)
msg_q* p_msg_q = (msg_q*)msg_q_data;
pthread_mutex_lock(&p_msg_q->list_mutex);
- LOC_LOGV("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj);
+ LOC_LOGV("%s: Sending message with handle = %p\n", __FUNCTION__, msg_obj);
if( p_msg_q->unblocked )
{
@@ -214,7 +214,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*)
pthread_mutex_unlock(&p_msg_q->list_mutex);
- LOC_LOGV("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj);
+ LOC_LOGV("%s: Finished Sending message with handle = %p\n", __FUNCTION__, msg_obj);
return rv;
}
@@ -260,7 +260,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj)
pthread_mutex_unlock(&p_msg_q->list_mutex);
- LOC_LOGV("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv);
+ LOC_LOGV("%s: Received message %p rv = %d\n", __FUNCTION__, *msg_obj, rv);
return rv;
}
diff --git a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp
index e8cb93a..6c183a8 100644
--- a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp
+++ b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp
@@ -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;
diff --git a/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/utils/platform_lib_abstractions/loc_pla/src/Android.mk
index 98f25b3..ab13717 100644
--- a/utils/platform_lib_abstractions/loc_pla/src/Android.mk
+++ b/utils/platform_lib_abstractions/loc_pla/src/Android.mk
@@ -1,3 +1,21 @@
+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
@@ -38,7 +56,7 @@ 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)
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
index 1cc63ab..dccdebc 100644
--- 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
@@ -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);
diff --git a/utils/platform_lib_abstractions/loc_stub/src/Android.mk b/utils/platform_lib_abstractions/loc_stub/src/Android.mk
index 041ba64..08697cb 100644
--- a/utils/platform_lib_abstractions/loc_stub/src/Android.mk
+++ b/utils/platform_lib_abstractions/loc_stub/src/Android.mk
@@ -37,7 +37,7 @@ 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)
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
index 1db69b2..068df4e 100644
--- 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
@@ -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;
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
index f9d9e3e..907ab02 100644
--- 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
@@ -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';
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
index 781be29..5e26245 100644
--- 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
@@ -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;
}
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
index 499cf00..48149a6 100644
--- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp
+++ b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp
@@ -31,7 +31,7 @@
#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;