diff --git a/core/Android.mk b/core/Android.mk index 298c4131..11cecc65 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -38,7 +38,7 @@ LOCAL_COPY_HEADERS:= \ LocAdapterBase.h \ ContextBase.h \ LocDualContext.h \ - IzatProxyBase.h \ + LBSProxyBase.h \ UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 1826ec79..7879015f 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -40,21 +40,22 @@ namespace loc_core { - -IzatProxyBase* ContextBase::getIzatProxy(const char* libName) +LBSProxyBase* ContextBase::getLBSProxy(const char* libName) { - IzatProxyBase* proxy = NULL; + LBSProxyBase* proxy = NULL; + LOC_LOGD("%s:%d]: getLBSProxy libname: %s\n", __func__, __LINE__, libName); void* lib = dlopen(libName, RTLD_NOW); if ((void*)NULL != lib) { - getIzatProxy_t* getter = (getIzatProxy_t*)dlsym(lib, "getIzatProxy"); + getLBSProxy_t* getter = (getLBSProxy_t*)dlsym(lib, "getLBSProxy"); if (NULL != getter) { proxy = (*getter)(); } } if (NULL == proxy) { - proxy = new IzatProxyBase(); + proxy = new LBSProxyBase(); } + LOC_LOGD("%s:%d]: Exiting\n", __func__, __LINE__); return proxy; } @@ -64,7 +65,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // first if can not be MPQ if (TARGET_MPQ != get_target()) { - if (NULL == (locApi = mIzatProxy->getLocApi(mMsgTask, exMask))) { + if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) { // only RPC is the option now void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); if (NULL != handle) { @@ -88,7 +89,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) ContextBase::ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, const char* libName) : - mIzatProxy(getIzatProxy(libName)), + mLBSProxy(getLBSProxy(libName)), mMsgTask(msgTask), mLocApi(createLocApi(exMask)) { diff --git a/core/ContextBase.h b/core/ContextBase.h index fc60db42..93cb31ff 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -33,17 +33,17 @@ #include #include #include -#include +#include namespace loc_core { class LocAdapterBase; class ContextBase { - static IzatProxyBase* getIzatProxy(const char* libName); + static LBSProxyBase* getLBSProxy(const char* libName); LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask); protected: - const IzatProxyBase* mIzatProxy; + const LBSProxyBase* mLBSProxy; const MsgTask* mMsgTask; LocApiBase* mLocApi; @@ -51,14 +51,14 @@ public: ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, const char* libName); - inline virtual ~ContextBase() { delete mLocApi; delete mIzatProxy; } + inline virtual ~ContextBase() { delete mLocApi; delete mLBSProxy; } inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } - inline bool hasAgpsExt() { return mIzatProxy->hasAgpsExt(); } + inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { - mIzatProxy->requestUlp(adapter, capabilities); + mLBSProxy->requestUlp(adapter, capabilities); } }; diff --git a/core/IzatProxyBase.h b/core/LBSProxyBase.h similarity index 94% rename from core/IzatProxyBase.h rename to core/LBSProxyBase.h index e7e3d3fa..e643d126 100644 --- a/core/IzatProxyBase.h +++ b/core/LBSProxyBase.h @@ -28,7 +28,6 @@ */ #ifndef IZAT_PROXY_BASE_H #define IZAT_PROXY_BASE_H - #include #include @@ -37,7 +36,7 @@ namespace loc_core { class LocApiBase; class LocAdapterBase; -class IzatProxyBase { +class LBSProxyBase { friend class ContextBase; inline virtual LocApiBase* getLocApi(const MsgTask* msgTask, @@ -45,15 +44,15 @@ class IzatProxyBase { return NULL; } protected: - inline IzatProxyBase() {} + inline LBSProxyBase() {} public: - inline virtual ~IzatProxyBase() {} + inline virtual ~LBSProxyBase() {} inline virtual void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) const {} inline virtual bool hasAgpsExt() const { return false; } }; -typedef IzatProxyBase* (getIzatProxy_t)(); +typedef LBSProxyBase* (getLBSProxy_t)(); } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 577d21bf..7a6456c1 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -296,6 +296,11 @@ void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); } +void* LocApiBase :: getSibling() + DEFAULT_IMPL(NULL) +void* LocApiBase :: getSibling2() + DEFAULT_IMPL(NULL) + enum loc_api_adapter_err LocApiBase:: open(LOC_API_ADAPTER_EVENT_MASK_T mask) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 2fcac845..4ddc57f1 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -33,7 +33,7 @@ #include #include #include - +#include namespace loc_core { int hexcode(char *hexstring, int string_size, @@ -77,8 +77,6 @@ protected: bool isInSession(); public: - inline virtual void* getSibling() { return NULL; } - void addAdapter(LocAdapterBase* adapter); void removeAdapter(LocAdapterBase* adapter); @@ -111,6 +109,9 @@ public: // downward calls // All below functions are to be defined by adapter specific modules: // RPC, QMI, etc. The default implementation is empty. + + virtual void* getSibling(); + virtual void* getSibling2(); virtual enum loc_api_adapter_err startFix(const LocPosMode& posMode); virtual enum loc_api_adapter_err diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 5c0c9a72..86c3613a 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -58,7 +58,7 @@ ContextBase* LocDualContext::mBgContext = NULL; // the name must be shorter than 15 chars const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; -const char* LocDualContext::mIzatLibName = "libizat_core.so"; +const char* LocDualContext::mIzatLibName = "liblbs_core.so"; const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, const char* name)