allow a isMaster client in LocAdapterProxyBase ctor

This would allow GeofenceAdapter become a master
adapter, in case it gets created before GnssAdapter.

Change-Id: I9eb55b7fac9970fd11d4e34bdf7cf824e5b1c586
CRs-Fixed: 2403691
This commit is contained in:
Kevin Tang 2019-02-27 14:44:29 -08:00
parent 90310754f8
commit b082fd7f7b
2 changed files with 5 additions and 9 deletions

View file

@ -69,15 +69,11 @@ protected:
inline LocAdapterBase(const MsgTask* msgTask) :
mIsMaster(false), mEvtMask(0), mContext(NULL), mLocApi(NULL),
mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {}
LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
ContextBase* context, bool isMaster,
LocAdapterProxyBase *adapterProxyBase = NULL);
public:
inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); }
inline LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
ContextBase* context,
LocAdapterProxyBase *adapterProxyBase = NULL) :
LocAdapterBase(mask, context, false, adapterProxyBase) {}
LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
ContextBase* context, bool isMaster = false,
LocAdapterProxyBase *adapterProxyBase = NULL);
inline LOC_API_ADAPTER_EVENT_MASK_T
checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const {

View file

@ -40,8 +40,8 @@ private:
LocAdapterBase *mLocAdapterBase;
protected:
inline LocAdapterProxyBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
ContextBase* context):
mLocAdapterBase(new LocAdapterBase(mask, context, this)) {
ContextBase* context, bool isMaster = false):
mLocAdapterBase(new LocAdapterBase(mask, context, isMaster, this)) {
}
inline virtual ~LocAdapterProxyBase() {
delete mLocAdapterBase;