--- a/activityfw/activitydatabase/hsactivitydbserver/inc/activityobservertask.h Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activityobservertask.h Tue Jun 01 11:30:17 2010 +0300
@@ -74,6 +74,11 @@
* Write response data to requested message
*/
void WriteResponseL();
+
+ /**
+ * Returns ETrue if task is related with session argument
+ */
+ TBool IsSessionTask(const CSession2* session);
private:
MActivityTaskStorage& mGlobalStorage;
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/activityserver.h Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activityserver.h Tue Jun 01 11:30:17 2010 +0300
@@ -63,6 +63,7 @@
* @see MActivityTaskStorage::StorageData()
*/
const RPointerArray<CActivityTask>& StorageData() const;
+
private:
@@ -81,7 +82,12 @@
* @see CServer2::NewSessionL(const TVersion&, const RMessage2&)
*/
CSession2* NewSessionL(const TVersion& version, const RMessage2& message) const;
-
+
+ /**
+ * Removes not valid task
+ */
+ void RemoveNotValidTasks(const CSession2* session);
+
private:
RFs mFsSession;
CActivityStorage* mStorage;
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitysession.h Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitysession.h Tue Jun 01 11:30:17 2010 +0300
@@ -71,6 +71,11 @@
* @see MActivityTaskStorage::StorageData()
*/
const RPointerArray<CActivityTask>& StorageData() const;
+
+ /**
+ * Removes not valid task
+ */
+ void RemoveNotValidTasks(const CSession2* session);
private:
/**
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitystorageasynctask.h Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitystorageasynctask.h Tue Jun 01 11:30:17 2010 +0300
@@ -95,6 +95,11 @@
* @param msg - destination message
*/
void WriteResponseL(const RMessage2& msg);
+
+ /**
+ * Returns ETrue if task is related with session argument
+ */
+ TBool IsSessionTask(const CSession2* session);
private:
RBuf8 mData;
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitytask.h Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitytask.h Tue Jun 01 11:30:17 2010 +0300
@@ -30,6 +30,11 @@
* @param msg - broadcast message
*/
virtual void BroadcastReceivedL(const RMessage2& msg) =0;
+
+ /**
+ * Returns ETrue if task is related with session argument
+ */
+ virtual TBool IsSessionTask(const CSession2* session) =0;
};
#endif //ACTIVITYTASK_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitytaskstorage.h Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitytaskstorage.h Tue Jun 01 11:30:17 2010 +0300
@@ -37,6 +37,11 @@
* List of registered tasks
*/
virtual const RPointerArray<CActivityTask>& StorageData() const =0;
+
+ /**
+ * Removes not valid task
+ */
+ virtual void RemoveNotValidTasks(const CSession2* session) =0;
};
#endif //ACTIVITYTASKSTORAGE_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitythumbnailtask.h Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitythumbnailtask.h Tue Jun 01 11:30:17 2010 +0300
@@ -67,6 +67,11 @@
const TDesC8& Data()const;
void BroadcastReceivedL(const RMessage2& );
+
+ /**
+ * Returns ETrue if task is related with session argument
+ */
+ TBool IsSessionTask(const CSession2* session);
private:
MActivityTaskStorage& mStorage;
--- a/activityfw/activitydatabase/hsactivitydbserver/src/activityobservertask.cpp Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activityobservertask.cpp Tue Jun 01 11:30:17 2010 +0300
@@ -125,3 +125,12 @@
mMsg.WriteL(KResponseDataSizeOffset, TPckgBuf<TInt>(mData.Length()));//write data size
mMsg.WriteL(KResponseIdOffset, TPckgBuf<CBase*>(this));//task identyfier
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TBool CActivityObserverTask::IsSessionTask(const CSession2* session)
+{
+ return mMsg.Session() == session ? ETrue : EFalse;
+}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/activityserver.cpp Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activityserver.cpp Tue Jun 01 11:30:17 2010 +0300
@@ -114,3 +114,17 @@
{
return mObservers;
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CActivityServer::RemoveNotValidTasks(const CSession2* session)
+{
+ for (TInt i=mObservers.Count()-1; i>=0; --i) {
+ if( mObservers[i]->IsSessionTask(session) ) {
+ delete mObservers[i];
+ mObservers.Remove(i);
+ }
+ }
+}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/activitysession.cpp Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitysession.cpp Tue Jun 01 11:30:17 2010 +0300
@@ -48,7 +48,7 @@
//
CActivitySession::~CActivitySession()
{
- mRunningTasks.ResetAndDestroy();
+ RemoveNotValidTasks(this);
}
// -----------------------------------------------------------------------------
@@ -150,3 +150,13 @@
{
return mRunningTasks;
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CActivitySession::RemoveNotValidTasks(const CSession2* session)
+{
+ mRunningTasks.ResetAndDestroy();
+ mTasksStorage.RemoveNotValidTasks(this);
+}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/activitystorageasynctask.cpp Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitystorageasynctask.cpp Tue Jun 01 11:30:17 2010 +0300
@@ -128,3 +128,12 @@
TPckgBuf<CBase*>(this));//task identyfier
}
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TBool CActivityStorageAsyncTask::IsSessionTask(const CSession2* /*session*/)
+{
+ return EFalse;
+}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/activitythumbnailtask.cpp Fri May 28 16:17:03 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitythumbnailtask.cpp Tue Jun 01 11:30:17 2010 +0300
@@ -124,3 +124,11 @@
{
}
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TBool CActivityThumbnailTask::IsSessionTask(const CSession2* session)
+{
+ return mMsg.Session() == session ? ETrue : EFalse;
+}