gps: Remove dependency on libcutils.so
Change-Id: Id3d6e2c81eb6d5ee549236c591cc75ac32aa948b
This commit is contained in:
parent
b83679bfc9
commit
fba6dcd31f
7 changed files with 68 additions and 8 deletions
16
loc_api/fake_property_service.c
Normal file
16
loc_api/fake_property_service.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
/* Copyright (c) 2011,2012 Qualcomm Technologies, Inc. All Rights Reserved.
|
||||
* Qualcomm Technologies Proprietary and Confidential.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
int property_get(const char *key, char * value, const char *default_value)
|
||||
{
|
||||
/* This will disable gps interface
|
||||
value[0] = '1';
|
||||
*/
|
||||
if (strcmp(key, "ro.baseband") == 0) {
|
||||
memcpy(value, "msm", 4);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
19
loc_api/fake_property_service.h
Normal file
19
loc_api/fake_property_service.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
/* Copyright (c) 2013, Qualcomm Technologies, Inc. All Rights Reserved.
|
||||
* Qualcomm Technologies Proprietary and Confidential.
|
||||
*/
|
||||
#ifndef _FAKE_PROPERTY_SERVICE_H_
|
||||
#define _FAKE_PROPERTY_SERVICE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define PROPERTY_VALUE_MAX 92
|
||||
int property_get(const char *key, char *value, const char *default_value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
|
@ -1,10 +1,11 @@
|
|||
AM_CFLAGS = \
|
||||
-I../../utils \
|
||||
-I../../platform_lib_abstractions \
|
||||
-I../ \
|
||||
-fno-short-enums \
|
||||
-DFEATURE_GNSS_BIT_API
|
||||
|
||||
libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp
|
||||
libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp ../fake_property_service.c
|
||||
|
||||
if USE_GLIB
|
||||
libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
|
@ -15,7 +16,7 @@ libloc_adapter_so_la_CFLAGS = $(AM_CFLAGS)
|
|||
libloc_adapter_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_adapter_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
libloc_adapter_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la
|
||||
libloc_adapter_so_la_LIBADD = -lstdc++ ../../utils/libgps_utils_so.la
|
||||
|
||||
|
||||
libloc_eng_so_la_SOURCES = \
|
||||
|
@ -28,7 +29,8 @@ libloc_eng_so_la_SOURCES = \
|
|||
loc_eng_dmn_conn_handler.cpp \
|
||||
loc_eng_dmn_conn_thread_helper.c \
|
||||
loc_eng_dmn_conn_glue_msg.c \
|
||||
loc_eng_dmn_conn_glue_pipe.c
|
||||
loc_eng_dmn_conn_glue_pipe.c \
|
||||
../fake_property_service.c
|
||||
|
||||
|
||||
if USE_GLIB
|
||||
|
@ -41,12 +43,13 @@ libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
|||
libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libloc_eng_so_la_LIBADD = -lstdc++ -lcutils -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la
|
||||
libloc_eng_so_la_LIBADD = -lstdc++ -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la
|
||||
|
||||
|
||||
libgps_default_so_la_SOURCES = \
|
||||
loc.cpp \
|
||||
gps.c
|
||||
gps.c \
|
||||
../fake_property_service.c
|
||||
|
||||
if USE_GLIB
|
||||
libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
|
@ -58,7 +61,7 @@ libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
|||
libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la
|
||||
libgps_default_so_la_LIBADD = -lstdc++ ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la
|
||||
|
||||
library_include_HEADERS = \
|
||||
LocEngAdapter.h \
|
||||
|
@ -69,6 +72,7 @@ library_include_HEADERS = \
|
|||
loc_eng_agps.h \
|
||||
loc_eng_msg.h \
|
||||
loc_eng_log.h
|
||||
../fake_property_service.h
|
||||
|
||||
library_includedir = $(pkgincludedir)/libloc_api_50001
|
||||
|
||||
|
|
|
@ -43,7 +43,12 @@
|
|||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <LocDualContext.h>
|
||||
#ifdef _ANDROID
|
||||
#include <cutils/properties.h>
|
||||
#else
|
||||
#include "fake_property_service.h"
|
||||
#endif
|
||||
#include <hardware/gps.h>
|
||||
|
||||
using namespace loc_core;
|
||||
|
||||
|
@ -165,6 +170,7 @@ const GpsInterface* gps_get_hardware_interface ()
|
|||
const GpsInterface* ret_val;
|
||||
|
||||
char propBuf[PROPERTY_VALUE_MAX];
|
||||
memset(propBuf, 0, sizeof(propBuf));
|
||||
|
||||
loc_eng_read_config();
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ extern "C" {
|
|||
#endif /* __cplusplus */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <cutils/properties.h>
|
||||
#include <hardware/gps.h>
|
||||
#include <gps_extended.h>
|
||||
|
||||
|
|
|
@ -47,12 +47,22 @@
|
|||
|
||||
#include <LocEngAdapter.h>
|
||||
|
||||
#ifdef _ANDROID
|
||||
#include <cutils/sched_policy.h>
|
||||
#endif
|
||||
|
||||
#ifndef USE_GLIB
|
||||
#include <utils/SystemClock.h>
|
||||
#include <utils/Log.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
#ifndef _ANDROID
|
||||
typedef enum {
|
||||
SP_BACKGROUND = 0,
|
||||
SP_FOREGROUND = 1,
|
||||
} SchedPolicy;
|
||||
#endif
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <glib.h>
|
||||
#include <sys/syscall.h>
|
||||
|
@ -73,6 +83,12 @@
|
|||
#include "loc_core_log.h"
|
||||
#include "loc_eng_log.h"
|
||||
|
||||
#ifdef _ANDROID
|
||||
#include <cutils/properties.h>
|
||||
#else
|
||||
#include "fake_property_service.h"
|
||||
#endif
|
||||
|
||||
#define SUCCESS TRUE
|
||||
#define FAILURE FALSE
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ libgps_utils_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
|||
libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libgps_utils_so_la_LIBADD = -lstdc++ -lcutils
|
||||
libgps_utils_so_la_LIBADD = -lstdc++
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libgps_utils_so.la
|
||||
|
|
Loading…
Reference in a new issue