* 'lineage-16.0' of http://www.github.com/LineageOS/android_device_samsung_msm8974-common:
  msm8974-common: Build common legacy gnss hal
  msm8974-common: Switch to GNSS HIDL HAL
  msm8974-common: gps: Fix for buffer overrun crash at copying nmea string
  msm8974-common: gps: Replacing copy headers with header libraries
  msm8974-common: gps: Don't rely on transitively included headers
  msm8974-common: gps: Remove nmea log
  msm8974-common: gps: Return the correct length of nmea sentence
  msm8974-common: gps: Default apn ip type to ipv4
  msm8974-common: gps: Suppress unused-parameter warnings
  msm8974-common: gps: Remove owner of gps hal modules

Change-Id: I910806396d54c33727ef3b807404d71786aa74e6
This commit is contained in:
Kevin F. Haggerty 2020-06-28 08:57:55 -06:00
commit c85904857b
No known key found for this signature in database
GPG Key ID: 6D95512933112729
7 changed files with 34 additions and 53 deletions

View File

@ -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
@ -24,23 +23,18 @@ LOCAL_SRC_FILES += \
LOCAL_CFLAGS += \
-fno-short-enums \
-D_ANDROID_
-D_ANDROID_ \
-Wno-unused-parameter
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)

View File

@ -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
@ -35,7 +34,8 @@ LOCAL_SRC_FILES += \
LOCAL_CFLAGS += \
-fno-short-enums \
-D_ANDROID_
-D_ANDROID_ \
-Wno-unused-parameter
LOCAL_C_INCLUDES:= \
$(TARGET_OUT_HEADERS)/gps.utils \
@ -43,23 +43,18 @@ 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)
LOCAL_MODULE_OWNER := qcom
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_TAGS := optional
@ -82,6 +77,7 @@ LOCAL_SRC_FILES += \
LOCAL_CFLAGS += \
-fno-short-enums \
-D_ANDROID_ \
-Wno-unused-parameter
## Includes
LOCAL_C_INCLUDES:= \
@ -91,4 +87,6 @@ LOCAL_C_INCLUDES:= \
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_HEADER_LIBRARIES := libgps.utils_headers libloc_core_headers
include $(BUILD_SHARED_LIBRARY)

View File

@ -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;
}

View File

@ -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);

View File

@ -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);
@ -96,8 +95,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);
}
/*===========================================================================

View File

@ -25,7 +25,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
@ -37,29 +38,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_MODULE_OWNER := qcom
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)

View File

@ -32,6 +32,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include "loc_log.h"
#include "msg_q.h"
#ifdef USE_GLIB