summaryrefslogtreecommitdiff
path: root/gnss
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2019-03-26 18:40:03 -0700
committerKevin Tang <zhikait@codeaurora.org>2019-03-26 18:40:03 -0700
commit546e88fc046234170088cd93bc78567c548ca559 (patch)
tree4f0eff628e1848256cfd7df3b5b0bae7826665bc /gnss
parent01869b4004179870db2160ed41283dce7fbbdcde (diff)
downloadgps-546e88fc046234170088cd93bc78567c548ca559.tar.gz
Add HAL support for network handle
Add HAL support for modifications to the network status information passed in. Change-Id: I99defc6a419d9f21ce74469a1aa016cc7fade4a5 CRs-Fixed: 2397433
Diffstat (limited to 'gnss')
-rw-r--r--gnss/XtraSystemStatusObserver.cpp19
-rw-r--r--gnss/XtraSystemStatusObserver.h7
-rw-r--r--gnss/location_gnss.cpp11
3 files changed, 26 insertions, 11 deletions
diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp
index 962e100..6e1902c 100644
--- a/gnss/XtraSystemStatusObserver.cpp
+++ b/gnss/XtraSystemStatusObserver.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017, 2019, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -69,17 +69,21 @@ bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) {
return ( send(LOC_IPC_XTRA, ss.str()) );
}
-bool XtraSystemStatusObserver::updateConnections(uint64_t allConnections) {
+bool XtraSystemStatusObserver::updateConnections(uint64_t allConnections,
+ uint64_t wifiNetworkHandle, uint64_t mobileNetworkHandle) {
mIsConnectivityStatusKnown = true;
mConnections = allConnections;
+ mWifiNetworkHandle = wifiNetworkHandle;
+ mMobileNetworkHandle = mobileNetworkHandle;
if (!mReqStatusReceived) {
return true;
}
stringstream ss;
- ss << "connection";
- ss << " " << mConnections;
+ ss << "connection" << endl << mConnections << endl << wifiNetworkHandle
+ << endl << mobileNetworkHandle;
+
return ( send(LOC_IPC_XTRA, ss.str()) );
}
@@ -134,6 +138,7 @@ inline bool XtraSystemStatusObserver::onStatusRequested(int32_t xtraStatusUpdate
ss << "respondStatus" << endl;
(mGpsLock == -1 ? ss : ss << mGpsLock) << endl;
(mConnections == (uint64_t)~0 ? ss : ss << mConnections) << endl
+ << mWifiNetworkHandle << endl << mMobileNetworkHandle << endl
<< mTac << endl << mMccmnc << endl << mIsConnectivityStatusKnown;
return ( send(LOC_IPC_XTRA, ss.str()) );
@@ -235,7 +240,11 @@ void XtraSystemStatusObserver::notify(const list<IDataItemCore*>& dlist)
{
NetworkInfoDataItemBase* networkInfo =
static_cast<NetworkInfoDataItemBase*>(each);
- mXtraSysStatObj->updateConnections(networkInfo->getAllTypes());
+ mXtraSysStatObj->updateConnections(networkInfo->getAllTypes(),
+ (NetworkHandle) networkInfo->getNetworkHandle(
+ loc_core::NetworkInfoDataItemBase::TYPE_WIFI),
+ (NetworkHandle) networkInfo->getNetworkHandle(
+ loc_core::NetworkInfoDataItemBase::TYPE_MOBILE));
}
break;
diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h
index cbbeda6..22a3013 100644
--- a/gnss/XtraSystemStatusObserver.h
+++ b/gnss/XtraSystemStatusObserver.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -61,7 +61,8 @@ public :
virtual void notify(const list<IDataItemCore*>& dlist);
bool updateLockStatus(GnssConfigGpsLock lock);
- bool updateConnections(uint64_t allConnections);
+ bool updateConnections(uint64_t allConnections,
+ uint64_t wifiNetworkHandle, uint64_t mobileNetworkHandle);
bool updateTac(const string& tac);
bool updateMccMnc(const string& mccmnc);
bool updateXtraThrottle(const bool enabled);
@@ -76,6 +77,8 @@ private:
const MsgTask* mMsgTask;
GnssConfigGpsLock mGpsLock;
uint64_t mConnections;
+ uint64_t mWifiNetworkHandle;
+ uint64_t mMobileNetworkHandle;
string mTac;
string mMccmnc;
bool mXtraThrottle;
diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp
index 45ad292..f3b15ee 100644
--- a/gnss/location_gnss.cpp
+++ b/gnss/location_gnss.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -65,7 +65,8 @@ static void agpsDataConnOpen(AGpsExtType agpsType, const char* apnName, int apnL
static void agpsDataConnClosed(AGpsExtType agpsType);
static void agpsDataConnFailed(AGpsExtType agpsType);
static void getDebugReport(GnssDebugReport& report);
-static void updateConnectionStatus(bool connected, int8_t type);
+static void updateConnectionStatus(bool connected, int8_t type, bool roaming = false,
+ NetworkHandle networkHandle = NETWORK_HANDLE_UNKNOWN);
static void getGnssEnergyConsumed(GnssEnergyConsumedCallback energyConsumedCb);
static void enableNfwLocationAccess(bool enable);
static void nfwInit(const NfwCbInfo& cbInfo);
@@ -319,9 +320,11 @@ static void getDebugReport(GnssDebugReport& report) {
}
}
-static void updateConnectionStatus(bool connected, int8_t type) {
+static void updateConnectionStatus(bool connected, int8_t type,
+ bool roaming, NetworkHandle networkHandle) {
if (NULL != gGnssAdapter) {
- gGnssAdapter->getSystemStatus()->eventConnectionStatus(connected, type);
+ gGnssAdapter->getSystemStatus()->eventConnectionStatus(
+ connected, type, roaming, networkHandle);
}
}