Merge "Enable logcat logging for location modules in LE"

This commit is contained in:
Linux Build Service Account 2017-10-28 20:16:36 -07:00 committed by Gerrit - the friendly Code Review server
commit 30b93f6bfc
6 changed files with 23 additions and 16 deletions

View file

@ -1,5 +1,6 @@
AM_CFLAGS = -Wundef \
-I./ \
-I$(WORKSPACE)/system/core/include \
-std=c++11 \
$(LOCPLA_CFLAGS)
@ -24,7 +25,8 @@ libgps_utils_so_la_h_sources = \
loc_nmea.h \
gps_extended_c.h \
gps_extended.h \
loc_gps.h
loc_gps.h \
log_util.h
libgps_utils_so_la_c_sources = \
linked_list.c \

View file

@ -30,12 +30,12 @@
#ifndef __LOG_UTIL_H__
#define __LOG_UTIL_H__
#ifndef USE_GLIB
#if defined (USE_ANDROID_LOGGING) || defined (ANDROID)
// Android and LE targets with logcat support
#include <utils/Log.h>
#endif /* USE_GLIB */
#ifdef USE_GLIB
#elif defined (USE_GLIB)
// LE targets with no logcat support
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
@ -45,7 +45,7 @@
#endif // LOG_TAG
#endif /* USE_GLIB */
#endif /* #if defined (USE_ANDROID_LOGGING) || defined (ANDROID) */
#ifdef __cplusplus
extern "C"

View file

@ -30,11 +30,6 @@
#define __PLATFORM_LIB_LOG_UTIL_H__
#include "platform_lib_macros.h"
#ifndef USE_GLIB
#include <log_util.h>
#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -46,6 +41,11 @@
#define LOG_TAG "GPS_UTILS"
#endif /* LOG_TAG */
#if defined (USE_ANDROID_LOGGING) || defined (ANDROID)
// Android and LE targets with logcat support
#include <log_util.h>
#else
// LE targets without logcat support
#ifdef __cplusplus
extern "C"
{
@ -169,6 +169,6 @@ char* get_timestamp(char* str, unsigned long buf_size);
}
#endif
#endif /* USE_GLIB */
#endif /* else of #if defined (USE_ANDROID_LOGGING) || defined (ANDROID) */
#endif /* __PLATFORM_LIB_LOG_UTIL_H__ */

View file

@ -33,19 +33,23 @@
extern "C" {
#endif
#ifdef USE_GLIB
#include <sys/time.h>
#include <string.h>
#include <stdlib.h>
#ifndef OFF_TARGET
#ifdef USE_GLIB
#include <glib.h>
#ifndef OFF_TARGET
#define strlcat g_strlcat
#define strlcpy g_strlcpy
#else
#define strlcat strncat
#define strlcpy strncpy
#endif
#endif /* USE_GLIB */
#if defined (USE_GLIB) && !defined (USE_ANDROID_LOGGING)
// LE targets with no logcat support
#define TS_PRINTF(format, x...) \
{ \
struct timeval tv; \
@ -64,7 +68,7 @@ extern "C" {
#define ALOGD(format, x...) TS_PRINTF("D/%s (%d): " format , LOG_TAG, getpid(), ##x)
#define ALOGV(format, x...) TS_PRINTF("V/%s (%d): " format , LOG_TAG, getpid(), ##x)
#endif /* USE_GLIB */
#endif /* #if defined (USE_GLIB) && !defined (USE_ANDROID_LOGGING) */
// Below are the location conf file paths

View file

@ -7,4 +7,4 @@ Name: loc-pla
Description: QTI GPS Location Platform Library Abstractions
Version: @VERSION@
Libs: -L${libdir} -lloc_pla
Cflags: -I${includedir}/loc-pla
Cflags: -I${includedir}/loc-pla -I${includedir}/gps-utils

View file

@ -1,5 +1,6 @@
AM_CFLAGS = \
$(LOCSTUB_CFLAGS) \
-I$(WORKSPACE)/hardware/qcom/gps/utils/ \
-I../include \
-D__func__=__PRETTY_FUNCTION__ \
-fno-short-enums