|
1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "ASAltServerDeathObserver.h" |
|
17 |
|
18 // User includes |
|
19 #include "ASAltClientSession.h" |
|
20 |
|
21 |
|
22 // |
|
23 // ----> CASAltServerDeathObserver (source) |
|
24 // |
|
25 |
|
26 //************************************************************************************* |
|
27 CASAltServerDeathObserver::CASAltServerDeathObserver(RASAltClientSession& aSession) |
|
28 : CActive(CActive::EPriorityHigh), iSession(aSession) |
|
29 { |
|
30 CActiveScheduler::Add(this); |
|
31 } |
|
32 |
|
33 |
|
34 //************************************************************************************* |
|
35 CASAltServerDeathObserver::~CASAltServerDeathObserver() |
|
36 { |
|
37 Cancel(); |
|
38 } |
|
39 |
|
40 |
|
41 //************************************************************************************* |
|
42 void CASAltServerDeathObserver::ConstructL() |
|
43 { |
|
44 // Kill the Alarm Server as soon as the Alarm Alert Server dies |
|
45 iSession.NotifyAlertServerDeath(iStatus); |
|
46 SetActive(); |
|
47 } |
|
48 |
|
49 |
|
50 //************************************************************************************* |
|
51 CASAltServerDeathObserver* CASAltServerDeathObserver::NewL(RASAltClientSession& aSession) |
|
52 { |
|
53 CASAltServerDeathObserver* self = new(ELeave) CASAltServerDeathObserver(aSession); |
|
54 CleanupStack::PushL(self); |
|
55 self->ConstructL(); |
|
56 CleanupStack::Pop(self); |
|
57 return self; |
|
58 } |
|
59 |
|
60 |
|
61 // |
|
62 // |
|
63 // |
|
64 |
|
65 |
|
66 //************************************************************************************* |
|
67 void CASAltServerDeathObserver::RunL() |
|
68 { |
|
69 // Undertaker - the under taker stops the active scheduler (shuts down the alarm |
|
70 // server) if the UIKON server which handles alarm windows fails. |
|
71 if (iStatus != KErrCancel) |
|
72 CActiveScheduler::Stop(); |
|
73 } |
|
74 |
|
75 |
|
76 //************************************************************************************* |
|
77 void CASAltServerDeathObserver::DoCancel() |
|
78 { |
|
79 TRequestStatus* status = &iStatus; |
|
80 User::RequestComplete(status, KErrCancel); |
|
81 } |
|
82 |
|
83 |
|
84 // |
|
85 // |
|
86 // |
|
87 |