From b80452111794b613819d5ad51e1690c4dd923e97 Mon Sep 17 00:00:00 2001 From: crancocco Date: Sat, 25 Jun 2016 22:55:16 +0800 Subject: z2_plus: Update GPS HAL from upstream * Tag LA.HB.1.3.2-15400-8x96.0 Change-Id: I2ba108f26a2ef4fc78504ef8c08ca41624ccb193 --- gps/core/ContextBase.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gps/core/ContextBase.cpp') diff --git a/gps/core/ContextBase.cpp b/gps/core/ContextBase.cpp index 9f6c4aa..971354d 100644 --- a/gps/core/ContextBase.cpp +++ b/gps/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; -- cgit v1.2.3