|
1 // Copyright (c) 2006-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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "cshutdowntimer.h" |
|
17 #include <e32debug.h> |
|
18 /// Lbs |
|
19 #include "lbsdevloggermacros.h" |
|
20 /** |
|
21 Default constructor, set the timer to standard priority by default |
|
22 add timer to active scheduler |
|
23 |
|
24 @internalTechnology |
|
25 @released |
|
26 */ |
|
27 CShutdownTimer::CShutdownTimer() : CTimer(CActive::EPriorityStandard) |
|
28 { |
|
29 CActiveScheduler::Add(this); |
|
30 } |
|
31 |
|
32 /** |
|
33 Default destructor, cancel any outstanding request of timer active object |
|
34 |
|
35 @internalTechnology |
|
36 @released |
|
37 */ |
|
38 CShutdownTimer::~CShutdownTimer() |
|
39 { |
|
40 LBSLOG(ELogP1,"CShutdownTimer::~CShutdownTimer"); |
|
41 Cancel(); |
|
42 } |
|
43 |
|
44 /** |
|
45 Call CTimer base class to construct the shut down timer |
|
46 |
|
47 @internalTechnology |
|
48 @released |
|
49 */ |
|
50 void CShutdownTimer::ConstructL() |
|
51 { |
|
52 // call the base class version |
|
53 CTimer::ConstructL(); |
|
54 } |
|
55 |
|
56 /** |
|
57 start the timer by specifying the shut down delay to issue a time request |
|
58 |
|
59 @param aDelay Time interval in micro seconds |
|
60 @internalTechnology |
|
61 @released |
|
62 */ |
|
63 void CShutdownTimer::Start(const TTimeIntervalMicroSeconds32 aDelay) |
|
64 { |
|
65 LBSLOG(ELogP1,"->CShutdownTimer::Start"); |
|
66 After(aDelay); |
|
67 LBSLOG(ELogP1,"<-CShutdownTimer::Start"); |
|
68 } |
|
69 |
|
70 /** |
|
71 stop the timer by cancelling outstanding time request |
|
72 |
|
73 @internalTechnology |
|
74 @released |
|
75 */ |
|
76 void CShutdownTimer::Stop() |
|
77 { |
|
78 LBSLOG(ELogP1,"->CShutdownTimer::Stop"); |
|
79 Cancel(); |
|
80 LBSLOG(ELogP1,"<-CShutdownTimer::Stop"); |
|
81 } |
|
82 |
|
83 /** |
|
84 inherited from CActive. Main message loop to deal with dispatched request |
|
85 stop the active scheduler whenever a request is received. |
|
86 this stops the AS that owns the CPolicyServer AO. So it stops the server. |
|
87 |
|
88 @internalTechnology |
|
89 @released |
|
90 */ |
|
91 void CShutdownTimer::RunL() |
|
92 { |
|
93 LBSLOG(ELogP1,"->CShutdownTimer::RunL"); |
|
94 CActiveScheduler::Stop(); |
|
95 LBSLOG(ELogP1,"<-CShutdownTimer::Stop"); |
|
96 |
|
97 } |