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:
parent
bafbd51852
commit
2f80dcc30c
3 changed files with 45 additions and 2 deletions
|
@ -50,6 +50,10 @@ AGnssRil::~AGnssRil() {
|
||||||
|
|
||||||
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
|
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
|
||||||
ENTRY_LOG_CALLFLOW();
|
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
|
// for XTRA
|
||||||
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
||||||
|
@ -77,8 +81,25 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
|
||||||
case IAGnssRil::NetworkType::WIMAX:
|
case IAGnssRil::NetworkType::WIMAX:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
|
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
|
||||||
break;
|
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:
|
default:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout);
|
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout);
|
||||||
|
|
|
@ -50,6 +50,10 @@ AGnssRil::~AGnssRil() {
|
||||||
|
|
||||||
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
|
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
|
||||||
ENTRY_LOG_CALLFLOW();
|
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
|
// for XTRA
|
||||||
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
||||||
|
@ -77,8 +81,25 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
|
||||||
case IAGnssRil::NetworkType::WIMAX:
|
case IAGnssRil::NetworkType::WIMAX:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
|
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
|
||||||
break;
|
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:
|
default:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout);
|
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout);
|
||||||
|
|
|
@ -231,6 +231,7 @@ public:
|
||||||
TYPE_DUN,
|
TYPE_DUN,
|
||||||
TYPE_HIPRI,
|
TYPE_HIPRI,
|
||||||
TYPE_WIMAX,
|
TYPE_WIMAX,
|
||||||
|
TYPE_PROXY,
|
||||||
TYPE_UNKNOWN,
|
TYPE_UNKNOWN,
|
||||||
};
|
};
|
||||||
NetworkInfoDataItemBase(
|
NetworkInfoDataItemBase(
|
||||||
|
|
Loading…
Reference in a new issue