56
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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 |
* CMsgErrorStartupObserver implementation file
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
// INCLUDE FILES
|
|
22 |
#include <e32base.h>
|
|
23 |
|
|
24 |
#include <startupdomainpskeys.h>
|
|
25 |
|
|
26 |
#include "msgerrorwatcher_p.h"
|
|
27 |
#include "msgerrorstartupobserver.h"
|
|
28 |
#include "debugtraces.h"
|
|
29 |
|
|
30 |
|
|
31 |
// CONSTANTS
|
|
32 |
|
|
33 |
// ================= MEMBER FUNCTIONS =======================
|
|
34 |
|
|
35 |
// ---------------------------------------------------------
|
|
36 |
// CMsgErrorStartupObserver::CMsgErrorStartupObserver
|
|
37 |
//
|
|
38 |
// C++ constructor can NOT contain any code, that
|
|
39 |
// might leave.
|
|
40 |
// ---------------------------------------------------------
|
|
41 |
//
|
|
42 |
CMsgErrorStartupObserver::CMsgErrorStartupObserver( CMsgErrorWatcherPrivate& aWatcher )
|
|
43 |
: CActive( CActive::EPriorityStandard ),
|
|
44 |
iWatcher( aWatcher )
|
|
45 |
{
|
|
46 |
QDEBUG_WRITE("CMsgErrorStartupObserver:CMsgErrorStartupObserver : Enter");
|
|
47 |
CActiveScheduler::Add( this );
|
|
48 |
QDEBUG_WRITE("CMsgErrorStartupObserver:CMsgErrorStartupObserver : Exit");
|
|
49 |
}
|
|
50 |
|
|
51 |
// ---------------------------------------------------------
|
|
52 |
// CMsgErrorStartupObserver::ConstructL()
|
|
53 |
//
|
|
54 |
// Symbian OS default constructor can leave.
|
|
55 |
// ---------------------------------------------------------
|
|
56 |
//
|
|
57 |
void CMsgErrorStartupObserver::ConstructL()
|
|
58 |
{
|
|
59 |
QDEBUG_WRITE("CMsgErrorStartupObserver:ConstructL : Enter");
|
|
60 |
User::LeaveIfError( iStartupProperty.Attach( KPSUidStartup, KPSGlobalSystemState ) );
|
|
61 |
// Complete self
|
|
62 |
iStatus = KRequestPending;
|
|
63 |
TRequestStatus* pStatus = &iStatus;
|
|
64 |
SetActive();
|
|
65 |
User::RequestComplete( pStatus, KErrNone );
|
|
66 |
QDEBUG_WRITE("CMsgErrorStartupObserver:ConstructL : Exit");
|
|
67 |
}
|
|
68 |
|
|
69 |
// ---------------------------------------------------------
|
|
70 |
// CMsgErrorStartupObserver::NewL
|
|
71 |
//
|
|
72 |
// Two-phased constructor.
|
|
73 |
// ---------------------------------------------------------
|
|
74 |
//
|
|
75 |
CMsgErrorStartupObserver* CMsgErrorStartupObserver::NewL( CMsgErrorWatcherPrivate& aWatcher )
|
|
76 |
{
|
|
77 |
QDEBUG_WRITE("CMsgErrorStartupObserver:NewL : Enter");
|
|
78 |
CMsgErrorStartupObserver* self = new ( ELeave )
|
|
79 |
CMsgErrorStartupObserver( aWatcher );
|
|
80 |
|
|
81 |
CleanupStack::PushL( self );
|
|
82 |
self->ConstructL();
|
|
83 |
CleanupStack::Pop( self );
|
|
84 |
QDEBUG_WRITE("CMsgErrorStartupObserver:NewL : Exit");
|
|
85 |
return self;
|
|
86 |
}
|
|
87 |
|
|
88 |
// ---------------------------------------------------------
|
|
89 |
// CMsgErrorStartupObserver::~CMsgErrorStartupObserver
|
|
90 |
//
|
|
91 |
// Destructor
|
|
92 |
// ---------------------------------------------------------
|
|
93 |
//
|
|
94 |
CMsgErrorStartupObserver::~CMsgErrorStartupObserver()
|
|
95 |
{
|
|
96 |
QDEBUG_WRITE("CMsgErrorStartupObserver:~CMsgErrorStartupObserver : Enter");
|
|
97 |
Cancel();
|
|
98 |
iStartupProperty.Close();
|
|
99 |
QDEBUG_WRITE("CMsgErrorStartupObserver:~CMsgErrorStartupObserver : Exit");
|
|
100 |
}
|
|
101 |
|
|
102 |
// ---------------------------------------------------------
|
|
103 |
// CMsgErrorStartupObserver::DoCancel
|
|
104 |
//
|
|
105 |
// From active object framework
|
|
106 |
// ---------------------------------------------------------
|
|
107 |
//
|
|
108 |
void CMsgErrorStartupObserver::DoCancel()
|
|
109 |
{
|
|
110 |
QDEBUG_WRITE("CMsgErrorStartupObserver:DoCancel : Enter");
|
|
111 |
iStartupProperty.Cancel();
|
|
112 |
QDEBUG_WRITE("CMsgErrorStartupObserver:DoCancel : Exit");
|
|
113 |
}
|
|
114 |
|
|
115 |
// ---------------------------------------------------------
|
|
116 |
// CMsgErrorStartupObserver::RunL
|
|
117 |
//
|
|
118 |
// From active object framework
|
|
119 |
// ---------------------------------------------------------
|
|
120 |
//
|
|
121 |
void CMsgErrorStartupObserver::RunL()
|
|
122 |
{
|
|
123 |
QDEBUG_WRITE("CMsgErrorStartupObserver:RunL : Enter");
|
|
124 |
TInt startupState = 0;
|
|
125 |
iStartupProperty.Get( startupState );
|
|
126 |
|
|
127 |
if ( startupState == ESwStateNormalRfOn ||
|
|
128 |
startupState == ESwStateNormalRfOff ||
|
|
129 |
startupState == ESwStateNormalBTSap )
|
|
130 |
{
|
|
131 |
TRAP_IGNORE( iWatcher.HandleStartupReadyL() );
|
|
132 |
}
|
|
133 |
else
|
|
134 |
{
|
|
135 |
iStatus = KRequestPending;
|
|
136 |
iStartupProperty.Subscribe( iStatus );
|
|
137 |
SetActive();
|
|
138 |
}
|
|
139 |
QDEBUG_WRITE("CMsgErrorStartupObserver:RunL : Exit");
|
|
140 |
}
|
|
141 |
|
|
142 |
// ================= OTHER EXPORTED FUNCTIONS ==============
|
|
143 |
|
|
144 |
// End of File
|