diff options
author | Dante Russo <drusso@codeaurora.org> | 2016-05-26 14:35:31 -0700 |
---|---|---|
committer | Dante Russo <drusso@codeaurora.org> | 2016-05-27 15:56:43 -0700 |
commit | 183e295b9b7fef1166c6bd0b1778dffd2321627a (patch) | |
tree | 87ebffa5d43ba6d823755ed53497595d17627504 /core/ContextBase.cpp | |
parent | 35877af173aeb6363b77f3a1a3d024cb85ce590f (diff) | |
download | gps-183e295b9b7fef1166c6bd0b1778dffd2321627a.tar.gz |
Move local gps/sap configuration to Context
gps/sap configuration is moved from a global
variable in loc eng to a static in ContextBase,
so that it is more accessible without having to
link with loc eng for access.
CRs-fixed: 1012772
Change-Id: I74bf456b44fab3a2db016ef4c4b4b3a2b8cde1b2
Diffstat (limited to 'core/ContextBase.cpp')
-rw-r--r-- | core/ContextBase.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 58dc8a7..c429c2d 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -40,6 +40,27 @@ namespace loc_core { +loc_gps_cfg_s_type ContextBase::mGps_conf {0}; +loc_sap_cfg_s_type ContextBase::mSap_conf {0}; + +uint32_t ContextBase::getCarrierCapabilities() { + #define carrierMSA (uint32_t)0x2 + #define carrierMSB (uint32_t)0x1 + #define gpsConfMSA (uint32_t)0x4 + #define gpsConfMSB (uint32_t)0x2 + uint32_t capabilities = mGps_conf.CAPABILITIES; + if ((mGps_conf.SUPL_MODE & carrierMSA) != carrierMSA) { + capabilities &= ~gpsConfMSA; + } + if ((mGps_conf.SUPL_MODE & carrierMSB) != carrierMSB) { + capabilities &= ~gpsConfMSB; + } + + LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x", + mGps_conf.CAPABILITIES, mGps_conf.SUPL_MODE, capabilities); + return capabilities; +} + LBSProxyBase* ContextBase::getLBSProxy(const char* libName) { LBSProxyBase* proxy = NULL; |