msm8974-common: 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. 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:
parent
4dd7fbc1e4
commit
f066fa2e3a
@ -30,7 +30,9 @@
|
||||
#define ULP_PROXY_BASE_H
|
||||
|
||||
#include <gps_extended.h>
|
||||
#include "fused_location_extended.h"
|
||||
|
||||
struct FlpExtLocation_s;
|
||||
struct FlpExtBatchOptions;
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
@ -73,7 +75,7 @@ public:
|
||||
bool active) {
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportPositions(const FlpExtLocation* locations,
|
||||
inline virtual bool reportPositions(const struct FlpExtLocation_s* locations,
|
||||
int32_t number_of_locations) {
|
||||
return false;
|
||||
}
|
||||
|
@ -194,9 +194,11 @@ void LocEngAdapter::setXtraUserAgent() {
|
||||
fclose(file);
|
||||
|
||||
// remove trailing spaces
|
||||
size_t len = strlen(buf);
|
||||
while (--len >= 0 && isspace(buf[len])) {
|
||||
buf[len] = '\0';
|
||||
char *s;
|
||||
s = buf + strlen(buf);
|
||||
while (--s >= buf) {
|
||||
if (!isspace(*s)) break;
|
||||
*s = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user