From c7265bbe1daf6033a7c2b047a5e72c50e032ade6 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 7 May 2014 17:12:49 -0700 Subject: [PATCH 1/2] Revert "Avoid GPS build for MSM8916 64bit" This reverts commit 0daddfd2fd9f38cce21d604d7d981e8972557740. Change-Id: I3138bb2d600618cfec5ec7588d5359b15a07cbad --- core/Android.mk | 2 -- etc/Android.mk | 4 ++-- loc_api/Android.mk | 2 -- utils/Android.mk | 2 -- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/core/Android.mk b/core/Android.mk index 0d1b7c2b..3e2b2eb8 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -1,4 +1,3 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifneq ($(BUILD_TINY_ANDROID),true) @@ -52,4 +51,3 @@ include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE -endif # not aarch64 diff --git a/etc/Android.mk b/etc/Android.mk index 452dcd21..025d3f74 100644 --- a/etc/Android.mk +++ b/etc/Android.mk @@ -1,4 +1,4 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) + LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -9,4 +9,4 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ LOCAL_SRC_FILES := gps.conf include $(BUILD_PREBUILT) -endif # not aarch64 + diff --git a/loc_api/Android.mk b/loc_api/Android.mk index e58f18e2..743b3860 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -1,4 +1,3 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) @@ -16,4 +15,3 @@ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ include $(addsuffix Android.mk, $(GPS_DIR_LIST)) endif#BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE -endif # not aarch64 diff --git a/utils/Android.mk b/utils/Android.mk index 82c56f6a..07c1b1da 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -1,4 +1,3 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifneq ($(BUILD_TINY_ANDROID),true) #Compile this library only for builds with the latest modem image @@ -61,4 +60,3 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE -endif # not aarch64 From 6fc3071b05d501a29e163cc63f573f6774e9bae4 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 3 Jun 2014 16:13:59 -0700 Subject: [PATCH 2/2] KW warnings dlsym on gps_geofence_get_interface should check NULL, and gmtime return should also check NULL Change-Id: I23ab17f016ad9f4667ac197c12f016433c48af90 CRs-Fixed: 674884 --- loc_api/libloc_api_50001/loc.cpp | 2 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 97a610ca..0a67477f 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -603,7 +603,7 @@ const GpsGeofencingInterface* get_geofence_interface(void) } dlerror(); /* Clear any existing error */ get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface"); - if ((error = dlerror()) != NULL) { + if ((error = dlerror()) != NULL && NULL != get_gps_geofence_interface) { LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error); goto exit; } diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 842eda1f..4c6b9a3a 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -119,14 +119,17 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, unsigned char generate_nmea) { ENTRY_LOG(); + time_t utcTime(location.gpsLocation.timestamp/1000); + tm * pTm = gmtime(&utcTime); + if (NULL == pTm) { + LOC_LOGE("gmtime failed"); + return; + } char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; char* pMarker = sentence; int lengthRemaining = sizeof(sentence); int length = 0; - - time_t utcTime(location.gpsLocation.timestamp/1000); - tm * pTm = gmtime(&utcTime); int utcYear = pTm->tm_year % 100; // 2 digit year int utcMonth = pTm->tm_mon + 1; // tm_mon starts at zero int utcDay = pTm->tm_mday;