loc-api: Making off-target garden-app build and run again
After removing libcutils dependency, the off-target garden-app was not building. This change enables it to build and run again Change-Id: Ifb0473f5d05c156f761c72e29f6592b443ee9cb3
This commit is contained in:
parent
5c8ebe8979
commit
78767a18f6
5 changed files with 72 additions and 36 deletions
26
loc_api/fake_sched_policy.c
Normal file
26
loc_api/fake_sched_policy.c
Normal file
|
@ -0,0 +1,26 @@
|
|||
/* Copyright (c) 2011, Qualcomm Technologies, Inc. All Rights Reserved.
|
||||
* Qualcomm Technologies Proprietary and Confidential.
|
||||
*/
|
||||
|
||||
#include "fake_sched_policy.h"
|
||||
|
||||
/*===========================================================================
|
||||
FUNCTION set_sched_policy
|
||||
|
||||
DESCRIPTION
|
||||
Local copy of this function which bypasses android set_sched_policy
|
||||
|
||||
DEPENDENCIES
|
||||
None
|
||||
|
||||
RETURN VALUE
|
||||
0
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
int set_sched_policy(int tid, SchedPolicy policy)
|
||||
{
|
||||
return 0;
|
||||
}
|
40
loc_api/fake_sched_policy.h
Normal file
40
loc_api/fake_sched_policy.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/* Copyright (c) 2013, Qualcomm Technologies, Inc. All Rights Reserved.
|
||||
* Qualcomm Technologies Proprietary and Confidential.
|
||||
*/
|
||||
|
||||
#ifndef _FAKE_SCHED_POLICY_H
|
||||
#define _FAKE_SCHED_POLICY_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
SP_BACKGROUND = 0,
|
||||
SP_FOREGROUND = 1,
|
||||
} SchedPolicy;
|
||||
|
||||
/*===========================================================================
|
||||
FUNCTION set_sched_policy
|
||||
|
||||
DESCRIPTION
|
||||
Local copy of this function which bypasses android set_sched_policy
|
||||
|
||||
DEPENDENCIES
|
||||
None
|
||||
|
||||
RETURN VALUE
|
||||
0
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
int set_sched_policy(int tid, SchedPolicy policy);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _FAKE_SCHED_POLICY_H
|
||||
|
|
@ -5,7 +5,7 @@ AM_CFLAGS = \
|
|||
-fno-short-enums \
|
||||
-DFEATURE_GNSS_BIT_API
|
||||
|
||||
libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp ../fake_property_service.c
|
||||
libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp ../fake_property_service.c ../fake_sched_policy.c
|
||||
|
||||
if USE_GLIB
|
||||
libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <hardware/gps.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
extern const GpsInterface* get_gps_interface();
|
||||
|
||||
|
|
|
@ -49,6 +49,10 @@
|
|||
|
||||
#ifdef _ANDROID
|
||||
#include <cutils/sched_policy.h>
|
||||
#include <cutils/properties.h>
|
||||
#else
|
||||
#include "fake_sched_policy.h"
|
||||
#include "fake_property_service.h"
|
||||
#endif
|
||||
|
||||
#ifndef USE_GLIB
|
||||
|
@ -56,12 +60,6 @@
|
|||
#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>
|
||||
|
@ -83,12 +81,6 @@ typedef enum {
|
|||
#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
|
||||
|
||||
|
@ -2555,29 +2547,6 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data)
|
|||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
||||
#ifdef USE_GLIB
|
||||
/*===========================================================================
|
||||
FUNCTION set_sched_policy
|
||||
|
||||
DESCRIPTION
|
||||
Local copy of this function which bypasses android set_sched_policy
|
||||
|
||||
DEPENDENCIES
|
||||
None
|
||||
|
||||
RETURN VALUE
|
||||
0
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int set_sched_policy(int tid, SchedPolicy policy)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
/*===========================================================================
|
||||
FUNCTION loc_eng_read_config
|
||||
|
||||
|
|
Loading…
Reference in a new issue