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 #include "tsdatatask.h" |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // |
|
26 // ----------------------------------------------------------------------------- |
|
27 // |
|
28 CRunningAppSession::CRunningAppSession(MHsDataObserverStorage& observerStorage, |
|
29 const MHsDataProvider& dataProvider, |
|
30 MTsDataStorage& dataStorage) |
|
31 : |
|
32 mObserverStorage(observerStorage), |
|
33 mDataProvider(dataProvider), |
|
34 mDataStorage(dataStorage) |
|
35 { |
|
36 // No implementation required |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 CRunningAppSession::~CRunningAppSession() |
|
44 { |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 CRunningAppSession* CRunningAppSession::NewL(MHsDataObserverStorage& observerStorage, |
|
52 const MHsDataProvider& dataProvider, |
|
53 MTsDataStorage& dataStorage) |
|
54 { |
|
55 CRunningAppSession* self = new (ELeave) CRunningAppSession(observerStorage, |
|
56 dataProvider, |
|
57 dataStorage); |
|
58 CleanupStack::PushL(self); |
|
59 self->ConstructL(); |
|
60 CleanupStack::Pop(self); |
|
61 return self; |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 void CRunningAppSession::ConstructL() |
|
69 { |
|
70 } |
|
71 |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 // ----------------------------------------------------------------------------- |
|
75 // |
|
76 void CRunningAppSession::ServiceL(const RMessage2& message) |
|
77 { |
|
78 switch (message.Function()) { |
|
79 case SubscribeRunningAppChanges: |
|
80 CHsDataObserverTask::ExecuteLD(mObserverStorage, message); |
|
81 break; |
|
82 |
|
83 case CancelSubscribeRunningAppChanges: |
|
84 mObserverStorage.Cancel(message); |
|
85 break; |
|
86 |
|
87 case GetRunningAppInfo: |
|
88 case FlushData: |
|
89 HsDataProviderTask::ExecuteL(mDataProvider, message); |
|
90 break; |
|
91 |
|
92 case RegisterScreenshotMessage: |
|
93 case UnregisterScreenshotMessage: |
|
94 case VisibilityChange: |
|
95 TsDataTask::ExecuteL(mDataStorage, message); |
|
96 break; |
|
97 |
|
98 default: |
|
99 message.Complete(CServer2::EBadMessageNumber); |
|
100 } |
|
101 } |
|