From 0830f02f9e1f7e80ab5ba85602f4253f8b2aa094 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 21 Mar 2017 17:06:09 -0700 Subject: [PATCH 01/10] msm8974-common: gps: Remove owner of gps hal modules Owner does not need to be specified for this project. Change-Id: I918a767ed3b83e134c5e63ded5b25070b3399ac8 --- gps/core/Android.mk | 1 - gps/loc_api/libloc_api_50001/Android.mk | 2 -- gps/utils/Android.mk | 1 - 3 files changed, 4 deletions(-) diff --git a/gps/core/Android.mk b/gps/core/Android.mk index 02c689a..0bccba2 100644 --- a/gps/core/Android.mk +++ b/gps/core/Android.mk @@ -3,7 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libloc_core -LOCAL_MODULE_OWNER := qcom LOCAL_PROPRIETARY_MODULE := true LOCAL_MODULE_TAGS := optional diff --git a/gps/loc_api/libloc_api_50001/Android.mk b/gps/loc_api/libloc_api_50001/Android.mk index 05bbe89..e44b5e6 100644 --- a/gps/loc_api/libloc_api_50001/Android.mk +++ b/gps/loc_api/libloc_api_50001/Android.mk @@ -3,7 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libloc_eng -LOCAL_MODULE_OWNER := qcom LOCAL_PROPRIETARY_MODULE := true LOCAL_MODULE_TAGS := optional @@ -58,7 +57,6 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM) -LOCAL_MODULE_OWNER := qcom LOCAL_PROPRIETARY_MODULE := true LOCAL_MODULE_TAGS := optional diff --git a/gps/utils/Android.mk b/gps/utils/Android.mk index 9d90cbe..4ea6808 100644 --- a/gps/utils/Android.mk +++ b/gps/utils/Android.mk @@ -56,7 +56,6 @@ LOCAL_COPY_HEADERS:= \ loc_misc_utils.h LOCAL_MODULE := libgps.utils -LOCAL_MODULE_OWNER := qcom LOCAL_PROPRIETARY_MODULE := true LOCAL_MODULE_TAGS := optional From 9f30bd7912fe251e98262c55af85f7984373f851 Mon Sep 17 00:00:00 2001 From: Aurimas Liutikas Date: Wed, 24 Feb 2016 17:40:49 -0800 Subject: [PATCH 02/10] msm8974-common: gps: Suppress unused-parameter warnings Bug: 26936282 Change-Id: I7fdf58d232a59c0ba0d5f52c0f958f6eab0c4514 --- gps/core/Android.mk | 3 ++- gps/loc_api/libloc_api_50001/Android.mk | 6 ++++-- gps/utils/Android.mk | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gps/core/Android.mk b/gps/core/Android.mk index 0bccba2..41883e8 100644 --- a/gps/core/Android.mk +++ b/gps/core/Android.mk @@ -23,7 +23,8 @@ LOCAL_SRC_FILES += \ LOCAL_CFLAGS += \ -fno-short-enums \ - -D_ANDROID_ + -D_ANDROID_ \ + -Wno-unused-parameter LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ diff --git a/gps/loc_api/libloc_api_50001/Android.mk b/gps/loc_api/libloc_api_50001/Android.mk index e44b5e6..69252f3 100644 --- a/gps/loc_api/libloc_api_50001/Android.mk +++ b/gps/loc_api/libloc_api_50001/Android.mk @@ -33,7 +33,8 @@ LOCAL_SRC_FILES += \ LOCAL_CFLAGS += \ -fno-short-enums \ - -D_ANDROID_ + -D_ANDROID_ \ + -Wno-unused-parameter LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ @@ -77,7 +78,8 @@ LOCAL_SRC_FILES += \ LOCAL_CFLAGS += \ -fno-short-enums \ - -D_ANDROID_ \ + -D_ANDROID_ \ + -Wno-unused-parameter ## Includes LOCAL_C_INCLUDES:= \ diff --git a/gps/utils/Android.mk b/gps/utils/Android.mk index 4ea6808..a77e26e 100644 --- a/gps/utils/Android.mk +++ b/gps/utils/Android.mk @@ -24,7 +24,8 @@ LOCAL_SRC_FILES += \ # Flag -std=c++11 is not accepted by compiler when LOCAL_CLANG is set to true LOCAL_CFLAGS += \ -fno-short-enums \ - -D_ANDROID_ + -D_ANDROID_ \ + -Wno-unused-parameter ifeq ($(TARGET_BUILD_VARIANT),user) LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER From 8483bcb6c9c1552b1aa8e902b813e0b95ea97978 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 22 Apr 2016 14:19:33 -0700 Subject: [PATCH 03/10] msm8974-common: gps: Default apn ip type to ipv4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a apn ip type is not found for a agps data connection, default to using ipv4 instead of invalid. CRs-fixed: 1007417 Bug: 28986221 Change-Id: Icc71de1fab3fd5967901c39a5c11eaea17b7766c Signed-off-by: D. Andrei Măceș --- gps/loc_api/libloc_api_50001/loc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gps/loc_api/libloc_api_50001/loc.cpp b/gps/loc_api/libloc_api_50001/loc.cpp index 67e6efe..4b33b3a 100644 --- a/gps/loc_api/libloc_api_50001/loc.cpp +++ b/gps/loc_api/libloc_api_50001/loc.cpp @@ -736,7 +736,7 @@ static int loc_agps_open_with_apniptype(const char* apn, ApnIpType apnIpType) bearerType = AGPS_APN_BEARER_IPV4V6; break; default: - bearerType = AGPS_APN_BEARER_INVALID; + bearerType = AGPS_APN_BEARER_IPV4; break; } From 9af0ec4c514b17b5372097f7ee7ddabb2de5979c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 6 Jul 2016 14:03:12 -0700 Subject: [PATCH 04/10] msm8974-common: gps: Return the correct length of nmea sentence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return the correct length of nmea sentence in the function loc_eng_nmea_put_checksum(). The correct length is length of NMEA string including ‘$’ character alongwith length of checksum. CRs-Fixed: 1020044 Change-Id: I50d80b9c4492de4664bb3ccb7295b0eb4fee15a9 --- gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp index c29ab91..f53655f 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -96,8 +96,12 @@ int loc_eng_nmea_put_checksum(char *pNmea, int maxSize) length++; } + // length now contains nmea sentence string length not including $ sign. int checksumLength = snprintf(pNmea,(maxSize-length-1),"*%02X\r\n", checksum); - return (length + checksumLength); + + // total length of nmea sentence is length of nmea sentence inc $ sign plus + // length of checksum (+1 is to cover the $ character in the length). + return (length + checksumLength + 1); } /*=========================================================================== From 1647e1d1200f35c0984bfacd74b1cfcacea9f2e3 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 7 Jul 2016 17:16:55 -0700 Subject: [PATCH 05/10] msm8974-common: gps: Remove nmea log Nmea log print is removed, as it can be excessive during gps tracking. Bugs: 29499503 29272976 Change-Id: Ia60295207b6bbbcb24bbede4f1802c0c7a2f2544 --- gps/loc_api/libloc_api_50001/loc_eng.cpp | 1 - gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/gps/loc_api/libloc_api_50001/loc_eng.cpp b/gps/loc_api/libloc_api_50001/loc_eng.cpp index c18e02b..6936ea3 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng.cpp @@ -904,7 +904,6 @@ void LocEngReportNmea::proc() const { struct timeval tv; gettimeofday(&tv, (struct timezone *) NULL); int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - CALLBACK_LOG_CALLFLOW("nmea_cb", %d, mLen); if (locEng->nmea_cb != NULL) locEng->nmea_cb(now, mNmea, mLen); diff --git a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp index f53655f..82fb067 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -59,7 +59,6 @@ void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_dat struct timeval tv; gettimeofday(&tv, (struct timezone *) NULL); int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - CALLBACK_LOG_CALLFLOW("nmea_cb", %p, pNmea); if (loc_eng_data_p->nmea_cb != NULL) loc_eng_data_p->nmea_cb(now, pNmea, length); From 2d0c543adb5d689fca126023b35e53659a4c3ac5 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 6 Sep 2017 12:10:07 +0900 Subject: [PATCH 06/10] msm8974-common: gps: Don't rely on transitively included headers One must explicitly include what it need. time.h for struct tm. Bug: 37629934 Test: build Merged-In: Iacd5317d958f61df062fca40fbf2e8992c7fbb44 Change-Id: I19e1043f23dbe85836b73714a4f1440159ebe419 --- gps/utils/loc_log.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gps/utils/loc_log.cpp b/gps/utils/loc_log.cpp index 76f0c53..6601d0d 100644 --- a/gps/utils/loc_log.cpp +++ b/gps/utils/loc_log.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include "loc_log.h" #include "msg_q.h" #ifdef USE_GLIB From 98f5543b46bbaf760f5de48f9e7318b830579e1a Mon Sep 17 00:00:00 2001 From: Vijay Venkatraman Date: Thu, 16 Feb 2017 15:35:58 -0800 Subject: [PATCH 07/10] msm8974-common: gps: Replacing copy headers with header libraries Bug: 33241851 Test: Build target and pass CTS location tests Change-Id: I75db5e6de3c4194a6a46e0d37fcd899ea1d1db04 --- gps/core/Android.mk | 18 ++++++------------ gps/loc_api/libloc_api_50001/Android.mk | 18 ++++++++---------- gps/utils/Android.mk | 24 +++++------------------- 3 files changed, 19 insertions(+), 41 deletions(-) diff --git a/gps/core/Android.mk b/gps/core/Android.mk index 41883e8..83695b0 100644 --- a/gps/core/Android.mk +++ b/gps/core/Android.mk @@ -30,17 +30,11 @@ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libflp -LOCAL_COPY_HEADERS_TO:= libloc_core/ -LOCAL_COPY_HEADERS:= \ - LocApiBase.h \ - LocAdapterBase.h \ - ContextBase.h \ - LocDualContext.h \ - LBSProxyBase.h \ - UlpProxyBase.h \ - gps_extended_c.h \ - gps_extended.h \ - loc_core_log.h \ - LocAdapterProxyBase.h +LOCAL_HEADER_LIBRARIES := libgps.utils_headers include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE := libloc_core_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) +include $(BUILD_HEADER_LIBRARY) diff --git a/gps/loc_api/libloc_api_50001/Android.mk b/gps/loc_api/libloc_api_50001/Android.mk index 69252f3..81c25e5 100644 --- a/gps/loc_api/libloc_api_50001/Android.mk +++ b/gps/loc_api/libloc_api_50001/Android.mk @@ -42,19 +42,15 @@ LOCAL_C_INCLUDES:= \ $(LOCAL_PATH) \ $(TARGET_OUT_HEADERS)/libflp -LOCAL_COPY_HEADERS_TO:= libloc_eng/ -LOCAL_COPY_HEADERS:= \ - LocEngAdapter.h \ - loc.h \ - loc_eng.h \ - loc_eng_xtra.h \ - loc_eng_ni.h \ - loc_eng_agps.h \ - loc_eng_msg.h \ - loc_eng_log.h +LOCAL_HEADER_LIBRARIES := libgps.utils_headers libloc_core_headers include $(BUILD_SHARED_LIBRARY) +include $(CLEAR_VARS) +LOCAL_MODULE := libloc_eng_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) +include $(BUILD_HEADER_LIBRARY) + include $(CLEAR_VARS) LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM) @@ -89,4 +85,6 @@ LOCAL_C_INCLUDES:= \ LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_HEADER_LIBRARIES := libgps.utils_headers libloc_core_headers + include $(BUILD_SHARED_LIBRARY) diff --git a/gps/utils/Android.mk b/gps/utils/Android.mk index a77e26e..55efbf3 100644 --- a/gps/utils/Android.mk +++ b/gps/utils/Android.mk @@ -37,28 +37,14 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic LOCAL_C_INCLUDES:= \ $(LOCAL_PATH)/platform_lib_abstractions -LOCAL_COPY_HEADERS_TO:= gps.utils/ -LOCAL_COPY_HEADERS:= \ - loc_log.h \ - loc_cfg.h \ - log_util.h \ - linked_list.h \ - msg_q.h \ - MsgTask.h \ - LocHeap.h \ - LocThread.h \ - LocTimer.h \ - loc_target.h \ - loc_timer.h \ - LocSharedLock.h \ - platform_lib_abstractions/platform_lib_includes.h \ - platform_lib_abstractions/platform_lib_time.h \ - platform_lib_abstractions/platform_lib_macros.h \ - loc_misc_utils.h - LOCAL_MODULE := libgps.utils LOCAL_PROPRIETARY_MODULE := true LOCAL_MODULE_TAGS := optional include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE := libgps.utils_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) $(LOCAL_PATH)/platform_lib_abstractions +include $(BUILD_HEADER_LIBRARY) From b3094b1fb9c1dde46ad6069aa331b85a6a9f1319 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Sun, 7 May 2017 11:22:28 -0700 Subject: [PATCH 08/10] msm8974-common: gps: Fix for buffer overrun crash at copying nmea string Add zero clearing of allocated nmea buffer to ensure the nmea string is null terminated. Change-Id: Ie36010a7d3eca16dabb3067ae891a94e4b63b10c CRs-Fixed: 2041933 --- gps/loc_api/libloc_api_50001/loc_eng.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gps/loc_api/libloc_api_50001/loc_eng.cpp b/gps/loc_api/libloc_api_50001/loc_eng.cpp index 6936ea3..e70ae23 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng.cpp @@ -893,9 +893,9 @@ inline void LocEngReportStatus::log() const { // case LOC_ENG_MSG_REPORT_NMEA: LocEngReportNmea::LocEngReportNmea(void* locEng, const char* data, int len) : - LocMsg(), mLocEng(locEng), mNmea(new char[len]), mLen(len) + LocMsg(), mLocEng(locEng), mNmea(new char[len+1]), mLen(len) { - memcpy((void*)mNmea, (void*)data, len); + strlcpy(mNmea, data, len+1); locallog(); } void LocEngReportNmea::proc() const { From 8e016489cea91549d4d7966135e624db7e92bfd6 Mon Sep 17 00:00:00 2001 From: "Kevin F. Haggerty" Date: Sat, 27 Jun 2020 16:43:22 -0600 Subject: [PATCH 09/10] msm8974-common: Switch to GNSS HIDL HAL Change-Id: I881206bed97e700d0022080ec5785fa3756c39bd --- manifest.xml | 2 +- msm8974.mk | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest.xml b/manifest.xml index 4da5205..9a1ec0e 100644 --- a/manifest.xml +++ b/manifest.xml @@ -70,7 +70,7 @@ android.hardware.gnss - passthrough + hwbinder 1.0 IGnss diff --git a/msm8974.mk b/msm8974.mk index 7098c00..58738c5 100644 --- a/msm8974.mk +++ b/msm8974.mk @@ -95,6 +95,7 @@ PRODUCT_PACKAGES += \ # GPS PRODUCT_PACKAGES += \ android.hardware.gnss@1.0-impl \ + android.hardware.gnss@1.0-service \ gps.msm8974 PRODUCT_COPY_FILES += \ From d7a9d16a0f0b71cb8628251a8a3b7294e4b0b423 Mon Sep 17 00:00:00 2001 From: Arne Coucheron Date: Mon, 18 May 2020 06:29:20 +0200 Subject: [PATCH 10/10] msm8974-common: Build common legacy gnss hal Change-Id: I56095b9c3bba065779c90b6aeb61ebfed6af7e77 --- msm8974.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msm8974.mk b/msm8974.mk index 58738c5..ff8a544 100644 --- a/msm8974.mk +++ b/msm8974.mk @@ -94,8 +94,8 @@ PRODUCT_PACKAGES += \ # GPS PRODUCT_PACKAGES += \ - android.hardware.gnss@1.0-impl \ - android.hardware.gnss@1.0-service \ + android.hardware.gnss@1.0-impl.legacy \ + android.hardware.gnss@1.0-service.legacy \ gps.msm8974 PRODUCT_COPY_FILES += \