summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDante Russo <drusso@codeaurora.org>2014-08-14 17:21:27 -0700
committerVineeta Srivastava <vsrivastava@google.com>2014-08-20 00:19:02 -0700
commit9aba726254999bab914b3eba81f65537c5bf5354 (patch)
tree94d28d5390626a92772627b5acdfbf19cfd24307
parent74b189873062ef9f7a542c11ce0e0b1017e05fc7 (diff)
downloadgps-9aba726254999bab914b3eba81f65537c5bf5354.tar.gz
correct AGpsStatus size in call to reportAgpsStatus
afw loc client expects the size of AGpsStatus in it's logic. Also memset 0 the ipv6 address in agps_status_report bug: 16961654 Change-Id: I4ac746bc30c68cfabf93fd2422541b71d6b0ecda
-rw-r--r--loc_api/libloc_api_50001/loc.cpp20
-rw-r--r--loc_api/libloc_api_50001/loc_eng_agps.cpp1
-rw-r--r--loc_api/libloc_api_50001/loc_eng_agps.h3
3 files changed, 23 insertions, 1 deletions
diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp
index 16c2ed4..14403ae 100644
--- a/loc_api/libloc_api_50001/loc.cpp
+++ b/loc_api/libloc_api_50001/loc.cpp
@@ -50,9 +50,11 @@ using namespace loc_core;
//Globals defns
static gps_location_callback gps_loc_cb = NULL;
static gps_sv_status_callback gps_sv_cb = NULL;
+static agps_status_callback agps_status_cb = NULL;
static void local_loc_cb(UlpLocation* location, void* locExt);
static void local_sv_cb(GpsSvStatus* sv_status, void* svExt);
+static void loc_agps_status_cb(AGpsStatus* status);
static const GpsGeofencingInterface* get_geofence_interface(void);
@@ -733,6 +735,10 @@ SIDE EFFECTS
static void loc_agps_init(AGpsCallbacks* callbacks)
{
ENTRY_LOG();
+ if (agps_status_cb == NULL) {
+ agps_status_cb = callbacks->status_cb;
+ callbacks->status_cb = loc_agps_status_cb;
+ }
loc_eng_agps_init(loc_afw_data, (AGpsExtCallbacks*)callbacks);
EXIT_LOG(%s, VOID_RET);
}
@@ -1070,3 +1076,17 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt)
}
EXIT_LOG(%s, VOID_RET);
}
+
+static void loc_agps_status_cb(AGpsStatus* status)
+{
+ ENTRY_LOG();
+
+ if (NULL != agps_status_cb) {
+ size_t realSize = sizeof(AGpsStatus);
+ LOC_LOGD("agps_status size=%d real-size=%d", status->size, realSize);
+ status->size = realSize;
+ agps_status_cb(status);
+ }
+ EXIT_LOG(%s, VOID_RET);
+}
+
diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp
index 5016b5c..d90d5d3 100644
--- a/loc_api/libloc_api_50001/loc_eng_agps.cpp
+++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp
@@ -763,6 +763,7 @@ int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const
if (s == NULL) {
nifRequest.ipv4_addr = INADDR_NONE;
memset(&nifRequest.addr, 0, sizeof(nifRequest.addr));
+ nifRequest.addr.ss_family = AF_INET6;
nifRequest.ssid[0] = '\0';
nifRequest.password[0] = '\0';
} else {
diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h
index 2d689ce..d558644 100644
--- a/loc_api/libloc_api_50001/loc_eng_agps.h
+++ b/loc_api/libloc_api_50001/loc_eng_agps.h
@@ -345,7 +345,8 @@ struct ATLSubscriber : public Subscriber {
{ v4 = INADDR_NONE; v6[0] = 0; }
inline virtual void setIPAddresses(struct sockaddr_storage& addr)
- { addr.ss_family = AF_INET6; }
+ { memset(&addr, 0, sizeof(addr));
+ addr.ss_family = AF_INET6; }
inline virtual Subscriber* clone()
{