94
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
#include "hsrunningappsession.h"
|
|
18 |
#include "tstaskmonitorglobals.h"
|
|
19 |
|
|
20 |
#include "hsdataobservertask.h"
|
|
21 |
#include "hsdataprovidertask.h"
|
|
22 |
|
|
23 |
// -----------------------------------------------------------------------------
|
|
24 |
//
|
|
25 |
// -----------------------------------------------------------------------------
|
|
26 |
//
|
|
27 |
CRunningAppSession::CRunningAppSession(MHsDataObserverStorage& observerStorage,
|
|
28 |
const MHsDataProvider& dataProvider)
|
|
29 |
:
|
|
30 |
mObserverStorage(observerStorage),
|
|
31 |
mDataProvider(dataProvider)
|
|
32 |
{
|
|
33 |
// No implementation required
|
|
34 |
}
|
|
35 |
|
|
36 |
// -----------------------------------------------------------------------------
|
|
37 |
//
|
|
38 |
// -----------------------------------------------------------------------------
|
|
39 |
//
|
|
40 |
CRunningAppSession::~CRunningAppSession()
|
|
41 |
{
|
|
42 |
}
|
|
43 |
|
|
44 |
// -----------------------------------------------------------------------------
|
|
45 |
//
|
|
46 |
// -----------------------------------------------------------------------------
|
|
47 |
//
|
|
48 |
CRunningAppSession* CRunningAppSession::NewL(MHsDataObserverStorage& observerStorage,
|
|
49 |
const MHsDataProvider& dataProvider)
|
|
50 |
{
|
|
51 |
CRunningAppSession* self = new (ELeave) CRunningAppSession(observerStorage, dataProvider);
|
|
52 |
CleanupStack::PushL(self);
|
|
53 |
self->ConstructL();
|
|
54 |
CleanupStack::Pop(self);
|
|
55 |
return self;
|
|
56 |
}
|
|
57 |
|
|
58 |
// -----------------------------------------------------------------------------
|
|
59 |
//
|
|
60 |
// -----------------------------------------------------------------------------
|
|
61 |
//
|
|
62 |
void CRunningAppSession::ConstructL()
|
|
63 |
{
|
|
64 |
}
|
|
65 |
|
|
66 |
// -----------------------------------------------------------------------------
|
|
67 |
//
|
|
68 |
// -----------------------------------------------------------------------------
|
|
69 |
//
|
|
70 |
void CRunningAppSession::ServiceL(const RMessage2& message)
|
|
71 |
{
|
|
72 |
switch (message.Function()) {
|
|
73 |
case SubscribeRunningAppChanges:
|
|
74 |
CHsDataObserverTask::ExecuteLD(mObserverStorage, message);
|
|
75 |
break;
|
|
76 |
|
|
77 |
case CancelSubscribeRunningAppChanges:
|
|
78 |
mObserverStorage.Cancel(message);
|
|
79 |
break;
|
|
80 |
|
|
81 |
case GetRunningAppInfo:
|
|
82 |
case FlushData:
|
|
83 |
HsDataProviderTask::ExecuteL(mDataProvider, message);
|
|
84 |
break;
|
|
85 |
|
|
86 |
default:
|
|
87 |
message.Complete(CServer2::EBadMessageNumber);
|
|
88 |
}
|
|
89 |
}
|