Handling network types not available in IAgnssRil enums

Handling network types not available in IAgnssRil enums like
Bluetooth, Ethernet, Proxy etc. Pass these network type info
to framework, rather than sending the default TYPE_UNKNOWN.

Change-Id: I7e997b82b07ca68d928bef322182031a2d47e532
CRs-Fixed: 2325210
This commit is contained in:
Harikrishnan Hariharan 2018-09-29 12:50:33 +05:30 committed by Gerrit - the friendly Code Review server
parent bafbd51852
commit 2f80dcc30c
3 changed files with 45 additions and 2 deletions

View file

@ -50,6 +50,10 @@ AGnssRil::~AGnssRil() {
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
ENTRY_LOG_CALLFLOW();
// Extra NetworkTypes not available in IAgnssRil enums
const int NetworkType_BLUETOOTH = 7;
const int NetworkType_ETHERNET = 9;
const int NetworkType_PROXY = 16;
// for XTRA
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
@ -77,8 +81,25 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
case IAGnssRil::NetworkType::WIMAX:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
break;
default:
{
int networkType = (int) type;
// Handling network types not available in IAgnssRil
switch(networkType)
{
case NetworkType_BLUETOOTH:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH;
break;
case NetworkType_ETHERNET:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET;
break;
case NetworkType_PROXY:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY;
break;
default:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
}
}
break;
}
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout);

View file

@ -50,6 +50,10 @@ AGnssRil::~AGnssRil() {
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
ENTRY_LOG_CALLFLOW();
// Extra NetworkTypes not available in IAgnssRil enums
const int NetworkType_BLUETOOTH = 7;
const int NetworkType_ETHERNET = 9;
const int NetworkType_PROXY = 16;
// for XTRA
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
@ -77,8 +81,25 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
case IAGnssRil::NetworkType::WIMAX:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
break;
default:
{
int networkType = (int) type;
// Handling network types not available in IAgnssRil
switch(networkType)
{
case NetworkType_BLUETOOTH:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH;
break;
case NetworkType_ETHERNET:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET;
break;
case NetworkType_PROXY:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY;
break;
default:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
}
}
break;
}
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout);

View file

@ -231,6 +231,7 @@ public:
TYPE_DUN,
TYPE_HIPRI,
TYPE_WIMAX,
TYPE_PROXY,
TYPE_UNKNOWN,
};
NetworkInfoDataItemBase(