gps: fix build for OSS builds

gps: Correct forward declaration in proprietary definitions

Fix gps runtime error

The qcom prebuilt binary relies on FlpExtLocation_s,
so we cannot change it to FlpExtLocation.
This patch fixes it.

ether: gps: fix remove trailing space

In setXtraUserAgent,
size_t is unsigned and never being negative.
Will cause segmentation fault, if string is all space.

Change-Id: I1cf1f956943b0739640afe909954ade6921e28a1
This commit is contained in:
Scott Mertz 2015-11-06 17:44:53 -08:00 committed by Zhao Wei Liew
parent 0a93aea65e
commit a20833363b
2 changed files with 9 additions and 5 deletions

View file

@ -30,7 +30,9 @@
#define ULP_PROXY_BASE_H #define ULP_PROXY_BASE_H
#include <gps_extended.h> #include <gps_extended.h>
#include "fused_location_extended.h"
struct FlpExtLocation_s;
struct FlpExtBatchOptions;
namespace loc_core { namespace loc_core {
@ -73,7 +75,7 @@ public:
bool active) { bool active) {
return false; return false;
} }
inline virtual bool reportPositions(const FlpExtLocation* locations, inline virtual bool reportPositions(const struct FlpExtLocation_s* locations,
int32_t number_of_locations) { int32_t number_of_locations) {
return false; return false;
} }

View file

@ -194,9 +194,11 @@ void LocEngAdapter::setXtraUserAgent() {
fclose(file); fclose(file);
// remove trailing spaces // remove trailing spaces
size_t len = strlen(buf); char *s;
while (--len >= 0 && isspace(buf[len])) { s = buf + strlen(buf);
buf[len] = '\0'; while (--s >= buf) {
if (!isspace(*s)) break;
*s = 0;
} }
} }