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:
Pandari Sabhapathi 2013-08-30 16:04:25 -07:00 committed by Dongmei Wang
parent 5c8ebe8979
commit 78767a18f6
5 changed files with 72 additions and 36 deletions

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

View 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

View file

@ -5,7 +5,7 @@ AM_CFLAGS = \
-fno-short-enums \ -fno-short-enums \
-DFEATURE_GNSS_BIT_API -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 if USE_GLIB
libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@

View file

@ -30,6 +30,7 @@
#include <hardware/gps.h> #include <hardware/gps.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
extern const GpsInterface* get_gps_interface(); extern const GpsInterface* get_gps_interface();

View file

@ -49,6 +49,10 @@
#ifdef _ANDROID #ifdef _ANDROID
#include <cutils/sched_policy.h> #include <cutils/sched_policy.h>
#include <cutils/properties.h>
#else
#include "fake_sched_policy.h"
#include "fake_property_service.h"
#endif #endif
#ifndef USE_GLIB #ifndef USE_GLIB
@ -56,12 +60,6 @@
#include <utils/Log.h> #include <utils/Log.h>
#endif /* USE_GLIB */ #endif /* USE_GLIB */
#ifndef _ANDROID
typedef enum {
SP_BACKGROUND = 0,
SP_FOREGROUND = 1,
} SchedPolicy;
#endif
#ifdef USE_GLIB #ifdef USE_GLIB
#include <glib.h> #include <glib.h>
@ -83,12 +81,6 @@ typedef enum {
#include "loc_core_log.h" #include "loc_core_log.h"
#include "loc_eng_log.h" #include "loc_eng_log.h"
#ifdef _ANDROID
#include <cutils/properties.h>
#else
#include "fake_property_service.h"
#endif
#define SUCCESS TRUE #define SUCCESS TRUE
#define FAILURE FALSE #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); 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 FUNCTION loc_eng_read_config