From 2f80dcc30c30c7a511553863abf8050953e485fc Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Sat, 29 Sep 2018 12:50:33 +0530 Subject: [PATCH] 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 --- android/1.0/AGnssRil.cpp | 23 ++++++++++++++++++++- android/1.1/AGnssRil.cpp | 23 ++++++++++++++++++++- core/data-items/DataItemConcreteTypesBase.h | 1 + 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/android/1.0/AGnssRil.cpp b/android/1.0/AGnssRil.cpp index f4b9849e..0ab4fadd 100644 --- a/android/1.0/AGnssRil.cpp +++ b/android/1.0/AGnssRil.cpp @@ -50,6 +50,10 @@ AGnssRil::~AGnssRil() { Return 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() )) { @@ -78,7 +82,24 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX; break; default: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + { + 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); diff --git a/android/1.1/AGnssRil.cpp b/android/1.1/AGnssRil.cpp index 10478aab..96e3597a 100644 --- a/android/1.1/AGnssRil.cpp +++ b/android/1.1/AGnssRil.cpp @@ -50,6 +50,10 @@ AGnssRil::~AGnssRil() { Return 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() )) { @@ -78,7 +82,24 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX; break; default: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + { + 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); diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index bcb8d725..44be5f99 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -231,6 +231,7 @@ public: TYPE_DUN, TYPE_HIPRI, TYPE_WIMAX, + TYPE_PROXY, TYPE_UNKNOWN, }; NetworkInfoDataItemBase(