diff options
author | Harikrishnan Hariharan <hahariha@codeaurora.org> | 2018-09-29 12:50:33 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-10-03 04:15:35 -0700 |
commit | 2f80dcc30c30c7a511553863abf8050953e485fc (patch) | |
tree | d12114203a4c81b482920bf72a54443b6995b89b /android | |
parent | bafbd518525073931ea5e374099b1c6da5ac6b25 (diff) | |
download | gps-2f80dcc30c30c7a511553863abf8050953e485fc.tar.gz |
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
Diffstat (limited to 'android')
-rw-r--r-- | android/1.0/AGnssRil.cpp | 23 | ||||
-rw-r--r-- | android/1.1/AGnssRil.cpp | 23 |
2 files changed, 44 insertions, 2 deletions
diff --git a/android/1.0/AGnssRil.cpp b/android/1.0/AGnssRil.cpp index f4b9849..0ab4fad 100644 --- a/android/1.0/AGnssRil.cpp +++ b/android/1.0/AGnssRil.cpp @@ -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() )) { @@ -78,7 +82,24 @@ Return<bool> 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 10478aa..96e3597 100644 --- a/android/1.1/AGnssRil.cpp +++ b/android/1.1/AGnssRil.cpp @@ -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() )) { @@ -78,7 +82,24 @@ Return<bool> 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); |