Updating AgpsSubscriber constructor

Updating AgpsSubscriber constructor to ensure clone
operation copies the entire state

Change-Id: Id016994efd8cb1140af8d5ee05eace95922f246b
CRs-Fixed: 2039863
This commit is contained in:
Saurabh Srivastava 2017-04-28 15:31:33 +05:30
parent 25008877c3
commit 876db40641
2 changed files with 11 additions and 6 deletions

View file

@ -654,7 +654,9 @@ void DSStateMachine::notifyEventToSubscriber(
AgpsEvent event, AgpsSubscriber* subscriberToNotify, AgpsEvent event, AgpsSubscriber* subscriberToNotify,
bool deleteSubscriberPostNotify) { bool deleteSubscriberPostNotify) {
LOC_LOGD("DSStateMachine::notifyEventToSubscriber"); LOC_LOGD("DSStateMachine::notifyEventToSubscriber(): "
"SM %p, Event %d Subscriber %p Delete %d",
this, event, subscriberToNotify, deleteSubscriberPostNotify);
switch (event){ switch (event){
@ -781,7 +783,7 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){
} }
/* Invoke AGPS SM processing */ /* Invoke AGPS SM processing */
AgpsSubscriber subscriber(connHandle); AgpsSubscriber subscriber(connHandle, false, false);
sm->setCurrentSubscriber(&subscriber); sm->setCurrentSubscriber(&subscriber);
/* If DS State Machine, wait for close complete */ /* If DS State Machine, wait for close complete */

View file

@ -173,16 +173,19 @@ public:
bool mWaitForCloseComplete; bool mWaitForCloseComplete;
bool mIsInactive; bool mIsInactive;
inline AgpsSubscriber(int connHandle) : inline AgpsSubscriber(
mConnHandle(connHandle), mWaitForCloseComplete(false), int connHandle, bool waitForCloseComplete, bool isInactive) :
mIsInactive(false) {} mConnHandle(connHandle),
mWaitForCloseComplete(waitForCloseComplete),
mIsInactive(isInactive) {}
inline virtual ~AgpsSubscriber() {} inline virtual ~AgpsSubscriber() {}
inline virtual bool equals(const AgpsSubscriber *s) const inline virtual bool equals(const AgpsSubscriber *s) const
{ return (mConnHandle == s->mConnHandle); } { return (mConnHandle == s->mConnHandle); }
inline virtual AgpsSubscriber* clone() inline virtual AgpsSubscriber* clone()
{ return new AgpsSubscriber(mConnHandle); } { return new AgpsSubscriber(
mConnHandle, mWaitForCloseComplete, mIsInactive); }
}; };
/* AGPS STATE MACHINE */ /* AGPS STATE MACHINE */