diff options
author | ChengYou Ho <chengyouho@google.com> | 2019-10-22 09:08:26 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-10-22 09:08:26 -0700 |
commit | 2dcbb1efacb66e4ac019458a44640505b7b9b9c4 (patch) | |
tree | fdb69be10f885dbc28179682b55e7ea64a247459 /core | |
parent | 24eecb4e8eb4566f09551dcbd6f314bdcb158595 (diff) | |
parent | d4d1b630d1a60719098a6a798ecf5adb5e6329f9 (diff) | |
download | gps-aml_tz2_305400500.tar.gz |
Merge remote-tracking branch 'goog/qcom/release/LA.UM.8.1.R1.10.00.00.529.095' into qt-qpr1-dev am: b23301cfa5r_aml_301500702platform-tools-31.0.2platform-tools-31.0.1platform-tools-31.0.0platform-tools-30.0.5android-s-preview-1android-mainline-12.0.0_r55android-mainline-12.0.0_r112android-mainline-11.0.0_r9android-mainline-11.0.0_r8android-mainline-11.0.0_r7android-mainline-11.0.0_r6android-mainline-11.0.0_r5android-mainline-11.0.0_r45android-mainline-11.0.0_r44android-mainline-11.0.0_r43android-mainline-11.0.0_r42android-mainline-11.0.0_r41android-mainline-11.0.0_r40android-mainline-11.0.0_r4android-mainline-11.0.0_r39android-mainline-11.0.0_r38android-mainline-11.0.0_r37android-mainline-11.0.0_r36android-mainline-11.0.0_r35android-mainline-11.0.0_r34android-mainline-11.0.0_r33android-mainline-11.0.0_r32android-mainline-11.0.0_r31android-mainline-11.0.0_r30android-mainline-11.0.0_r3android-mainline-11.0.0_r29android-mainline-11.0.0_r28android-mainline-11.0.0_r27android-mainline-11.0.0_r26android-mainline-11.0.0_r25android-mainline-11.0.0_r24android-mainline-11.0.0_r23android-mainline-11.0.0_r22android-mainline-11.0.0_r21android-mainline-11.0.0_r20android-mainline-11.0.0_r2android-mainline-11.0.0_r19android-mainline-11.0.0_r18android-mainline-11.0.0_r17android-mainline-11.0.0_r16android-mainline-11.0.0_r15android-mainline-11.0.0_r14android-mainline-11.0.0_r13android-mainline-11.0.0_r12android-mainline-11.0.0_r10android-mainline-11.0.0_r1android-11.0.0_r9android-11.0.0_r8android-11.0.0_r7android-11.0.0_r48android-11.0.0_r47android-11.0.0_r46android-11.0.0_r45android-11.0.0_r44android-11.0.0_r43android-11.0.0_r42android-11.0.0_r41android-11.0.0_r40android-11.0.0_r39android-11.0.0_r38android-11.0.0_r37android-11.0.0_r36android-11.0.0_r35android-11.0.0_r34android-11.0.0_r33android-11.0.0_r32android-11.0.0_r31android-11.0.0_r30android-11.0.0_r29android-11.0.0_r28android-11.0.0_r27android-11.0.0_r26android-11.0.0_r24android-11.0.0_r23android-11.0.0_r22android-11.0.0_r21android-11.0.0_r20android-11.0.0_r19android-11.0.0_r18android-11.0.0_r16android-11.0.0_r15android-11.0.0_r14android-11.0.0_r13android-11.0.0_r12android-11.0.0_r11android-11.0.0_r10aml_tz2_305400500aml_tz2_305400300aml_tz2_305400100aml_tz2_304500300aml_tz2_303900110aml_tz2_303900102aml_tz2_303800002aml_tz2_303800001aml_tz2_303200001android12-mainline-tzdata2-releaseandroid11-qpr3-s1-releaseandroid11-qpr3-releaseandroid11-qpr2-releaseandroid11-qpr1-s2-releaseandroid11-qpr1-s1-releaseandroid11-qpr1-releaseandroid11-qpr1-d-s1-releaseandroid11-qpr1-d-releaseandroid11-qpr1-c-releaseandroid11-mainline-tethering-releaseandroid11-mainline-sparse-2021-jan-releaseandroid11-mainline-sparse-2020-dec-releaseandroid11-mainline-releaseandroid11-mainline-permission-releaseandroid11-mainline-os-statsd-releaseandroid11-mainline-networkstack-releaseandroid11-mainline-media-swcodec-releaseandroid11-mainline-media-releaseandroid11-mainline-extservices-releaseandroid11-mainline-documentsui-releaseandroid11-mainline-conscrypt-releaseandroid11-mainline-cellbroadcast-releaseandroid11-mainline-captiveportallogin-releaseandroid11-devandroid11-d2-releaseandroid11-d1-s7-releaseandroid11-d1-s6-releaseandroid11-d1-s5-releaseandroid11-d1-s1-releaseandroid11-d1-releaseandroid11-d1-b-releaseaml_tz2_305400100
am: d4d1b630d1
Change-Id: Ie515da7ba8355e467b0eb6aa14351ac02892403c
Diffstat (limited to 'core')
-rw-r--r-- | core/ContextBase.cpp | 26 | ||||
-rw-r--r-- | core/ContextBase.h | 1 | ||||
-rw-r--r-- | core/EngineHubProxyBase.h | 19 | ||||
-rw-r--r-- | core/LocAdapterBase.cpp | 1 | ||||
-rw-r--r-- | core/LocAdapterBase.h | 6 | ||||
-rw-r--r-- | core/LocApiBase.cpp | 15 | ||||
-rw-r--r-- | core/LocApiBase.h | 9 | ||||
-rw-r--r-- | core/SystemStatusOsObserver.cpp | 2 | ||||
-rw-r--r-- | core/SystemStatusOsObserver.h | 8 | ||||
-rw-r--r-- | core/observer/IFrameworkActionReq.h | 2 |
10 files changed, 56 insertions, 33 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 084b6bf..d5c3108 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -40,6 +40,10 @@ namespace loc_core { +#define SLL_LOC_API_LIB_NAME "libsynergy_loc_api.so" +#define LOC_APIV2_0_LIB_NAME "libloc_api_v02.so" +#define IS_SS5_HW_ENABLED 1 + loc_gps_cfg_s_type ContextBase::mGps_conf {}; loc_sap_cfg_s_type ContextBase::mSap_conf {}; bool ContextBase::sIsEngineCapabilitiesKnown = false; @@ -80,6 +84,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED", &mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'}, {"PROXY_APP_PACKAGE_NAME", &mGps_conf.PROXY_APP_PACKAGE_NAME, NULL, 's' }, {"CP_MTLR_ES", &mGps_conf.CP_MTLR_ES, NULL, 'n' }, + {"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'}, }; const loc_param_s_type ContextBase::mSap_conf_table[] = @@ -171,10 +176,16 @@ void ContextBase::readConfig() mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0; /* default configuration value of position assisted clock estimator mode */ mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0; + /* default configuration QTI GNSS H/W */ + mGps_conf.GNSS_DEPLOYMENT = 0; UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); + LOC_LOGI("%s] GNSS Deployment: %s", __FUNCTION__, + ((mGps_conf.GNSS_DEPLOYMENT == 1) ? "SS5" : + ((mGps_conf.GNSS_DEPLOYMENT == 2) ? "QFUSION" : "QGNSS"))); + switch (getTargetGnssType(loc_get_target())) { case GNSS_GSS: case GNSS_AUTO: @@ -231,19 +242,24 @@ LBSProxyBase* ContextBase::getLBSProxy(const char* libName) LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) { LocApiBase* locApi = NULL; + const char* libname = LOC_APIV2_0_LIB_NAME; // Check the target if (TARGET_NO_GNSS != loc_get_target()){ if (NULL == (locApi = mLBSProxy->getLocApi(exMask, this))) { void *handle = NULL; - //try to see if LocApiV02 is present - if ((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) { - LOC_LOGD("%s:%d]: libloc_api_v02.so is present", __func__, __LINE__); + + if (IS_SS5_HW_ENABLED == mGps_conf.GNSS_DEPLOYMENT) { + libname = SLL_LOC_API_LIB_NAME; + } + + if ((handle = dlopen(libname, RTLD_NOW)) != NULL) { + LOC_LOGD("%s:%d]: %s is present", __func__, __LINE__, libname); getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi"); if (getter != NULL) { - LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, - __LINE__); + LOC_LOGD("%s:%d]: getter is not NULL of %s", __func__, + __LINE__, libname); locApi = (*getter)(exMask, this); } } diff --git a/core/ContextBase.h b/core/ContextBase.h index ab61a08..5da76e2 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -73,6 +73,7 @@ typedef struct loc_gps_cfg_s uint32_t POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED; char PROXY_APP_PACKAGE_NAME[LOC_MAX_PARAM_STRING]; uint32_t CP_MTLR_ES; + uint32_t GNSS_DEPLOYMENT; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index 4239a50..ec881f6 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -103,12 +103,8 @@ public: } }; -typedef std::function<void(const UlpLocation& ulpLocation, - const GpsLocationExtended& locationExtended, - enum loc_sess_status status, - LocPosTechMask techMask, - bool fromEngineHub)> - GnssAdapterReportPositionEventCb; +typedef std::function<void(int count, EngineLocationInfo* locationArr)> + GnssAdapterReportEnginePositionsEventCb; typedef std::function<void(const GnssSvNotification& svNotify, bool fromEngineHub)> @@ -119,11 +115,12 @@ typedef std::function<void(const GnssAidingDataSvMask& svDataMask)> // potential parameters: message queue: MsgTask * msgTask; // callback function to report back dr and ppe position and sv report -typedef EngineHubProxyBase* (getEngHubProxyFn)(const MsgTask * msgTask, - IOsObserver* osObserver, - GnssAdapterReportPositionEventCb positionEventCb, - GnssAdapterReportSvEventCb svEventCb, - GnssAdapterReqAidingDataCb reqAidingDataCb); +typedef EngineHubProxyBase* (getEngHubProxyFn)( + const MsgTask * msgTask, + IOsObserver* osObserver, + GnssAdapterReportEnginePositionsEventCb positionEventCb, + GnssAdapterReportSvEventCb svEventCb, + GnssAdapterReqAidingDataCb reqAidingDataCb); } // namespace loc_core diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index ffd3d5a..1b844e5 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -81,7 +81,6 @@ void LocAdapterBase:: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool /*fromEngineHub*/, GnssDataNotification* pDataNotify, int msInWeek) { diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index b9b1f1e..909b6fe 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -151,9 +151,13 @@ public: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool fromEngineHub = false, GnssDataNotification* pDataNotify = nullptr, int msInWeek = -1); + virtual void reportEnginePositionsEvent(unsigned int count, + EngineLocationInfo* locationArr) { + (void)count; + (void)locationArr; + } virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromEngineHub=false); virtual void reportDataEvent(const GnssDataNotification& dataNotify, int msInWeek); diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index ef204ec..8c79cf7 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -148,7 +148,8 @@ struct LocCloseMsg : public LocMsg { } }; -MsgTask* LocApiBase::mMsgTask; +MsgTask* LocApiBase::mMsgTask = nullptr; +volatile int32_t LocApiBase::mMsgTaskRefCount = 0; LocApiBase::LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context) : @@ -157,6 +158,7 @@ LocApiBase::LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, { memset(mLocAdapters, 0, sizeof(mLocAdapters)); + android_atomic_inc(&mMsgTaskRefCount); if (nullptr == mMsgTask) { mMsgTask = new MsgTask("LocApiMsgTask", false); } @@ -230,7 +232,7 @@ void LocApiBase::addAdapter(LocAdapterBase* adapter) for (int i = 0; i < MAX_ADAPTERS && mLocAdapters[i] != adapter; i++) { if (mLocAdapters[i] == NULL) { mLocAdapters[i] = adapter; - mMsgTask->sendMsg(new LocOpenMsg(this, adapter)); + sendMsg(new LocOpenMsg(this, adapter)); break; } } @@ -263,10 +265,10 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) // if we have an empty list of adapters if (0 == i) { - mMsgTask->sendMsg(new LocCloseMsg(this)); + sendMsg(new LocCloseMsg(this)); } else { // else we need to remove the bit - mMsgTask->sendMsg(new LocOpenMsg(this)); + sendMsg(new LocOpenMsg(this)); } } } @@ -274,7 +276,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) void LocApiBase::updateEvtMask() { - mMsgTask->sendMsg(new LocOpenMsg(this)); + sendMsg(new LocOpenMsg(this)); } void LocApiBase::updateNmeaMask(uint32_t mask) @@ -298,7 +300,7 @@ void LocApiBase::updateNmeaMask(uint32_t mask) } }; - mMsgTask->sendMsg(new LocSetNmeaMsg(this, mask)); + sendMsg(new LocSetNmeaMsg(this, mask)); } void LocApiBase::handleEngineUpEvent() @@ -343,7 +345,6 @@ void LocApiBase::reportPosition(UlpLocation& location, TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportPositionEvent(location, locationExtended, status, loc_technology_mask, - false, pDataNotify, msInWeek) ); } diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 8c885f7..6dac585 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -34,6 +34,7 @@ #include <gps_extended.h> #include <LocationAPI.h> #include <MsgTask.h> +#include <LocSharedLock.h> #include <log_util.h> namespace loc_core { @@ -107,6 +108,7 @@ class LocApiBase { friend struct LocKillMsg; friend class ContextBase; static MsgTask* mMsgTask; + static volatile int32_t mMsgTaskRefCount; LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; protected: @@ -121,7 +123,8 @@ protected: LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context = NULL); inline virtual ~LocApiBase() { - if (nullptr != mMsgTask) { + android_atomic_dec(&mMsgTaskRefCount); + if (nullptr != mMsgTask && 0 == mMsgTaskRefCount) { mMsgTask->destroy(); mMsgTask = nullptr; } @@ -132,7 +135,9 @@ protected: public: inline void sendMsg(const LocMsg* msg) const { - mMsgTask->sendMsg(msg); + if (nullptr != mMsgTask) { + mMsgTask->sendMsg(msg); + } } inline void destroy() { close(); diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index 3fdb513..0427380 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -448,7 +448,7 @@ void SystemStatusOsObserver::turnOff(DataItemId dit) } } -#ifdef USE_QCMAP +#ifdef USE_GLIB bool SystemStatusOsObserver::connectBackhaul() { bool result = false; diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index 8710976..fd60606 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -84,7 +84,7 @@ public: mSystemStatus(systemstatus), mContext(msgTask, this), mAddress("SystemStatusOsObserver"), mClientToDataItems(MAX_DATA_ITEM_ID), mDataItemToClients(MAX_DATA_ITEM_ID) -#ifdef USE_QCMAP +#ifdef USE_GLIB , mBackHaulConnectReqCount(0) #endif { @@ -106,7 +106,7 @@ public: // To set the framework action request object inline void setFrameworkActionReqObj(IFrameworkActionReq* frameworkActionReqObj) { mContext.mFrameworkActionReqObj = frameworkActionReqObj; -#ifdef USE_QCMAP +#ifdef USE_GLIB if (mBackHaulConnectReqCount > 0) { connectBackhaul(); mBackHaulConnectReqCount = 0; @@ -134,7 +134,7 @@ public: // IFrameworkActionReq Overrides virtual void turnOn(DataItemId dit, int timeOut = 0) override; virtual void turnOff(DataItemId dit) override; -#ifdef USE_QCMAP +#ifdef USE_GLIB virtual bool connectBackhaul() override; virtual bool disconnectBackhaul(); #endif @@ -151,7 +151,7 @@ private: // Cache the subscribe and requestData till subscription obj is obtained void cacheObserverRequest(ObserverReqCache& reqCache, const list<DataItemId>& l, IDataItemObserver* client); -#ifdef USE_QCMAP +#ifdef USE_GLIB // Cache the framework action request for connect/disconnect int mBackHaulConnectReqCount; #endif diff --git a/core/observer/IFrameworkActionReq.h b/core/observer/IFrameworkActionReq.h index a4ccad8..4be947f 100644 --- a/core/observer/IFrameworkActionReq.h +++ b/core/observer/IFrameworkActionReq.h @@ -70,7 +70,7 @@ public: */ virtual void turnOff (DataItemId dit) = 0; -#ifdef USE_QCMAP +#ifdef USE_GLIB /** * @brief Setup WWAN backhaul * @details Setup WWAN backhaul |