57 // Symbian 2nd phase constructor can leave. |
49 // Symbian 2nd phase constructor can leave. |
58 // ----------------------------------------------------------------------------- |
50 // ----------------------------------------------------------------------------- |
59 // |
51 // |
60 void CDialogWrapper::ConstructL() |
52 void CDialogWrapper::ConstructL() |
61 { |
53 { |
62 iIsProgressDialog = EFalse; |
54 // Get resource file path |
63 iHbProgressDialog = NULL; |
55 TFileName fileName; |
64 iIsUninstallerProgressDialog = EFalse; |
56 fileName.Copy( TParsePtrC( RProcess().FileName() ).Drive() ); |
65 iHbProgressDialogForUninstaller = NULL; |
57 fileName.Append( KDC_RESOURCE_FILES_DIR ); |
66 iIsIndicator = EFalse; |
58 fileName.Append( KDaemonResourceFile ); |
67 iHbIndicator = NULL; |
59 |
|
60 // Get language of resource file |
|
61 BaflUtils::NearestLanguageFile( iFs, fileName ); |
|
62 |
|
63 // Open resource file |
|
64 iResourceFile.OpenL( iFs, fileName ); |
|
65 iResourceFile.ConfirmSignatureL(); |
|
66 |
68 // By default Daemon will show all notes. |
67 // By default Daemon will show all notes. |
69 iDisableAllNotes = EFalse; |
68 iDisableAllNotes = EFalse; |
70 iTimeOffDisableProgress = EFalse; |
|
71 // Create watcher AO for PS Key. |
69 // Create watcher AO for PS Key. |
72 iWatcher = CDialogWatcher::NewL( this ); |
70 iWatcher = CDialogWatcher::NewL( this ); |
73 // Get current PS Key |
71 // Get current PS Key |
74 TInt err = iWatcher->GetPSKeyForUI( iDisableAllNotes ); |
72 TInt err = iWatcher->GetPSKeyForUI( iDisableAllNotes ); |
75 if ( err ) |
73 if ( err ) |
76 { |
74 { |
77 // If we can not get PS key, let's disable all notes. |
75 // If we can not get PS key, let's disable all notes. |
78 iDisableAllNotes = ETrue; |
76 iDisableAllNotes = ETrue; |
79 } |
77 } |
80 // Start AO |
78 // Start AO |
81 iWatcher->StartWatcher(); |
79 iWatcher->StartWatcher(); |
82 // Create dialog timer for progress dialog. |
|
83 iTimer = CDialogTimer::NewL( this ); |
|
84 } |
80 } |
85 |
81 |
86 // ----------------------------------------------------------------------------- |
82 // ----------------------------------------------------------------------------- |
87 // CDialogWrapper::NewL |
83 // CDialogWrapper::NewL |
88 // Two-phased constructor. |
84 // Two-phased constructor. |
94 CleanupStack::PushL( self ); |
90 CleanupStack::PushL( self ); |
95 self->ConstructL(); |
91 self->ConstructL(); |
96 CleanupStack::Pop( self ); |
92 CleanupStack::Pop( self ); |
97 return self; |
93 return self; |
98 } |
94 } |
99 |
95 |
100 // ----------------------------------------------------------------------------- |
|
101 // CDialogWrapper::~CDialogWrapper |
|
102 // Destructor |
96 // Destructor |
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 CDialogWrapper::~CDialogWrapper() |
97 CDialogWrapper::~CDialogWrapper() |
106 { |
98 { |
107 FLOG( _L("Daemon: CDialogWrapper::~CDialogWrapper") ); |
99 iResourceFile.Close(); |
108 delete iTimer; |
|
109 |
|
110 // If installer's RunL leaves make sure that dialogs are closed. |
|
111 if ( iIsProgressDialog && iHbProgressDialog ) |
|
112 { |
|
113 iHbProgressDialog->Close(); |
|
114 } |
|
115 delete iHbProgressDialog; |
|
116 |
|
117 // If uninstaller's RunL leaves make sure that dialogs are closed. |
|
118 if ( iIsUninstallerProgressDialog && iHbProgressDialogForUninstaller ) |
|
119 { |
|
120 iHbProgressDialogForUninstaller->Close(); |
|
121 } |
|
122 delete iHbProgressDialogForUninstaller; |
|
123 |
|
124 if ( iIsIndicator && iHbIndicator ) |
|
125 { |
|
126 iHbIndicator->Deactivate( KIndicatorTypeSWIDaemon ); |
|
127 } |
|
128 delete iHbIndicator; |
|
129 |
|
130 if ( iWatcher ) |
100 if ( iWatcher ) |
131 { |
101 { |
132 iWatcher->StopWatcher(); |
102 iWatcher->StopWatcher(); |
133 } |
103 delete iWatcher; |
134 delete iWatcher; |
104 } |
135 } |
105 } |
136 |
106 |
137 // ----------------------------------------------------------------------------- |
107 // ----------------------------------------------------------------------------- |
138 // CDialogWrapper::ShowUntrustedResultL |
108 // CDialogWrapper::ShowUntrustedResultL |
139 // Show global result dialog. |
109 // Show global result dialog. |
140 // (other items were commented in a header). |
110 // (other items were commented in a header). |
141 // ----------------------------------------------------------------------------- |
111 // ----------------------------------------------------------------------------- |
142 // |
112 // |
143 void CDialogWrapper::ShowUntrustedResultL() |
113 void CDialogWrapper::ShowUntrustedResultL() |
144 { |
114 { |
145 FLOG( _L("Daemon: CDialogWrapper::ShowUntrustedResultL") ); |
|
146 |
|
147 #ifdef _SWIDAEMON_DISABLE_NOTES_ |
|
148 FLOG( _L("Daemon: CDialogWrapper: iDisableAllNotes = ETrue") ); |
|
149 iDisableAllNotes = ETrue; |
|
150 #endif |
|
151 |
|
152 // Let watcher to know that waiting note is canceled. |
115 // Let watcher to know that waiting note is canceled. |
153 iWatcher->CancelNoteRequest(); |
116 iWatcher->CancelNoteRequest(); |
154 |
117 |
155 // Inform watcher that we have request to show note. |
118 if ( iDisableAllNotes == EFalse ) |
156 iWatcher->CancelNoteRequest(); |
|
157 |
|
158 if ( !iDisableAllNotes ) |
|
159 { |
119 { |
160 CHbDeviceNotificationDialogSymbian* notificationDialog = |
120 HBufC* string = ReadResourceLC( R_DAEMON_UNTRUSTED_FOUND ); |
161 CHbDeviceNotificationDialogSymbian::NewL( NULL ); |
121 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
162 |
122 note->ShowNoteL( EAknGlobalInformationNote, *string ); |
163 CleanupStack::PushL( notificationDialog ); |
123 CleanupStack::PopAndDestroy( 2, string ); |
164 |
124 } |
165 //TODO get string from log file. |
|
166 _LIT( KTempIconText,"note_info"); |
|
167 _LIT( KTempTextTitle,"SW Silent Installer" ); |
|
168 _LIT( KTempTextForErrorMessage,"Untrusted software was found." ); |
|
169 |
|
170 notificationDialog->NotificationL( KTempIconText, |
|
171 KTempTextTitle , |
|
172 KTempTextForErrorMessage ); |
|
173 |
|
174 CleanupStack::PopAndDestroy( notificationDialog ); |
|
175 } |
|
176 } |
125 } |
177 |
126 |
178 // ----------------------------------------------------------------------------- |
127 // ----------------------------------------------------------------------------- |
179 // CDialogWrapper::ShowErrorResultL |
128 // CDialogWrapper::ShowErrorResultL |
180 // Show global result dialog. |
129 // Show global result dialog. |
181 // (other items were commented in a header). |
130 // (other items were commented in a header). |
182 // ----------------------------------------------------------------------------- |
131 // ----------------------------------------------------------------------------- |
183 // |
132 // |
184 void CDialogWrapper::ShowErrorResultL() |
133 void CDialogWrapper::ShowErrorResultL() |
185 { |
134 { |
186 FLOG( _L("Daemon: CDialogWrapper::ShowErrorResultL") ); |
135 // Let watcher to know that waiting note is canceled. |
187 |
|
188 #ifdef _SWIDAEMON_DISABLE_NOTES_ |
|
189 FLOG( _L("Daemon: CDialogWrapper: iDisableAllNotes = ETrue") ); |
|
190 iDisableAllNotes = ETrue; |
|
191 #endif |
|
192 |
|
193 // Inform watcher that we have request to show note. |
|
194 iWatcher->CancelNoteRequest(); |
136 iWatcher->CancelNoteRequest(); |
195 |
137 |
196 if ( !iDisableAllNotes ) |
138 if ( iDisableAllNotes == EFalse ) |
197 { |
139 { |
198 CHbDeviceNotificationDialogSymbian* notificationDialog = |
140 HBufC* string = ReadResourceLC( R_DAEMON_INSTALLATION_ERROR ); |
199 CHbDeviceNotificationDialogSymbian::NewL( NULL ); |
141 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
200 |
142 note->ShowNoteL( EAknGlobalInformationNote, *string ); |
201 CleanupStack::PushL( notificationDialog ); |
143 CleanupStack::PopAndDestroy( 2, string ); |
202 |
|
203 //TODO get string from log file. |
|
204 _LIT( KTempIconText,"note_info"); |
|
205 _LIT( KTempTextTitle,"SW Silent Installer" ); |
|
206 _LIT( KTempTextForErrorMessage,"Installation was not completed." ); |
|
207 |
|
208 notificationDialog->NotificationL( KTempIconText, |
|
209 KTempTextTitle , |
|
210 KTempTextForErrorMessage ); |
|
211 |
|
212 CleanupStack::PopAndDestroy( notificationDialog ); |
|
213 } |
144 } |
214 } |
145 } |
215 |
146 |
216 // ----------------------------------------------------------------------------- |
147 // ----------------------------------------------------------------------------- |
217 // CDialogWrapper::ShowWaitingNoteL |
148 // CDialogWrapper::ShowWaitingNoteL |
219 // (other items were commented in a header). |
150 // (other items were commented in a header). |
220 // ----------------------------------------------------------------------------- |
151 // ----------------------------------------------------------------------------- |
221 // |
152 // |
222 void CDialogWrapper::ShowWaitingNoteL() |
153 void CDialogWrapper::ShowWaitingNoteL() |
223 { |
154 { |
224 FLOG( _L("Daemon: CDialogWrapper::ShowWaitingNoteL") ); |
155 if ( iDisableAllNotes == EFalse ) |
225 |
156 { |
226 #ifdef _SWIDAEMON_DISABLE_NOTES_ |
157 if ( iNoteId == 0 ) |
227 FLOG( _L("Daemon: CDialogWrapper: iDisableAllNotes = ETrue") ); |
158 { |
228 iDisableAllNotes = ETrue; |
159 HBufC* string = ReadResourceLC( R_DAEMON_INSTALLING ); |
229 #endif |
160 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
230 |
161 note->SetSoftkeys( R_AVKON_SOFTKEYS_EMPTY ); |
231 FLOG_1( _L("Daemon: iDisableAllNotes: %d"), iDisableAllNotes ); |
162 iNoteId = note->ShowNoteL( EAknGlobalWaitNote, *string ); |
232 FLOG_1( _L("Daemon: iIsProgressDialog: %d"), iIsProgressDialog ); |
163 CleanupStack::PopAndDestroy( 2, string ); |
233 FLOG_1( _L("Daemon: iTimeOffDisableProgress: %d"), iTimeOffDisableProgress ); |
|
234 |
|
235 if ( !iDisableAllNotes ) |
|
236 { |
|
237 if ( !iIsProgressDialog && !iTimeOffDisableProgress ) |
|
238 { |
|
239 iHbProgressDialog = CHbDeviceProgressDialogSymbian::NewL( |
|
240 CHbDeviceProgressDialogSymbian::EWaitDialog, |
|
241 NULL ); |
|
242 iIsProgressDialog = ETrue; |
|
243 |
|
244 _LIT( KTempTextForProgressDialog,"Installing" ); |
|
245 |
|
246 iHbProgressDialog->SetTextL( KTempTextForProgressDialog ); |
|
247 FLOG( _L("Daemon: ShowWaitingNoteL: ShowL") ); |
|
248 iHbProgressDialog->ShowL(); |
|
249 FLOG( _L("Daemon: ShowWaitingNoteL: StartDialogTimer") ); |
|
250 iTimer->StartDialogTimer( KDialogTimeOut ); |
|
251 } |
164 } |
252 } |
165 } |
253 else if ( iDisableAllNotes ) |
166 else if ( iDisableAllNotes ) |
254 { |
167 { |
255 // Let watcher to know that waiting note should be shown |
168 // Let watcher to know that waiting note should be shown |
262 // CDialogWrapper::CancelWaitingNoteL |
175 // CDialogWrapper::CancelWaitingNoteL |
263 // Cancel global waiting note after installing. |
176 // Cancel global waiting note after installing. |
264 // (other items were commented in a header). |
177 // (other items were commented in a header). |
265 // ----------------------------------------------------------------------------- |
178 // ----------------------------------------------------------------------------- |
266 // |
179 // |
267 void CDialogWrapper::CancelWaitingNote() |
180 void CDialogWrapper::CancelWaitingNoteL() |
268 { |
181 { |
269 FLOG( _L("Daemon: CDialogWrapper::CancelWaitingNoteL") ); |
182 if ( iNoteId ) |
270 |
|
271 if ( iIsProgressDialog ) |
|
272 { |
183 { |
273 iHbProgressDialog->Close(); |
184 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
274 delete iHbProgressDialog; |
185 note->CancelNoteL( iNoteId ); |
275 //Make sure not to delete twice in destructor. |
186 iNoteId = 0; |
276 iHbProgressDialog = NULL; |
187 CleanupStack::PopAndDestroy(); |
277 iIsProgressDialog = EFalse; |
|
278 |
|
279 iTimeOffDisableProgress = ETrue; |
|
280 } |
188 } |
281 |
|
282 // Let watcher to know that waiting note is canceled. |
189 // Let watcher to know that waiting note is canceled. |
283 iWatcher->CancelNoteRequest(); |
190 iWatcher->CancelNoteRequest(); |
284 } |
191 } |
285 |
192 // CDialogWrapper::LoadResourceLC |
286 // ----------------------------------------------------------------------------- |
|
287 // CDialogWrapper::LoadResourceLC |
|
288 // Read resource string. |
193 // Read resource string. |
289 // (other items were commented in a header). |
194 // (other items were commented in a header). |
290 // ----------------------------------------------------------------------------- |
195 // ----------------------------------------------------------------------------- |
291 // |
196 // |
292 HBufC* CDialogWrapper::ReadResourceLC( TInt /*aResourceId*/ ) |
197 HBufC* CDialogWrapper::ReadResourceLC( TInt aResourceId ) |
293 { |
198 { |
294 //TODO: All resoureces nees to be rewriten for device dialogs (QT) |
199 TResourceReader reader; |
295 return NULL; |
200 HBufC8* buff = iResourceFile.AllocReadLC( aResourceId ); |
|
201 reader.SetBuffer( buff ); |
|
202 HBufC* text = reader.ReadHBufCL(); |
|
203 CleanupStack::PopAndDestroy( buff ); |
|
204 CleanupStack::PushL( text ); |
|
205 return text; |
296 } |
206 } |
297 |
207 |
298 // ----------------------------------------------------------------------------- |
208 // ----------------------------------------------------------------------------- |
299 // CDialogWrapper::SetUIFlag |
209 // CDialogWrapper::SetUIFlag |
300 // Sets UI flag for dialog wrapper. If flag is ture, dialogs are disabled. |
210 // Sets UI flag for dialog wrapper. If flag is ture, dialogs are disabled. |
310 // Show global waiting note during uninstall. |
220 // Show global waiting note during uninstall. |
311 // ----------------------------------------------------------------------------- |
221 // ----------------------------------------------------------------------------- |
312 // |
222 // |
313 void CDialogWrapper::ShowWaitingNoteForUninstallerL() |
223 void CDialogWrapper::ShowWaitingNoteForUninstallerL() |
314 { |
224 { |
315 FLOG( _L("Daemon: CDialogWrapper::ShowWaitingNoteForUninstallerL") ); |
225 if ( iDisableAllNotes == EFalse ) |
316 |
226 { |
317 #ifdef _SWIDAEMON_DISABLE_NOTES_ |
227 if ( iNoteId == 0 ) |
318 FLOG( _L("Daemon: CDialogWrapper: iDisableAllNotes = ETrue") ); |
228 { |
319 iDisableAllNotes = ETrue; |
229 HBufC* string = ReadResourceLC( R_UNINSTALLER_INSTALL ); |
320 #endif |
230 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
321 |
231 note->SetSoftkeys( R_AVKON_SOFTKEYS_EMPTY ); |
322 FLOG_1( _L("Daemon: iDisableAllNotes: %d"), iDisableAllNotes ); |
232 iNoteId = note->ShowNoteL( EAknGlobalWaitNote, *string ); |
323 FLOG_1( _L("Daemon: iIsProgressDialog: %d"), iIsProgressDialog ); |
233 CleanupStack::PopAndDestroy( 2, string ); |
324 FLOG_1( _L("Daemon: iTimeOffDisableProgress: %d"), iTimeOffDisableProgress ); |
|
325 |
|
326 if ( !iDisableAllNotes ) |
|
327 { |
|
328 if ( !iIsUninstallerProgressDialog && !iTimeOffDisableProgress ) |
|
329 { |
|
330 iHbProgressDialogForUninstaller = |
|
331 CHbDeviceProgressDialogSymbian::NewL( |
|
332 CHbDeviceProgressDialogSymbian::EWaitDialog, |
|
333 NULL ); |
|
334 iIsUninstallerProgressDialog = ETrue; |
|
335 //TODO get string from log file. |
|
336 _LIT( KTempTextForProgressDialog,"Uninstalling" ); |
|
337 iHbProgressDialogForUninstaller->SetTextL( KTempTextForProgressDialog ); |
|
338 FLOG( _L("Daemon: ShowWaitingNoteForUninstallerL: ShowL") ); |
|
339 iHbProgressDialogForUninstaller->ShowL(); |
|
340 FLOG( _L("Daemon: ShowWaitingNoteForUninstallerL: StartDialogTimer") ); |
|
341 iTimer->StartDialogTimer( KDialogTimeOut ); |
|
342 } |
234 } |
343 } |
235 } |
344 else if ( iDisableAllNotes ) |
236 else if ( iDisableAllNotes ) |
345 { |
237 { |
346 // Let watcher to know that waiting note should be shown |
238 // Let watcher to know that waiting note should be shown |
347 // after dialogs are enabled. |
239 // after dialogs are enabled. |
348 iWatcher->RequestToDisplayNote(); |
240 iWatcher->RequestToDisplayNote(); |
349 } |
241 } |
350 } |
242 } |
351 |
|
352 // ----------------------------------------------------------------------------- |
|
353 // CDialogWrapper::CancelWaitingNoteL |
|
354 // Cancel global waiting note after installing. |
|
355 // (other items were commented in a header). |
|
356 // ----------------------------------------------------------------------------- |
|
357 // |
|
358 void CDialogWrapper::CancelWaitingNoteForUninstaller() |
|
359 { |
|
360 FLOG( _L("Daemon: CDialogWrapper::CancelWaitingNoteForUninstallerL") ); |
|
361 |
|
362 if ( iIsUninstallerProgressDialog ) |
|
363 { |
|
364 iHbProgressDialogForUninstaller->Close(); |
|
365 delete iHbProgressDialogForUninstaller; |
|
366 //Make sure not to delete twice in destructor. |
|
367 iHbProgressDialogForUninstaller = NULL; |
|
368 iIsUninstallerProgressDialog = EFalse; |
|
369 |
|
370 iTimeOffDisableProgress = ETrue; |
|
371 } |
|
372 |
|
373 // Let watcher to know that waiting note is canceled. |
|
374 iWatcher->CancelNoteRequest(); |
|
375 } |
|
376 |
|
377 // ----------------------------------------------------------------------------- |
|
378 // CDialogWrapper::ActivateIndicatorL() |
|
379 // |
|
380 // ----------------------------------------------------------------------------- |
|
381 // |
|
382 void CDialogWrapper::ActivateIndicatorL( TReal aProcessValue ) |
|
383 { |
|
384 FLOG( _L("Daemon: CDialogWrapper::ActivateIndicatorL") ); |
|
385 |
|
386 if ( !iIsIndicator ) |
|
387 { |
|
388 FLOG( _L("Daemon: CHbIndicatorSymbian::NewL") ); |
|
389 iHbIndicator = CHbIndicatorSymbian::NewL(); |
|
390 iIsIndicator = ETrue; |
|
391 } |
|
392 |
|
393 TInt value = static_cast<TInt>( aProcessValue ); |
|
394 FLOG_1( _L("Daemon: ActivateIndicatorL: precent value: %d"), value ); |
|
395 |
|
396 CHbSymbianVariant* hbParam = CHbSymbianVariant::NewL( |
|
397 &value, |
|
398 CHbSymbianVariant::EInt ); |
|
399 CleanupStack::PushL( hbParam ); |
|
400 |
|
401 FLOG( _L("Daemon: ActivateIndicatorL: Activate") ); |
|
402 iHbIndicator->Activate( KIndicatorTypeSWIDaemon, hbParam ); |
|
403 |
|
404 CleanupStack::PopAndDestroy( hbParam ); |
|
405 } |
|
406 |
|
407 // ----------------------------------------------------------------------------- |
|
408 // CDialogWrapper::SetModeToIndicatorL() |
|
409 // |
|
410 // ----------------------------------------------------------------------------- |
|
411 // |
|
412 void CDialogWrapper::SetModeToIndicatorL( TInt aMode ) |
|
413 { |
|
414 FLOG_1( _L("Daemon: CDialogWrapper::SetModeToIndicatorL: aMode: %d"), |
|
415 aMode ); |
|
416 |
|
417 if ( !iIsIndicator ) |
|
418 { |
|
419 FLOG( _L("Daemon: CHbIndicatorSymbian::NewL") ); |
|
420 iHbIndicator = CHbIndicatorSymbian::NewL(); |
|
421 iIsIndicator = ETrue; |
|
422 } |
|
423 // Set mode. |
|
424 TReal mode = aMode; |
|
425 CHbSymbianVariant* hbParam = CHbSymbianVariant::NewL( |
|
426 &mode, |
|
427 CHbSymbianVariant::EReal ); |
|
428 CleanupStack::PushL( hbParam ); |
|
429 FLOG( _L("Daemon: SetModeToIndicatorL: Activate") ); |
|
430 iHbIndicator->Activate( KIndicatorTypeSWIDaemon, hbParam ); |
|
431 |
|
432 CleanupStack::PopAndDestroy( hbParam ); |
|
433 } |
|
434 |
|
435 |
|
436 // ----------------------------------------------------------------------------- |
|
437 // CDialogWrapper::CancelIndicatorL |
|
438 // |
|
439 // ----------------------------------------------------------------------------- |
|
440 // |
|
441 void CDialogWrapper::CancelIndicatorL() |
|
442 { |
|
443 FLOG( _L("Daemon: CDialogWrapper::CancelIndicatorL") ); |
|
444 |
|
445 if ( iIsIndicator ) |
|
446 { |
|
447 FLOG( _L("Daemon: CancelIndicatorL: Deactivate") ); |
|
448 iHbIndicator->Deactivate( KIndicatorTypeSWIDaemon ); |
|
449 delete iHbIndicator; |
|
450 iHbIndicator = NULL; //Make sure not to delete twice in destructor. |
|
451 iIsIndicator = EFalse; |
|
452 } |
|
453 } |
|
454 |
|
455 // ----------------------------------------------------------------------------- |
|
456 // CDialogWrapper::CheckSystemState() |
|
457 // |
|
458 // ----------------------------------------------------------------------------- |
|
459 // |
|
460 /* |
|
461 void CDialogWrapper::CheckSystemState() |
|
462 { |
|
463 FLOG( _L("Daemon: CDialogWrapper::CheckSystemState TEST") ); |
|
464 |
|
465 // We need to check this only if system is not ready to show |
|
466 // dialogs e.g. UI is not up. |
|
467 if ( !iSystemReadyToShowDialogs ) |
|
468 { |
|
469 RSsmStateAwareSession systemStateSession; |
|
470 |
|
471 TInt err = systemStateSession.Connect( KUIFrameworkDomain3 ); |
|
472 FLOG_1( _L("Daemon: systemStateSession.Connect err = %d"), err ); |
|
473 |
|
474 if ( err == KErrNone ) |
|
475 { |
|
476 TSsmState currentState = systemStateSession.State(); |
|
477 systemStateSession.Close(); |
|
478 |
|
479 FLOG_1( _L("Daemon: System main state = %d"), currentState.MainState() ); |
|
480 FLOG_1( _L("Daemon: System sub state = %d"), currentState.SubState() ); |
|
481 |
|
482 |
|
483 if ( currentState.MainState() == ESsmNormal ) |
|
484 { |
|
485 iSystemReadyToShowDialogs = ETrue; |
|
486 } |
|
487 else |
|
488 { |
|
489 iSystemReadyToShowDialogs = EFalse; |
|
490 } |
|
491 } |
|
492 else |
|
493 { |
|
494 iSystemReadyToShowDialogs = EFalse; |
|
495 } |
|
496 } |
|
497 FLOG_1( _L("Daemon: iSystemReadyToShowDialogs = %d"), |
|
498 iSystemReadyToShowDialogs ); |
|
499 } |
|
500 */ |
|
501 |
|
502 //------------------------------------------------------------------------------- |
|
503 |
|
504 // ----------------------------------------------------------------------------- |
|
505 // CDialogTimer::CDialogTimer() |
|
506 // |
|
507 // ----------------------------------------------------------------------------- |
|
508 // |
|
509 CDialogTimer::CDialogTimer() : CActive( EPriorityNormal ) |
|
510 { |
|
511 } |
|
512 |
|
513 // ----------------------------------------------------------------------------- |
|
514 // CDialogTimer::~CDialogTimer() |
|
515 // |
|
516 // ----------------------------------------------------------------------------- |
|
517 // |
|
518 CDialogTimer::~CDialogTimer() |
|
519 { |
|
520 FLOG( _L("Daemon: CDialogTimer::~CDialogTimer") ); |
|
521 // Cancel the outstanding request. Calls the active object’s |
|
522 // DoCancel function if request is outstanding. |
|
523 Cancel(); |
|
524 // Delete RTimer |
|
525 iRTimer.Close(); |
|
526 } |
|
527 |
|
528 // ----------------------------------------------------------------------------- |
|
529 // CDialogTimer::NewL() |
|
530 // |
|
531 // ----------------------------------------------------------------------------- |
|
532 // |
|
533 CDialogTimer* CDialogTimer::NewL( CDialogWrapper* aDialog ) |
|
534 { |
|
535 CDialogTimer* activeTimer = new (ELeave) CDialogTimer(); |
|
536 CleanupStack::PushL( activeTimer ); |
|
537 activeTimer->ConstructL( aDialog ); |
|
538 CleanupStack::Pop(); |
|
539 return activeTimer; |
|
540 } |
|
541 |
|
542 // ----------------------------------------------------------------------------- |
|
543 // CDialogTimer::ConstructL() |
|
544 // |
|
545 // ----------------------------------------------------------------------------- |
|
546 // |
|
547 void CDialogTimer::ConstructL( CDialogWrapper* aDialog ) |
|
548 { |
|
549 if ( aDialog == NULL ) |
|
550 { |
|
551 User::Leave( KErrArgument ); |
|
552 } |
|
553 iDialog = aDialog; |
|
554 CActiveScheduler::Add( this ); |
|
555 iRTimer.CreateLocal(); |
|
556 } |
|
557 |
|
558 // ----------------------------------------------------------------------------- |
|
559 // CDialogTimer::StartDialogTimer() |
|
560 // |
|
561 // ----------------------------------------------------------------------------- |
|
562 // |
|
563 void CDialogTimer::StartDialogTimer( TUint32 aRefreshTime ) |
|
564 { |
|
565 FLOG( _L("Daemon: CDialogTimer::StartDialogTimer") ); |
|
566 // Check first that we do not have request outstanding. |
|
567 if ( !IsActive() ) |
|
568 { |
|
569 // Set time interval for dialog. |
|
570 TimerSet( aRefreshTime ); |
|
571 } |
|
572 } |
|
573 |
|
574 // ----------------------------------------------------------------------------- |
|
575 // CDialogTimer::TimerSet() |
|
576 // |
|
577 // ----------------------------------------------------------------------------- |
|
578 // |
|
579 void CDialogTimer::TimerSet( TUint32 aRefreshTime ) |
|
580 { |
|
581 FLOG_1( _L("Daemon: CDialogTimer::TimerSet time: %d"), aRefreshTime ); |
|
582 // Set timer interval. |
|
583 iRTimer.After( iStatus, aRefreshTime ); |
|
584 // Set active. Start wait for timer. |
|
585 SetActive(); |
|
586 } |
|
587 |
|
588 // ----------------------------------------------------------------------------- |
|
589 // CDialogTimer::RunL() |
|
590 // |
|
591 // ----------------------------------------------------------------------------- |
|
592 // |
|
593 void CDialogTimer::RunL() |
|
594 { |
|
595 FLOG( _L("Daemon: CDialogTimer::RunL: Cancel waiting note") ); |
|
596 iDialog->CancelWaitingNote(); |
|
597 iDialog->CancelWaitingNoteForUninstaller(); |
|
598 } |
|
599 |
|
600 // ----------------------------------------------------------------------------- |
|
601 // CDialogTimer::DoCancel() |
|
602 // |
|
603 // ----------------------------------------------------------------------------- |
|
604 // |
|
605 void CDialogTimer::DoCancel() |
|
606 { |
|
607 // Cancel outstanding request for a timer event. |
|
608 iRTimer.Cancel(); |
|
609 } |
|
610 |
|
611 // ----------------------------------------------------------------------------- |
|
612 // CDialogTimer::RunError() |
|
613 // |
|
614 // ----------------------------------------------------------------------------- |
|
615 // |
|
616 TInt CDialogTimer::RunError( TInt aError ) |
|
617 { |
|
618 return aError; |
|
619 } |
|
620 |
|
621 |
|
622 // End of File |
243 // End of File |