|
1 /* |
|
2 * Copyright (c) 2002-2008 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: AppUi class of the application. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // SYSTEM INCLUDES |
|
20 #include <StringLoader.h> |
|
21 #include <AknGlobalNote.h> //used for Selftest failed note |
|
22 #include <aknPopup.h> |
|
23 #include <aknlists.h> |
|
24 #include <aknSDData.h> |
|
25 #include <badesca.h> |
|
26 #include <tzlocalizationdatatypes.h> |
|
27 #include <tzlocalizer.h> |
|
28 #include <tz.h> |
|
29 #include <featmgr.h> // Feature Manager |
|
30 #include <centralrepository.h> |
|
31 #include <startup.rsg> |
|
32 #include <starterdomaincrkeys.h> |
|
33 #include "startupappprivatepskeys.h" |
|
34 #include <startupdomainpskeys.h> |
|
35 #include <startupdomaincrkeys.h> |
|
36 #include <CoreApplicationUIsSDKCRKeys.h> |
|
37 #include <starterclient.h> |
|
38 |
|
39 #ifdef RD_UI_TRANSITION_EFFECTS_PHASE2 |
|
40 // Transition effects |
|
41 #include <gfxtranseffect/gfxtranseffect.h> |
|
42 #include <akntranseffect.h> |
|
43 #endif |
|
44 |
|
45 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
46 #include "sanimstartupctrl.h" |
|
47 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
48 #include <akndef.h> // For layout change event definitions |
|
49 #include <AknSoundSystem.h> |
|
50 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
51 |
|
52 // USER INCLUDES |
|
53 #include "StartupAppUi.h" |
|
54 #include "StartupApplication.h" |
|
55 #include "StartupUserWelcomeNote.h" |
|
56 #include "StartupQueryDialog.h" //used for Startup own Time and Date queries |
|
57 #include "StartupPopupList.h" //used for Startup own City and Country queries |
|
58 #include "StartupMediatorObserver.h" |
|
59 #include "StartupPubSubObserver.h" |
|
60 |
|
61 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
62 #include "startupanimationwrapper.h" |
|
63 #include "startupview.h" |
|
64 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
65 #include "StartupDocument.h" |
|
66 #include "StartupOperatorAnimation.h" |
|
67 #include "StartupTone.h" |
|
68 #include "StartupWelcomeAnimation.h" |
|
69 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
70 |
|
71 |
|
72 // CONSTANTS |
|
73 const TInt KUserWelcomeNoteShowPeriodTime = 3000000; // 3 sec |
|
74 |
|
75 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
76 const TInt KOneMilliSecondInMicroSeconds = 1000; |
|
77 const TInt KMaxToneInitWait = 200; // 200 ms |
|
78 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
79 |
|
80 static const TInt KMaxCityLength(120); |
|
81 static const TInt KMaxCountryLength(120); |
|
82 |
|
83 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
84 static const CSAnimStartupCtrl::TAnimationParams KStartupAnimationParams = |
|
85 { |
|
86 KCRUidStartupConf, |
|
87 KStartupAnimationPath, |
|
88 KStartupAnimationFrameDelay, |
|
89 KStartupAnimationScaling, |
|
90 KStartupTonePath, |
|
91 KStartupToneVolume |
|
92 }; |
|
93 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
94 |
|
95 _LIT(KEmpty, " "); |
|
96 |
|
97 // Default date and time value is used if cenrep string is not valid |
|
98 // Default date is 01.01.2007 and default time is 09:00 AM |
|
99 _LIT( KDefaultDateTimeValue, "20070000:090000" ); // YYYYMMDD:HHMMSS |
|
100 |
|
101 static const TInt KTimeFormatLength(16); // "20070000:090000." |
|
102 |
|
103 _LIT_SECURITY_POLICY_C1(KReadDeviceDataPolicy, ECapabilityReadDeviceData); |
|
104 _LIT_SECURITY_POLICY_C1(KWriteDeviceDataPolicy, ECapabilityWriteDeviceData); |
|
105 _LIT_SECURITY_POLICY_PASS(KAlwaysPassPolicy); |
|
106 |
|
107 // ======== LOCAL FUNCTIONS ================================================== |
|
108 |
|
109 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
110 namespace |
|
111 { |
|
112 TInt AnimationFinishedFunc( TAny* aPtr ) |
|
113 { |
|
114 static_cast<CStartupAppUi*>( aPtr )->AnimationFinished(); |
|
115 return KErrNone; |
|
116 } |
|
117 } |
|
118 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
119 |
|
120 |
|
121 // ================= MEMBER FUNCTIONS ======================================== |
|
122 // |
|
123 // --------------------------------------------------------------------------- |
|
124 // CStartupAppUi::CStartupAppUi() |
|
125 // --------------------------------------------------------------------------- |
|
126 CStartupAppUi::CStartupAppUi() : |
|
127 iUserWelcomeNote( NULL ), |
|
128 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
129 iStartupTone( NULL ), |
|
130 iOpStartupTone( NULL ), |
|
131 iToneInitWaitTime( 0 ), |
|
132 iAnimation( EFalse ), |
|
133 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
134 iInternalState( EStartupStartingUp ), |
|
135 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
136 iSplashScreenShouldBeRemoved( EFalse ), |
|
137 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
138 iStartupFirstBootAndRTCCheckAlreadyCalled( EFalse ), |
|
139 iChargingOrAlarmBoot( EFalse ), |
|
140 iFirstBoot( ETrue ), |
|
141 iCleanBoot( EStartupNormalBoot ), |
|
142 iOfflineModeSupported( EFalse ), |
|
143 iOfflineModeQueryShown( EFalse ), |
|
144 iCriticalBlockEnded( EFalse ), |
|
145 iSwStateFatalStartupError( EFalse ), |
|
146 iStartupWaitingShowStartupAnimation( EFalse ), |
|
147 iSimSupported( ETrue ), |
|
148 iStartupMediatorObserver( NULL ), |
|
149 iCoverUISupported( EFalse ), |
|
150 iCounryListIndex( 0 ) |
|
151 , iTime( 0 ) |
|
152 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
153 , iTouchScreenCalibSupport( EFalse ) |
|
154 , iTouchScreenCalibrationDone( EFalse ) |
|
155 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
156 { |
|
157 TRACES("CStartupAppUi::CStartupAppUi"); |
|
158 } |
|
159 |
|
160 // --------------------------------------------------------------------------- |
|
161 // CStartupAppUi::ConstructL() |
|
162 // --------------------------------------------------------------------------- |
|
163 void CStartupAppUi::ConstructL() |
|
164 { |
|
165 TRACES("CStartupAppUi::ConstructL()"); |
|
166 TInt flags = EStandardApp|EAknEnableSkin|EAknEnableMSK ; |
|
167 |
|
168 BaseConstructL(flags); |
|
169 |
|
170 iAvkonAppUi->SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort | |
|
171 CAknAppUiBase::EDisableSendKeyLong ); |
|
172 |
|
173 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
174 iMainView = CStartupView::NewL( ApplicationRect() ); |
|
175 iAnimation = CStartupAnimationWrapper::NewL( *iMainView ); |
|
176 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
177 |
|
178 TInt err = RProperty::Define( KPSUidStartupApp, |
|
179 KPSStartupAppState, |
|
180 RProperty::EInt, |
|
181 KReadDeviceDataPolicy, |
|
182 KWriteDeviceDataPolicy ); |
|
183 |
|
184 if( KErrNone != err && |
|
185 KErrAlreadyExists != err ) |
|
186 { |
|
187 TRACES1("CStartupAppUi::ConstructL(): KPSStartupAppState define err %d", err); |
|
188 } |
|
189 |
|
190 err = RProperty::Set( KPSUidStartupApp, |
|
191 KPSStartupAppState, |
|
192 EStartupAppStateWait ); |
|
193 |
|
194 if( KErrNone != err ) |
|
195 { |
|
196 TRACES1("CStartupAppUi::ConstructL(): KPSStartupAppState set err %d", err); |
|
197 } |
|
198 |
|
199 iStartupPubSubObserver = CStartupPubSubObserver::NewL( this ); |
|
200 |
|
201 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
202 err = RProperty::Define( KPSUidStartup, |
|
203 KStartupBootIntoOffline, |
|
204 RProperty::EInt, |
|
205 KReadDeviceDataPolicy, |
|
206 KWriteDeviceDataPolicy ); |
|
207 |
|
208 if( KErrNone != err && |
|
209 KErrAlreadyExists != err ) |
|
210 { |
|
211 TRACES1("CStartupAppUi::ConstructL(): KStartupBootIntoOffline define err %d", err); |
|
212 } |
|
213 |
|
214 err = RProperty::Define( KPSUidStartup, |
|
215 KStartupSecurityCodeQueryStatus, |
|
216 RProperty::EInt, |
|
217 KReadDeviceDataPolicy, |
|
218 KWriteDeviceDataPolicy ); |
|
219 if( KErrNone != err && |
|
220 KErrAlreadyExists != err ) |
|
221 { |
|
222 TRACES1("CStartupAppUi::ConstructL(): KStartupSecurityCodeQueryStatus define err %d", err); |
|
223 } |
|
224 err = RProperty::Define( KPSUidStartup, |
|
225 KStartupCleanBoot, |
|
226 RProperty::EInt, |
|
227 KReadDeviceDataPolicy, |
|
228 KWriteDeviceDataPolicy ); |
|
229 if( KErrNone != err && |
|
230 KErrAlreadyExists != err ) |
|
231 { |
|
232 TRACES1("CStartupAppUi::ConstructL(): KStartupCleanBoot define err %d", err); |
|
233 } |
|
234 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
235 |
|
236 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
237 err = RProperty::Define( KPSUidStartup, |
|
238 KPSStartupUiPhase, |
|
239 RProperty::EInt, |
|
240 KAlwaysPassPolicy, |
|
241 KWriteDeviceDataPolicy ); |
|
242 |
|
243 if( KErrNone != err && |
|
244 KErrAlreadyExists != err ) |
|
245 { |
|
246 TRACES1("CStartupAppUi::ConstructL(): KPSStartupUiPhase define err %d", err); |
|
247 } |
|
248 |
|
249 UpdateStartupUiPhase( EStartupUiPhaseUninitialized ); |
|
250 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
251 |
|
252 FeatureManager::InitializeLibL(); |
|
253 if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) ) |
|
254 { |
|
255 iOfflineModeSupported = ETrue; |
|
256 } |
|
257 if ( !FeatureManager::FeatureSupported( KFeatureIdSimCard ) ) |
|
258 { |
|
259 iSimSupported = EFalse; |
|
260 } |
|
261 if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) ) |
|
262 { |
|
263 iCoverUISupported = ETrue; |
|
264 } |
|
265 |
|
266 TRACES1("CStartupAppUi::ConstructL(): Offline mode supported: %d", iOfflineModeSupported ); |
|
267 TRACES1("CStartupAppUi::ConstructL(): SIM card supported: %d", iSimSupported ); |
|
268 TRACES1("CStartupAppUi::ConstructL(): CoverUI supported: %d", iCoverUISupported ); |
|
269 |
|
270 #if defined (RD_SCALABLE_UI_V2) && !defined(RD_STARTUP_ANIMATION_CUSTOMIZATION) |
|
271 if ( FeatureManager::FeatureSupported(KFeatureIdPenSupport) && |
|
272 FeatureManager::FeatureSupported(KFeatureIdPenSupportCalibration) ) |
|
273 { |
|
274 iTouchScreenCalibSupport = ETrue; |
|
275 } |
|
276 #endif // RD_SCALABLE_UI_V2 && !RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
277 |
|
278 if (iCoverUISupported) |
|
279 { |
|
280 iStartupMediatorObserver = CStartupMediatorObserver::NewL( this ); |
|
281 } |
|
282 |
|
283 iFirstBoot = FirstBoot(); |
|
284 TRACES1("CStartupAppUi::ConstructL(): First boot: %d", iFirstBoot ); |
|
285 |
|
286 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
287 iWelcomeAnimation = CStartupWelcomeAnimation::NewL( this, ClientRect()); |
|
288 AddToStackL( iWelcomeAnimation ); |
|
289 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
290 |
|
291 // Set Startup application to be system application |
|
292 iEikonEnv->SetSystem( ETrue ); |
|
293 |
|
294 iEikonEnv->RootWin().SetOrdinalPosition(0,0); |
|
295 |
|
296 // Disable priority changes of window server |
|
297 iEikonEnv->WsSession().ComputeMode( |
|
298 RWsSession::EPriorityControlDisabled ); |
|
299 |
|
300 iNoteTimer = CPeriodic::NewL( EPriorityNormal ); |
|
301 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
302 iAnimTimer = CPeriodic::NewL( EPriorityNormal ); |
|
303 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
304 iExitTimer = CPeriodic::NewL( EPriorityNormal ); |
|
305 |
|
306 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
307 TRACES("CStartupAppUi::ConstructL(): StartupTone: Initialising"); |
|
308 iStartupTone = CStartupTone::NewL( this, EStartupTone ); |
|
309 TRACES("CStartupAppUi::ConstructL(): StartupTone: Initialised"); |
|
310 |
|
311 TRACES("CStartupAppUi::ConstructL(): Operator StartupTone: Initialising"); |
|
312 iOpStartupTone = CStartupTone::NewL( this, EStartupOpTone ); |
|
313 TRACES("CStartupAppUi::ConstructL(): Operator StartupTone: Initialised"); |
|
314 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
315 |
|
316 if ( iSwStateFatalStartupError ) |
|
317 { |
|
318 TRACES("CStartupAppUi::ConstructL(): ESWStateFatalStartupError"); |
|
319 DoNextStartupPhaseL( EStartupSystemFatalError ); |
|
320 TRACES("CStartupAppUi::ConstructL(): End, Boot failed"); |
|
321 return;//Execution stops here. |
|
322 } |
|
323 |
|
324 DoStartupStartPartL(); |
|
325 TRACES("CStartupAppUi::ConstructL(): End"); |
|
326 } |
|
327 |
|
328 |
|
329 // --------------------------------------------------------------------------- |
|
330 // CStartupAppUi::~CStartupAppUi() |
|
331 // --------------------------------------------------------------------------- |
|
332 CStartupAppUi::~CStartupAppUi() |
|
333 { |
|
334 TRACES("CStartupAppUi::~CStartupAppUi()"); |
|
335 |
|
336 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
337 if (iWelcomeAnimation) |
|
338 { |
|
339 RemoveFromStack( iWelcomeAnimation ); |
|
340 delete iWelcomeAnimation; |
|
341 } |
|
342 |
|
343 if (iOperatorAnimation) |
|
344 { |
|
345 RemoveFromStack( iOperatorAnimation); |
|
346 delete iOperatorAnimation; |
|
347 } |
|
348 |
|
349 if (iUserWelcomeNote) |
|
350 { |
|
351 RemoveFromStack( iUserWelcomeNote ); |
|
352 delete iUserWelcomeNote; |
|
353 iUserWelcomeNote = NULL; |
|
354 } |
|
355 |
|
356 if (iStartupPubSubObserver) |
|
357 { |
|
358 delete iStartupPubSubObserver; |
|
359 } |
|
360 if (iStartupMediatorObserver) |
|
361 { |
|
362 delete iStartupMediatorObserver; |
|
363 } |
|
364 if (iStartupTone) |
|
365 { |
|
366 delete iStartupTone; |
|
367 } |
|
368 if (iOpStartupTone) |
|
369 { |
|
370 delete iOpStartupTone; |
|
371 } |
|
372 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
373 |
|
374 if( iExitTimer ) |
|
375 { |
|
376 iExitTimer->Cancel(); |
|
377 delete iExitTimer; |
|
378 } |
|
379 |
|
380 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
381 if( iAnimTimer ) |
|
382 { |
|
383 iAnimTimer->Cancel(); |
|
384 delete iAnimTimer; |
|
385 } |
|
386 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
387 |
|
388 if( iNoteTimer ) |
|
389 { |
|
390 iNoteTimer->Cancel(); |
|
391 delete iNoteTimer; |
|
392 } |
|
393 |
|
394 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
395 delete iUserWelcomeNote; |
|
396 delete iAnimation; |
|
397 delete iStartupPubSubObserver; |
|
398 delete iStartupMediatorObserver; |
|
399 delete iMainView; |
|
400 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
401 |
|
402 FeatureManager::UnInitializeLib(); |
|
403 |
|
404 TRACES("CStartupAppUi::~CStartupAppUi(): End"); |
|
405 } |
|
406 |
|
407 // --------------------------------------------------------------------------- |
|
408 // CStartupAppUi::PrepareToExit() |
|
409 // --------------------------------------------------------------------------- |
|
410 void CStartupAppUi::PrepareToExit() |
|
411 { |
|
412 TRACES("CStartupAppUi::PrepareToExit()"); |
|
413 |
|
414 #ifdef RD_UI_TRANSITION_EFFECTS_PHASE2 |
|
415 // Start the custom exit effect at boot time. |
|
416 // Note: Not allowed to call GfxTransEffect::EndFullScreen() as AVKON takes care of that when |
|
417 // EApplicationExit context is used! |
|
418 |
|
419 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
420 if ( !( iAnimation->WasCancelled() ) ) |
|
421 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
422 if( !iWelcomeAnimation->IsAnimationCancelled() ) |
|
423 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
424 { |
|
425 TRACES("CStartupAppUi::PrepareToExit(): Starting transition effect"); |
|
426 |
|
427 GfxTransEffect::BeginFullScreen( AknTransEffect::EApplicationExit, TRect(), |
|
428 AknTransEffect::EParameterType, |
|
429 AknTransEffect::GfxTransParam( KUidStartUp, AknTransEffect::TParameter::EAllowAtBoot ) ); |
|
430 } |
|
431 #endif |
|
432 |
|
433 CEikAppUi::PrepareToExit(); |
|
434 #ifndef RD_BOOT_CUSTOMIZABLE_AI |
|
435 if( !iChargingOrAlarmBoot ) |
|
436 { |
|
437 TRACES("CStartupAppUi::PrepareToExit(): NOT Charger/alarm boot"); |
|
438 |
|
439 TRACES("CStartupAppUi::PrepareToExit(): Activate Idle app"); |
|
440 TVwsViewId viewId = TVwsViewId(TUid::Uid(0x101FD64C), TUid::Uid(0x101FD64C)); |
|
441 |
|
442 TUid customMessageUid = KNullUid; |
|
443 |
|
444 TRAPD(ignore, CreateActivateViewEventL(viewId, customMessageUid, KNullDesC8())); |
|
445 if (ignore != KErrNone) |
|
446 { |
|
447 TRACES1("CStartupAppUi::PrepareToExit(): CreateActivateViewEventL() leaves, err = %d", ignore ); |
|
448 } |
|
449 } |
|
450 #endif //RD_BOOT_CUSTOMIZABLE_AI |
|
451 TRACES("CStartupAppUi::PrepareToExit(): End"); |
|
452 } |
|
453 |
|
454 // --------------------------------------------------------------------------- |
|
455 // CStartupAppUi::DoStopTimingL(TAny* aObject) |
|
456 // --------------------------------------------------------------------------- |
|
457 TInt CStartupAppUi::DoStopTimingL(TAny* aObject) |
|
458 { |
|
459 TRACES("CStartupAppUi::DoStopTimingL() +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); |
|
460 TRACES1("CStartupAppUi::DoStopTimingL(): Object: %d", aObject); |
|
461 STATIC_CAST( CStartupAppUi*, aObject )->StopTimingL(); // cast, and call non-static function |
|
462 TRACES("CStartupAppUi::DoStopTimingL(): End ------------------------------------------------------ "); |
|
463 return KErrNone; |
|
464 } |
|
465 |
|
466 // --------------------------------------------------------------------------- |
|
467 // CStartupAppUi::DoExitApplication(TAny* aObject) |
|
468 // --------------------------------------------------------------------------- |
|
469 TInt CStartupAppUi::DoExitApplication(TAny* aObject) |
|
470 { |
|
471 TRACES("CStartupAppUi::DoExitApplication()"); |
|
472 STATIC_CAST( CStartupAppUi*, aObject )->ExitApplication(); // cast, and call non-static function |
|
473 TRACES("CStartupAppUi::DoExitApplication(): End"); |
|
474 return KErrNone; |
|
475 } |
|
476 |
|
477 // --------------------------------------------------------------------------- |
|
478 // CStartupAppUi::HandleKeyEventL |
|
479 // --------------------------------------------------------------------------- |
|
480 TKeyResponse CStartupAppUi::HandleKeyEventL( |
|
481 const TKeyEvent& aKeyEvent, |
|
482 TEventCode aType ) |
|
483 { |
|
484 TRACES3("CStartupAppUi::HandleKeyEventL(): code = %d, type = %d, repeats = %d", |
|
485 aKeyEvent.iCode, aType, aKeyEvent.iRepeats); |
|
486 |
|
487 TKeyResponse response( EKeyWasNotConsumed ); |
|
488 if ( aType != EEventNull && |
|
489 aKeyEvent.iCode == EKeyApplication0 && // Apps key |
|
490 ( iInternalState == EStartupShowingWelcomeAnimation || |
|
491 iInternalState == EStartupShowingOperatorAnimation || |
|
492 iInternalState == EStartupShowingUserWelcomeNote ) ) |
|
493 { |
|
494 if ( aKeyEvent.iRepeats && iCleanBoot != EStartupCleanBoot) |
|
495 { |
|
496 // Long apps key press detected. Set clean boot. |
|
497 SetCleanBoot(); |
|
498 } |
|
499 |
|
500 response = EKeyWasConsumed; |
|
501 } |
|
502 else if ( aType != EEventNull && |
|
503 aKeyEvent.iCode != EStdKeyNull && |
|
504 aType == EEventKeyDown ) |
|
505 { |
|
506 TRACES("CStartupAppUi::HandleKeyEventL(): Event code is EEventKeyDown"); |
|
507 |
|
508 if ( iOfflineModeQueryShown ) |
|
509 { |
|
510 TRACES("CStartupAppUi::HandleKeyEventL(): First key event comes from Offline Mode Query"); |
|
511 // first key event comes from Offline Mode Query |
|
512 iOfflineModeQueryShown = EFalse; |
|
513 response = EKeyWasConsumed; |
|
514 } |
|
515 else if ( iUserWelcomeNote ) |
|
516 { |
|
517 TRACES("CStartupAppUi::HandleKeyEventL(): This key event is used to stop UserWelcomeAnimation"); |
|
518 //this is used to stop User Welcome note showing |
|
519 StopTimingL(); |
|
520 response = EKeyWasConsumed; |
|
521 } |
|
522 else if ( ( iInternalState == EStartupShowingWelcomeAnimation || |
|
523 iInternalState == EStartupShowingOperatorAnimation ) && |
|
524 !( iAnimation->WasCancelled() ) ) |
|
525 { |
|
526 TRACES("CStartupAppUi::HandleKeyEventL(): This key event is used to cancel animations"); |
|
527 |
|
528 CancelAnimation(); |
|
529 response = EKeyWasConsumed; |
|
530 } |
|
531 } |
|
532 |
|
533 TRACES1("CStartupAppUi::HandleKeyEventL(): End, return %d", response); |
|
534 return response; |
|
535 } |
|
536 |
|
537 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
538 // --------------------------------------------------------------------------- |
|
539 // CStartupAppUi::HandleResourceChangeL |
|
540 // |
|
541 // --------------------------------------------------------------------------- |
|
542 // |
|
543 void CStartupAppUi::HandleResourceChangeL( TInt aType ) |
|
544 { |
|
545 TRACES("CStartupAppUi::HandleResourceChangeL()"); |
|
546 TRACES1("CStartupAppUi::HandleResourceChangeL Type: %d", aType); |
|
547 |
|
548 CAknAppUi::HandleResourceChangeL( aType ); |
|
549 |
|
550 if ( aType == KEikDynamicLayoutVariantSwitch ) |
|
551 { |
|
552 iMainView->SetRect( ApplicationRect() ); |
|
553 } |
|
554 |
|
555 TRACES("CStartupAppUi::HandleResourceChangeL(): End"); |
|
556 } |
|
557 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
558 |
|
559 |
|
560 // --------------------------------------------------------------------------- |
|
561 // CStartupAppUi::HandleCommandL(TInt aCommand) |
|
562 // --------------------------------------------------------------------------- |
|
563 void CStartupAppUi::HandleCommandL(TInt aCommand) |
|
564 { |
|
565 TRACES("CStartupAppUi::HandleCommandL()"); |
|
566 switch (aCommand) |
|
567 { |
|
568 case EEikCmdExit: |
|
569 { |
|
570 TRACES("CStartupAppUi::HandleCommandL(): EEikCmdExit"); |
|
571 Exit(); |
|
572 } |
|
573 break; |
|
574 default: |
|
575 break; |
|
576 }//End of switch-clause |
|
577 TRACES("CStartupAppUi::HandleCommandL(): End"); |
|
578 } |
|
579 |
|
580 // --------------------------------------------------------------------------- |
|
581 // CStartupAppUi::DoStartupStartPartL() |
|
582 // --------------------------------------------------------------------------- |
|
583 void CStartupAppUi::DoStartupStartPartL() |
|
584 { |
|
585 TRACES("CStartupAppUi::DoStartupStartPartL()"); |
|
586 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
587 TryPreLoadAnimation(); |
|
588 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
589 DoNextStartupPhaseL( EStartupWaitingCriticalBlock ); |
|
590 TRACES("CStartupAppUi::DoStartupStartPartL(): End"); |
|
591 } |
|
592 |
|
593 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
594 // --------------------------------------------------------------------------- |
|
595 // CStartupAppUi::TryPreLoadAnimation() |
|
596 // --------------------------------------------------------------------------- |
|
597 void CStartupAppUi::TryPreLoadAnimation() |
|
598 { |
|
599 TRACES("CStartupAppUi::TryPreLoadAnimation()"); |
|
600 |
|
601 TInt state( ESwStateStartingCriticalApps ); |
|
602 TInt err; |
|
603 err = RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state ); // Use default if this fails |
|
604 if( KErrNone != err ) |
|
605 { |
|
606 TRACES1("CStartupAppUi::TryPreLoadAnimation(): KPSGlobalSystemState get err %d", err); |
|
607 } |
|
608 TInt mode( EStartupModeNormal ); |
|
609 err = RProperty::Get( KPSUidStartup, KPSGlobalStartupMode, mode ); // Use default if this fails |
|
610 if( KErrNone != err ) |
|
611 { |
|
612 TRACES1("CStartupAppUi::TryPreLoadAnimation(): KPSGlobalStartupMode get err %d", err); |
|
613 } |
|
614 |
|
615 TRACES2("CStartupAppUi::TryPreLoadAnimation(): State: %d, mode %d", state, mode); |
|
616 |
|
617 if ( ( !HiddenReset() || iFirstBoot ) && // First boot or not-a-reset |
|
618 ( ( ( state == ESwStateStartingCriticalApps || state == ESwStateSelfTestOK ) && |
|
619 mode == EStartupModeNormal ) || // Not going to charging or alarm mode |
|
620 state == ESwStateSecurityCheck ) ) |
|
621 { |
|
622 iAnimation->PreLoad( |
|
623 ClientRect(), |
|
624 *iMainView, |
|
625 KStartupAnimationParams, |
|
626 ETrue, |
|
627 SecondaryDisplay::EStartWelcomeAnimation ); |
|
628 } |
|
629 |
|
630 TRACES("CStartupAppUi::TryPreLoadAnimation(): End"); |
|
631 } |
|
632 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
633 |
|
634 |
|
635 // --------------------------------------------------------------------------- |
|
636 // CStartupAppUi::DoStartupShowWelcomeAnimationL() |
|
637 // --------------------------------------------------------------------------- |
|
638 void CStartupAppUi::DoStartupShowWelcomeAnimationL() |
|
639 { |
|
640 TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL()"); |
|
641 if ( HiddenReset() ) |
|
642 { |
|
643 //skip the welcome animation and user welcome note and continue with |
|
644 //the same way like in the end of ShowUserWelcomeNoteL() |
|
645 TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): Skip the animation and UWN because it's hidden reset"); |
|
646 TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): and change internal state directly to EStartupFirstBootAndRTCCheck"); |
|
647 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
648 iWelcomeAnimation->RemoveSplashScreen(); |
|
649 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
650 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
651 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
652 return; |
|
653 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
654 } |
|
655 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
656 else |
|
657 { |
|
658 TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): Show animation"); |
|
659 |
|
660 iAnimation->Play( |
|
661 ClientRect(), |
|
662 *iMainView, |
|
663 KStartupAnimationParams, |
|
664 ETrue, |
|
665 SecondaryDisplay::EStartWelcomeAnimation, |
|
666 TCallBack( AnimationFinishedFunc, this ) ); |
|
667 } |
|
668 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
669 |
|
670 TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): Play startup tone."); |
|
671 |
|
672 // Play startup tone |
|
673 if (iStartupTone->Play() != KErrNone) |
|
674 { |
|
675 // Play startup beep. |
|
676 TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): Play startup beep"); |
|
677 static_cast<CAknAppUi*>(iEikonEnv-> |
|
678 EikAppUi())-> |
|
679 KeySounds()-> |
|
680 PlaySound( EAvkonSIDPowerOnTone ); |
|
681 } |
|
682 iWelcomeAnimation->SetAnimationShowing(ETrue); |
|
683 ShowWelcomeAnimationL(); |
|
684 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
685 |
|
686 TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): End"); |
|
687 } |
|
688 |
|
689 // --------------------------------------------------------------------------- |
|
690 // CStartupAppUi::DoStartupShowOperatorAnimationL() |
|
691 // --------------------------------------------------------------------------- |
|
692 void CStartupAppUi::DoStartupShowOperatorAnimationL() |
|
693 { |
|
694 TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL()"); |
|
695 if ( HiddenReset() ) |
|
696 { |
|
697 //skip the operator animation and user welcome note and continue with |
|
698 //the same way like in the end of ShowUserWelcomeNoteL() |
|
699 TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): Skip the animation and UWN because it's hidden reset"); |
|
700 TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): and change internal state directly to EStartupFirstBootAndRTCCheck"); |
|
701 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
702 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
703 return; |
|
704 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
705 } |
|
706 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
707 else |
|
708 { |
|
709 TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): Show animation"); |
|
710 |
|
711 CSAnimStartupCtrl::TAnimationParams params; |
|
712 params.iRepositoryUid = KCRUidStartupConf; |
|
713 params.iAnimationPathKey = KStartupOperatorAnimationPath; |
|
714 params.iFrameDelayKey = KStartupOperatorAnimationFrameDelay; |
|
715 params.iEnableScalingKey = KStartupOperatorAnimationScaling; |
|
716 params.iTonePathKey = KStartupOperatorTonePath; |
|
717 params.iVolumeKey = KStartupOperatorToneVolume; |
|
718 iAnimation->Play( |
|
719 ClientRect(), |
|
720 *iMainView, |
|
721 params, |
|
722 EFalse, |
|
723 SecondaryDisplay::EStartOperatorAnimation, |
|
724 TCallBack( AnimationFinishedFunc, this ) ); |
|
725 } |
|
726 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
727 if ( iOperatorAnimation->ShowingTime() ) |
|
728 { |
|
729 TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): Operator animation time defined properly"); |
|
730 iOperatorAnimation->SetAnimationShowing(ETrue); |
|
731 iOpStartupTone->Play(); |
|
732 ShowOperatorAnimationL(); |
|
733 } |
|
734 else |
|
735 { |
|
736 TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): Operator animation not defined. Skip it."); |
|
737 iOperatorAnimation->SetAnimationShowing(EFalse); |
|
738 DoNextStartupPhaseL( EStartupShowingUserWelcomeNote ); |
|
739 } |
|
740 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
741 |
|
742 TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): End"); |
|
743 } |
|
744 |
|
745 // --------------------------------------------------------------------------- |
|
746 // CStartupAppUi::DoStartupShowUserWelcomeNoteL() |
|
747 // --------------------------------------------------------------------------- |
|
748 void CStartupAppUi::DoStartupShowUserWelcomeNoteL() |
|
749 { |
|
750 TRACES("CStartupAppUi::DoStartupShowUserWelcomeNoteL()"); |
|
751 ShowUserWelcomeNoteL(); |
|
752 TRACES("CStartupAppUi::DoStartupShowUserWelcomeNoteL(): End"); |
|
753 } |
|
754 |
|
755 // --------------------------------------------------------------------------- |
|
756 // CStartupAppUi::StartupQueriesEnabled() |
|
757 // --------------------------------------------------------------------------- |
|
758 TBool CStartupAppUi::StartupQueriesEnabled() |
|
759 { |
|
760 TRACES("CStartupAppUi::StartupQueriesEnabled()"); |
|
761 |
|
762 TInt value( EStartupQueriesEnabled ); |
|
763 CRepository* repository(NULL); |
|
764 |
|
765 TRAPD( err, repository = CRepository::NewL( KCRUidStartupConf ) ); |
|
766 if ( err == KErrNone ) |
|
767 { |
|
768 err = repository->Get( KStartupQueries, value ); |
|
769 } |
|
770 delete repository; |
|
771 |
|
772 TRACES1("CStartupAppUi::StartupQueriesEnabled(): returns %d", value); |
|
773 return value; |
|
774 } |
|
775 |
|
776 // --------------------------------------------------------------------------- |
|
777 // CStartupAppUi::PredictiveTimeEnabled() |
|
778 // --------------------------------------------------------------------------- |
|
779 TBool CStartupAppUi::PredictiveTimeEnabled() |
|
780 { |
|
781 TRACES("CStartupAppUi::PredictiveTimeEnabled()"); |
|
782 |
|
783 TInt value( EPredictiveTimeEnabled ); |
|
784 CRepository* repository(NULL); |
|
785 |
|
786 TRAPD( err, repository = CRepository::NewL( KCRUidStartupConf ) ); |
|
787 if ( err == KErrNone ) |
|
788 { |
|
789 err = repository->Get( KPredictiveTimeAndCountrySelection, value ); |
|
790 } |
|
791 delete repository; |
|
792 |
|
793 TRACES1("CStartupAppUi::PredictiveTimeEnabled(): returns %d", value); |
|
794 return value; |
|
795 } |
|
796 |
|
797 // --------------------------------------------------------------------------- |
|
798 // CStartupAppUi::DoStartupFirstBootAndRTCCheckL() |
|
799 // --------------------------------------------------------------------------- |
|
800 void CStartupAppUi::DoStartupFirstBootAndRTCCheckL() |
|
801 { |
|
802 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL()"); |
|
803 |
|
804 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
805 RProperty::Set( KPSUidStartup, KStartupCleanBoot, iCleanBoot ); |
|
806 RProperty::Set( KPSUidStartup, KPSSplashShutdown, ESplashShutdown ); |
|
807 |
|
808 delete iUserWelcomeNote; |
|
809 iUserWelcomeNote = NULL; |
|
810 iMainView->DrawDeferred(); |
|
811 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
812 |
|
813 // When Predictive Time and Country Selection is enabled, no queries are |
|
814 // shown to user during first boot. Instead, Clock application gets the |
|
815 // time and location from the network and marks the first boot as done. |
|
816 if( !PredictiveTimeEnabled() ) |
|
817 { |
|
818 if( iFirstBoot && !HiddenReset() && StartupQueriesEnabled() ) |
|
819 { |
|
820 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): First boot. Show city, time and date queries."); |
|
821 |
|
822 |
|
823 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
824 iWelcomeAnimation->UpdateDrawInfo( EStartupDICityTimeDateQueries ); |
|
825 iWelcomeAnimation->DrawNow(); |
|
826 |
|
827 if (iOperatorAnimation) |
|
828 { |
|
829 RemoveFromStack( iOperatorAnimation ); |
|
830 delete iOperatorAnimation; |
|
831 iOperatorAnimation = NULL; |
|
832 } |
|
833 if (iUserWelcomeNote) |
|
834 { |
|
835 RemoveFromStack( iUserWelcomeNote ); |
|
836 delete iUserWelcomeNote; |
|
837 iUserWelcomeNote = NULL; |
|
838 } |
|
839 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
840 |
|
841 ShowStartupQueriesL(); |
|
842 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Mark first boot"); |
|
843 MarkFirstBoot(); |
|
844 |
|
845 } |
|
846 else if( !RTCStatus() && !HiddenReset() && StartupQueriesEnabled()) |
|
847 { |
|
848 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): No first boot but RTCStatus is corrupted. Ask time and date"); |
|
849 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
850 iWelcomeAnimation->UpdateDrawInfo( EStartupDICityTimeDateQueries ); |
|
851 if (iUserWelcomeNote) |
|
852 { |
|
853 RemoveFromStack( iUserWelcomeNote ); |
|
854 delete iUserWelcomeNote; |
|
855 iUserWelcomeNote = NULL; |
|
856 } |
|
857 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
858 |
|
859 ShowStartupQueriesL(); // Not first boot, so skips Country/City query |
|
860 } |
|
861 if( iFirstBoot && !StartupQueriesEnabled() ) |
|
862 { |
|
863 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): First boot ongoing and queries are disabled."); |
|
864 MarkFirstBoot(); |
|
865 } |
|
866 } |
|
867 |
|
868 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Setting KPSStartupAppState = EStartupAppStateFinished"); |
|
869 TInt err = RProperty::Set( KPSUidStartupApp, KPSStartupAppState, EStartupAppStateFinished ); |
|
870 if( KErrNone != err ) |
|
871 { |
|
872 TRACES1("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): KPSStartupAppState set err %d" |
|
873 , err); |
|
874 } |
|
875 |
|
876 DoNextStartupPhaseL( EStartupWaitingCUIStartupReady ); |
|
877 } |
|
878 |
|
879 // --------------------------------------------------------------------------- |
|
880 // CStartupAppUi::ShowStartupQueriesL() |
|
881 // --------------------------------------------------------------------------- |
|
882 void CStartupAppUi::ShowStartupQueriesL() |
|
883 { |
|
884 TRACES("CStartupAppUi::ShowStartupQueriesL()"); |
|
885 |
|
886 TBool citysaved(EFalse); |
|
887 TBool timesaved(EFalse); |
|
888 TBool datesaved(EFalse); |
|
889 |
|
890 // Get default time ( to be used only in date query ) |
|
891 GetDefaultTimeAndDate( iTime ); |
|
892 |
|
893 // Show Country, Date and Time queries ( with possibility to go back ). |
|
894 // Country query is shown only in the first boot. |
|
895 |
|
896 while (!timesaved) |
|
897 { |
|
898 while (!datesaved) |
|
899 { |
|
900 while (!citysaved && iFirstBoot) |
|
901 { |
|
902 // 1. Select time zone |
|
903 ShowCountryAndCityListsL(); |
|
904 citysaved = ETrue; |
|
905 TRACES1("CStartupAppUi::ShowStartupQueriesL(): citysaved = %d", citysaved ); |
|
906 } |
|
907 // 2. Set date |
|
908 datesaved = ShowDateQueryL(); |
|
909 TRACES1("CStartupAppUi::ShowStartupQueriesL(): datesaved = %d", datesaved ); |
|
910 if (!datesaved) |
|
911 { |
|
912 citysaved = EFalse; |
|
913 } |
|
914 } |
|
915 // 3. Set time |
|
916 timesaved = ShowTimeQueryL(); |
|
917 TRACES1("CStartupAppUi::ShowStartupQueriesL(): timesaved = %d", timesaved ); |
|
918 if (!timesaved) |
|
919 { |
|
920 datesaved = EFalse; |
|
921 } |
|
922 } |
|
923 |
|
924 // All the queries completed. |
|
925 |
|
926 TRACES("CStartupAppUi::ShowStartupQueriesL() - END"); |
|
927 } |
|
928 |
|
929 // --------------------------------------------------------------------------- |
|
930 // CStartupAppUi::DoStartupEndPart() |
|
931 // --------------------------------------------------------------------------- |
|
932 void CStartupAppUi::DoStartupEndPart() |
|
933 { |
|
934 TRACES("CStartupAppUi::DoStartupEndPart()"); |
|
935 TRACES("CStartupAppUi::DoStartupEndPart(): STARTUP OK"); |
|
936 |
|
937 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
938 RProperty::Set( KPSUidStartup, KStartupCleanBoot, iCleanBoot ); |
|
939 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
940 |
|
941 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
942 UpdateStartupUiPhase( EStartupUiPhaseAllDone ); |
|
943 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
944 |
|
945 TRACES("CStartupAppUi::DoStartupEndPart(): Exit application."); |
|
946 iExitTimer->Start( 100000, 100000, TCallBack( DoExitApplication, this ) ); |
|
947 TRACES("CStartupAppUi::DoStartupEndPart(): DoExitApplication-timer called."); |
|
948 TRACES("CStartupAppUi::DoStartupEndPart(): End"); |
|
949 } |
|
950 |
|
951 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
952 // --------------------------------------------------------------------------- |
|
953 // CStartupAppUi::ContinueStartupAfterToneL() |
|
954 // --------------------------------------------------------------------------- |
|
955 void CStartupAppUi::ContinueStartupAfterToneL(TToneType aToneType) |
|
956 { |
|
957 TRACES("CStartupAppUi::ContinueStartupAfterToneL()"); |
|
958 |
|
959 if (aToneType == EStartupTone) |
|
960 { |
|
961 TRACES("CStartupAppUi::ContinueStartupAfterToneL(): Tone type EStartupTone"); |
|
962 DoNextStartupPhaseL( EStartupWaitingCUIOperatorAnim ); |
|
963 } |
|
964 else if (aToneType == EStartupOpTone) |
|
965 { |
|
966 TRACES("CStartupAppUi::ContinueStartupAfterToneL(): Tone type EStartupOpTone"); |
|
967 DoNextStartupPhaseL( EStartupShowingUserWelcomeNote ); |
|
968 } |
|
969 else |
|
970 { |
|
971 TRACES("CStartupAppUi::ContinueStartupAfterToneL(): Tone interrupted"); |
|
972 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
973 } |
|
974 TRACES("CStartupAppUi::ContinueStartupAfterToneL(): End"); |
|
975 } |
|
976 |
|
977 // --------------------------------------------------------------------------- |
|
978 // CStartupAppUi::BringToForeground() |
|
979 // --------------------------------------------------------------------------- |
|
980 void CStartupAppUi::BringToForeground() |
|
981 { |
|
982 TRACES("CStartupAppUi::BringToForeground()"); |
|
983 if ((iInternalState != EStartupWaitingTouchScreenCalib) || |
|
984 (iTouchScreenCalibrationDone)) |
|
985 { |
|
986 TRACES("CStartupAppUi::BringToForeground(): Bring to foreground"); |
|
987 TApaTask self(iCoeEnv->WsSession()); |
|
988 self.SetWgId(iCoeEnv->RootWin().Identifier()); |
|
989 self.BringToForeground(); |
|
990 } |
|
991 TRACES("CStartupAppUi::BringToForeground(): End"); |
|
992 } |
|
993 |
|
994 // --------------------------------------------------------------------------- |
|
995 // CStartupAppUi::SendToBackground() |
|
996 // --------------------------------------------------------------------------- |
|
997 void CStartupAppUi::SendToBackground() |
|
998 { |
|
999 TRACES("CStartupAppUi::SendToBackground()"); |
|
1000 TApaTask self(iCoeEnv->WsSession()); |
|
1001 self.SetWgId(iCoeEnv->RootWin().Identifier()); |
|
1002 self.SendToBackground(); |
|
1003 TRACES("CStartupAppUi::SendToBackground(): End"); |
|
1004 } |
|
1005 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1006 |
|
1007 // --------------------------------------------------------------------------- |
|
1008 // CStartupAppUi::StopTimingL() |
|
1009 // --------------------------------------------------------------------------- |
|
1010 void CStartupAppUi::StopTimingL() |
|
1011 { |
|
1012 TRACES("CStartupAppUi::StopTimingL()"); |
|
1013 if( !iStartupFirstBootAndRTCCheckAlreadyCalled ) |
|
1014 { |
|
1015 if (iInternalState == EStartupShowingUserWelcomeNote) |
|
1016 { |
|
1017 //telling that timer has expired in appui so that |
|
1018 //key pressed are not handled any more... |
|
1019 TRACES("CStartupAppUi::StopTimingL(): Stopping UWN"); |
|
1020 iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue; |
|
1021 iNoteTimer->Cancel(); |
|
1022 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1023 UpdateStartupUiPhase( EStartupUiPhaseUserWelcomeDone ); |
|
1024 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1025 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1026 iUserWelcomeNote->CancelNoteCancelTimer(); |
|
1027 iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeNoteEnd ); |
|
1028 iWelcomeAnimation->DrawNow(); |
|
1029 iUserWelcomeNote->SetUserWelcomeNoteShowing(EFalse); |
|
1030 TRACES("CStartupAppUi::StopTimingL(): UWN stopped"); |
|
1031 |
|
1032 if (iStartupTone->Playing()) |
|
1033 { |
|
1034 TRACES("CStartupAppUi::StopTimingL(): Startup tone playing. Cannot continue to next phase"); |
|
1035 iStartupTone->StartupWaiting(ETrue); |
|
1036 } |
|
1037 else |
|
1038 { |
|
1039 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1040 } |
|
1041 } |
|
1042 else if (iInternalState == EStartupShowingOperatorAnimation) // EStartupShowingOperatorAnimation |
|
1043 { |
|
1044 TRACES("CStartupAppUi::StopTimingL(): Stopping animation"); |
|
1045 iAnimTimer->Cancel(); |
|
1046 iWelcomeAnimation->CancelAnimCancelTimer(); |
|
1047 iOperatorAnimation->UpdateDrawInfo( EStartupDIOperatorAnimEnd ); |
|
1048 iOperatorAnimation->SetAnimationShowing(EFalse); |
|
1049 TRACES("CStartupAppUi::StopTimingL(): operator animation showing stopped"); |
|
1050 if ( iOperatorAnimation->IsAnimationCancelled()) |
|
1051 { |
|
1052 TRACES("CStartupAppUi::StopTimingL(): Animation is cancelled by user and therefore UWN is not shown"); |
|
1053 StopOperatorTone(); |
|
1054 iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue; |
|
1055 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1056 } |
|
1057 else |
|
1058 { |
|
1059 // If tone is still playing wait until it completes. |
|
1060 if (iOpStartupTone->Playing()) |
|
1061 { |
|
1062 TRACES("CStartupAppUi::StopTimingL(): Operator startup tone is still playing. Wait until it completes."); |
|
1063 iOpStartupTone->StartupWaiting(ETrue); |
|
1064 } |
|
1065 else |
|
1066 { |
|
1067 TRACES("CStartupAppUi::StopTimingL(): Lets display UWN"); |
|
1068 DoNextStartupPhaseL( EStartupShowingUserWelcomeNote ); |
|
1069 } |
|
1070 } |
|
1071 TRACES("CStartupAppUi::StopTimingL(): Operator Animation stopped"); |
|
1072 } |
|
1073 else // EStartupShowingWelcomeAnimation |
|
1074 { |
|
1075 TRACES("CStartupAppUi::StopTimingL(): Stopping animation"); |
|
1076 iAnimTimer->Cancel(); |
|
1077 iWelcomeAnimation->CancelAnimCancelTimer(); |
|
1078 iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeAnimEnd ); |
|
1079 iWelcomeAnimation->SetAnimationShowing(EFalse); |
|
1080 TRACES("CStartupAppUi::StopTimingL(): Welcome animation showing stopped"); |
|
1081 |
|
1082 if ( iWelcomeAnimation->IsAnimationCancelled()) |
|
1083 { |
|
1084 TRACES("CStartupAppUi::StopTimingL(): Animation is cancelled by user and therefore operator animation and UWN is not shown"); |
|
1085 StopStartupTone(); |
|
1086 iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue; |
|
1087 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1088 } |
|
1089 else |
|
1090 { |
|
1091 if (iStartupTone->Playing()) |
|
1092 { |
|
1093 // If tone is still playing wait until it completes. |
|
1094 iStartupTone->StartupWaiting(ETrue); |
|
1095 } |
|
1096 else |
|
1097 { |
|
1098 DoNextStartupPhaseL( EStartupWaitingCUIOperatorAnim ); |
|
1099 } |
|
1100 } |
|
1101 TRACES("CStartupAppUi::StopTimingL(): Animation stopped"); |
|
1102 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1103 } |
|
1104 } |
|
1105 |
|
1106 TRACES("CStartupAppUi::StopTimingL(): End"); |
|
1107 } |
|
1108 |
|
1109 // --------------------------------------------------------------------------- |
|
1110 // CStartupAppUi::ExitApplication() |
|
1111 // --------------------------------------------------------------------------- |
|
1112 void CStartupAppUi::ExitApplication() |
|
1113 { |
|
1114 TRACES("CStartupAppUi::ExitApplication()"); |
|
1115 iExitTimer->Cancel(); |
|
1116 Exit(); |
|
1117 TRACES("CStartupAppUi::ExitApplication(): End"); |
|
1118 } |
|
1119 |
|
1120 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1121 // --------------------------------------------------------------------------- |
|
1122 // CStartupAppUi::ShowWelcomeAnimationL() |
|
1123 // --------------------------------------------------------------------------- |
|
1124 void CStartupAppUi::ShowWelcomeAnimationL() |
|
1125 { |
|
1126 TRACES("CStartupAppUi::ShowWelcomeAnimationL()"); |
|
1127 __ASSERT_DEBUG( iWelcomeAnimation , PANIC( EStartupPanicClassMemberVariableIsNull ) ); |
|
1128 TInt showtime = iWelcomeAnimation->ShowingTime(); |
|
1129 iAnimation = ETrue; |
|
1130 TRACES("CStartupAppUi::ShowWelcomeAnimationL(): Animation timer started"); |
|
1131 iAnimTimer->Start( |
|
1132 showtime*KOneMilliSecondInMicroSeconds, |
|
1133 showtime*KOneMilliSecondInMicroSeconds, |
|
1134 TCallBack( DoStopTimingL, this ) ); |
|
1135 iWelcomeAnimation->StartL(); |
|
1136 TRACES("CStartupAppUi::ShowWelcomeAnimationL(): End"); |
|
1137 } |
|
1138 |
|
1139 // --------------------------------------------------------------------------- |
|
1140 // CStartupAppUi::ShowOperatorAnimationL() |
|
1141 // --------------------------------------------------------------------------- |
|
1142 void CStartupAppUi::ShowOperatorAnimationL() |
|
1143 { |
|
1144 TRACES("CStartupAppUi::ShowOperatorAnimationL()"); |
|
1145 __ASSERT_DEBUG( iOperatorAnimation , PANIC( EStartupPanicClassMemberVariableIsNull ) ); |
|
1146 TInt showtime = iOperatorAnimation->ShowingTime(); |
|
1147 iAnimation = ETrue; |
|
1148 TRACES("CStartupAppUi::ShowWelcomeAnimationL(): Operator Animation timer started"); |
|
1149 iAnimTimer->Start( |
|
1150 showtime*KOneMilliSecondInMicroSeconds, |
|
1151 showtime*KOneMilliSecondInMicroSeconds, |
|
1152 TCallBack( DoStopTimingL, this ) ); |
|
1153 iOperatorAnimation->StartL(); |
|
1154 TRACES("CStartupAppUi::ShowOperatorAnimationL(): End"); |
|
1155 } |
|
1156 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1157 |
|
1158 // --------------------------------------------------------------------------- |
|
1159 // CStartupAppUi::ShowUserWelcomeNoteL() |
|
1160 // --------------------------------------------------------------------------- |
|
1161 void CStartupAppUi::ShowUserWelcomeNoteL() |
|
1162 { |
|
1163 TRACES("CStartupAppUi::ShowUserWelcomeNoteL()"); |
|
1164 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1165 iUserWelcomeNote = CStartupUserWelcomeNote::NewL( *this, ClientRect(), *iMainView ); |
|
1166 TStartupNoteTypeInformation type = iUserWelcomeNote->NoteTypeInformation(); |
|
1167 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1168 __ASSERT_DEBUG( iUserWelcomeNote , PANIC( EStartupPanicClassMemberVariableIsNull ) ); |
|
1169 TStartupNoteTypeInformation type; |
|
1170 type = iUserWelcomeNote->NoteTypeInformation(); |
|
1171 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1172 if( type == EStartupImage ) |
|
1173 { |
|
1174 // UserWelcomeNote type is EStartupImage |
|
1175 // This type of note is shown fixed (KUserWelcomeNoteShowPeriodTime) time |
|
1176 TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): UWNTimer started (graphic)"); |
|
1177 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1178 iAnimation = EFalse; |
|
1179 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1180 iNoteTimer->Start( |
|
1181 KUserWelcomeNoteShowPeriodTime, |
|
1182 KUserWelcomeNoteShowPeriodTime, |
|
1183 TCallBack( DoStopTimingL, this ) ); |
|
1184 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1185 iUserWelcomeNote->StartL(); |
|
1186 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1187 } |
|
1188 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1189 else if ( type == EStartupText ) |
|
1190 { |
|
1191 TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): Text UWN"); |
|
1192 |
|
1193 iUserWelcomeNote->StartL(); |
|
1194 |
|
1195 UpdateStartupUiPhase( EStartupUiPhaseUserWelcomeDone ); |
|
1196 |
|
1197 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1198 } |
|
1199 else |
|
1200 { |
|
1201 TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): No UWN"); |
|
1202 |
|
1203 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1204 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1205 else |
|
1206 { |
|
1207 //if User Welcome Note type is ETextWelcomeNote nothing to do here, |
|
1208 //because it is implemented with Avkon globalnote |
|
1209 //or if type is EDefaultWelcomeNote no User Welcome Note is shown. |
|
1210 TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): No UWN to show or UWN is text"); |
|
1211 } |
|
1212 //invoke welcome note container to show note |
|
1213 iUserWelcomeNote->StartL(); |
|
1214 |
|
1215 if( type == EStartupText || type == EStartupNoNote) |
|
1216 { |
|
1217 //this is called already here because timer not activated in text uwn case |
|
1218 //and so DoStopTimingL() is never called and should be called here. |
|
1219 StopTimingL(); |
|
1220 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1221 } |
|
1222 |
|
1223 TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): End"); |
|
1224 } |
|
1225 |
|
1226 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1227 // --------------------------------------------------------------------------- |
|
1228 // CStartupAppUi::WaitingTouchScreenCalibL() |
|
1229 // --------------------------------------------------------------------------- |
|
1230 void CStartupAppUi::WaitingTouchScreenCalibL() |
|
1231 { |
|
1232 TRACES("CStartupAppUi::WaitingTouchScreenCalibL()"); |
|
1233 #ifdef RD_SCALABLE_UI_V2 |
|
1234 |
|
1235 if( iFirstBoot && iTouchScreenCalibSupport ) |
|
1236 { |
|
1237 if (iTouchScreenCalibrationDone) |
|
1238 { |
|
1239 TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Calibration already done. Continue boot up"); |
|
1240 DoNextStartupPhaseL( EStartupOfflineModeQuery ); |
|
1241 } |
|
1242 else |
|
1243 { |
|
1244 SendToBackground(); |
|
1245 |
|
1246 iWelcomeAnimation->UpdateDrawInfo( EStartupDITouchScreenCalib ); |
|
1247 iWelcomeAnimation->DrawNow(); |
|
1248 TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Startup sequence halted until Touch Screen Calibration is done"); |
|
1249 } |
|
1250 } |
|
1251 else |
|
1252 { |
|
1253 TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Not first boot or calibration not supported. Continue boot up"); |
|
1254 DoNextStartupPhaseL( EStartupOfflineModeQuery ); |
|
1255 } |
|
1256 |
|
1257 #else // !RD_SCALABLE_UI_V2 |
|
1258 TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Calibration not supported. Continue boot up"); |
|
1259 DoNextStartupPhaseL( EStartupOfflineModeQuery ); |
|
1260 |
|
1261 #endif // RD_SCALABLE_UI_V2 |
|
1262 TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): End"); |
|
1263 } |
|
1264 |
|
1265 #ifdef RD_SCALABLE_UI_V2 |
|
1266 // --------------------------------------------------------------------------- |
|
1267 // CStartupAppUi::TouchScreenCalibrationDoneL() |
|
1268 // --------------------------------------------------------------------------- |
|
1269 void CStartupAppUi::TouchScreenCalibrationDoneL() |
|
1270 { |
|
1271 TRACES("CStartupAppUi::TouchScreenCalibrationDoneL()"); |
|
1272 if (iInternalState == EStartupWaitingTouchScreenCalib) |
|
1273 { |
|
1274 iTouchScreenCalibrationDone = ETrue; |
|
1275 BringToForeground(); |
|
1276 DoNextStartupPhaseL( EStartupOfflineModeQuery ); |
|
1277 } |
|
1278 else |
|
1279 { |
|
1280 iTouchScreenCalibrationDone = ETrue; |
|
1281 } |
|
1282 TRACES("CStartupAppUi::TouchScreenCalibrationDoneL(): End"); |
|
1283 } |
|
1284 #endif // RD_SCALABLE_UI_V2 |
|
1285 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1286 |
|
1287 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1288 // --------------------------------------------------------------------------- |
|
1289 // CStartupAppUi::CoverUIWelcomeAnimationSyncOKL() |
|
1290 // --------------------------------------------------------------------------- |
|
1291 void CStartupAppUi::CoverUIWelcomeAnimationSyncOKL() |
|
1292 { |
|
1293 TRACES("CStartupAppUi::CoverUIWelcomeAnimationSyncOKL()"); |
|
1294 DoNextStartupPhaseL( EStartupWaitingStartupTone ); |
|
1295 TRACES("CStartupAppUi::CoverUIWelcomeAnimationSyncOKL(): End"); |
|
1296 } |
|
1297 |
|
1298 // --------------------------------------------------------------------------- |
|
1299 // CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL() |
|
1300 // --------------------------------------------------------------------------- |
|
1301 void CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL() |
|
1302 { |
|
1303 TRACES("CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL()"); |
|
1304 if (iCoverUISupported) |
|
1305 { |
|
1306 iStartupMediatorObserver->IssueCommand(SecondaryDisplay::ECmdStartupSync, |
|
1307 SecondaryDisplay::EStartWelcomeAnimation); |
|
1308 } |
|
1309 else |
|
1310 { |
|
1311 DoNextStartupPhaseL( EStartupWaitingStartupTone ); |
|
1312 } |
|
1313 TRACES("CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL(): End"); |
|
1314 } |
|
1315 |
|
1316 // --------------------------------------------------------------------------- |
|
1317 // CStartupAppUi::CoverUIOperatorAnimationSyncOKL() |
|
1318 // --------------------------------------------------------------------------- |
|
1319 void CStartupAppUi::CoverUIOperatorAnimationSyncOKL() |
|
1320 { |
|
1321 TRACES("CStartupAppUi::CoverUIOperatorAnimationSyncOKL()"); |
|
1322 DoNextStartupPhaseL( EStartupShowingOperatorAnimation ); |
|
1323 TRACES("CStartupAppUi::CoverUIOperatorAnimationSyncOKL(): End"); |
|
1324 } |
|
1325 |
|
1326 // --------------------------------------------------------------------------- |
|
1327 // CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL() |
|
1328 // --------------------------------------------------------------------------- |
|
1329 void CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL() |
|
1330 { |
|
1331 TRACES("CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL()"); |
|
1332 if (iCoverUISupported) |
|
1333 { |
|
1334 if (iOperatorAnimation->ShowingTime()) |
|
1335 { |
|
1336 iStartupMediatorObserver->IssueCommand(SecondaryDisplay::ECmdStartupSync, |
|
1337 SecondaryDisplay::EStartOperatorAnimation ); |
|
1338 } |
|
1339 else |
|
1340 { |
|
1341 DoNextStartupPhaseL( EStartupShowingOperatorAnimation ); |
|
1342 } |
|
1343 } |
|
1344 else |
|
1345 { |
|
1346 DoNextStartupPhaseL( EStartupShowingOperatorAnimation ); |
|
1347 } |
|
1348 TRACES("CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL(): End"); |
|
1349 } |
|
1350 |
|
1351 // --------------------------------------------------------------------------- |
|
1352 // CStartupAppUi::WaitingStartupToneL() |
|
1353 // --------------------------------------------------------------------------- |
|
1354 void CStartupAppUi::WaitingStartupToneL() |
|
1355 { |
|
1356 if( iStartupTone->ToneFound() && !iStartupTone->AudioReady() ) |
|
1357 { |
|
1358 TRACES("CStartupAppUi::WaitingStartupToneL(): Startup tone found but not ready. Waiting tone to init"); |
|
1359 iToneInitTimer = CPeriodic::NewL( EPriorityNormal ); |
|
1360 iToneInitTimer->Start( KOneMilliSecondInMicroSeconds, |
|
1361 KOneMilliSecondInMicroSeconds, |
|
1362 TCallBack( ToneInitTimerTimeoutL, this ) ); |
|
1363 } |
|
1364 else |
|
1365 { |
|
1366 TRACES("CStartupAppUi::WaitingStartupToneL(): Audio ready"); |
|
1367 DoNextStartupPhaseL( EStartupShowingWelcomeAnimation ); |
|
1368 } |
|
1369 } |
|
1370 |
|
1371 // --------------------------------------------------------------------------- |
|
1372 // CStartupAppUi::ToneInitTimerTimeoutL() |
|
1373 // --------------------------------------------------------------------------- |
|
1374 TInt CStartupAppUi::ToneInitTimerTimeoutL(TAny* aObject) |
|
1375 { |
|
1376 STATIC_CAST( CStartupAppUi*, aObject )->StartupToneWaitStatusL(); // cast, and call non-static function |
|
1377 return KErrNone; |
|
1378 } |
|
1379 |
|
1380 // --------------------------------------------------------------------------- |
|
1381 // CStartupAppUi::StartupToneWaitStatusL() |
|
1382 // --------------------------------------------------------------------------- |
|
1383 void CStartupAppUi::StartupToneWaitStatusL() |
|
1384 { |
|
1385 iToneInitWaitTime++; |
|
1386 TRACES1("CStartupAppUi::StartupToneWaitStatusL(): Total tone init wait time = %d ms", iToneInitWaitTime ); |
|
1387 TBool audioReady = iStartupTone->AudioReady(); |
|
1388 if ( audioReady || (iToneInitWaitTime>=KMaxToneInitWait) ) |
|
1389 { |
|
1390 iToneInitTimer->Cancel(); |
|
1391 delete iToneInitTimer; |
|
1392 iToneInitTimer = NULL; |
|
1393 |
|
1394 TRACES1("CStartupAppUi::StartupToneWaitStatusL(): AudioReady: %d, proceed", audioReady ); |
|
1395 DoNextStartupPhaseL( EStartupShowingWelcomeAnimation ); |
|
1396 } |
|
1397 } |
|
1398 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1399 |
|
1400 // --------------------------------------------------------------------------- |
|
1401 // CStartupAppUi::CoverUIStartupReadySyncOKL() |
|
1402 // --------------------------------------------------------------------------- |
|
1403 void CStartupAppUi::CoverUIStartupReadySyncOKL() |
|
1404 { |
|
1405 TRACES("CStartupAppUi::CoverUIStartupReadySyncOKL()"); |
|
1406 DoNextStartupPhaseL( EStartupStartupOK ); |
|
1407 TRACES("CStartupAppUi::CoverUIStartupReadySyncOKL(): End"); |
|
1408 } |
|
1409 |
|
1410 // --------------------------------------------------------------------------- |
|
1411 // CStartupAppUi::WaitingCoverUIStartupReadySyncL() |
|
1412 // --------------------------------------------------------------------------- |
|
1413 void CStartupAppUi::WaitingCoverUIStartupReadySyncL() |
|
1414 { |
|
1415 TRACES("CStartupAppUi::WaitingCoverUIStartupReadySyncL()"); |
|
1416 if (iCoverUISupported) |
|
1417 { |
|
1418 iStartupMediatorObserver->IssueCommand(SecondaryDisplay::ECmdStartupSync, |
|
1419 SecondaryDisplay::EStartStartupReady); |
|
1420 } |
|
1421 else |
|
1422 { |
|
1423 DoNextStartupPhaseL( EStartupStartupOK ); |
|
1424 } |
|
1425 TRACES("CStartupAppUi::WaitingCoverUIStartupReadySyncL(): End"); |
|
1426 } |
|
1427 |
|
1428 // --------------------------------------------------------------------------- |
|
1429 // CStartupAppUi::RaiseCoverUIEvent() |
|
1430 // --------------------------------------------------------------------------- |
|
1431 void CStartupAppUi::RaiseCoverUIEvent( TUid aCategory, |
|
1432 TInt aEventId, |
|
1433 const TDesC8& aData ) |
|
1434 { |
|
1435 TRACES("CStartupAppUi::RaiseCoverUIEvent()"); |
|
1436 if (iCoverUISupported) |
|
1437 { |
|
1438 iStartupMediatorObserver->RaiseEvent( aCategory, |
|
1439 aEventId, |
|
1440 aData ); |
|
1441 } |
|
1442 TRACES("CStartupAppUi::RaiseCoverUIEvent(): End"); |
|
1443 } |
|
1444 |
|
1445 // --------------------------------------------------------------------------- |
|
1446 // CStartupAppUi::SetCriticalBlockEndedL() |
|
1447 // --------------------------------------------------------------------------- |
|
1448 void CStartupAppUi::SetCriticalBlockEndedL() |
|
1449 { |
|
1450 TRACES("CStartupAppUi::SetCriticalBlockEndedL()"); |
|
1451 iCriticalBlockEnded = ETrue; |
|
1452 if ( iInternalState == EStartupWaitingCriticalBlock ) |
|
1453 { |
|
1454 WaitingCriticalBlockEndingL(); |
|
1455 } |
|
1456 TRACES("CStartupAppUi::SetCriticalBlockEndedL(): End"); |
|
1457 } |
|
1458 |
|
1459 // --------------------------------------------------------------------------- |
|
1460 // CStartupAppUi::WaitingCriticalBlockEndingL() |
|
1461 // --------------------------------------------------------------------------- |
|
1462 void CStartupAppUi::WaitingCriticalBlockEndingL() |
|
1463 { |
|
1464 TRACES("CStartupAppUi::WaitingCriticalBlockEndingL()"); |
|
1465 |
|
1466 if( iCriticalBlockEnded ) |
|
1467 { |
|
1468 TRACES("CStartupAppUi::WaitingCriticalBlockEndingL(): CriticalBlock has ended. Continue."); |
|
1469 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1470 DoNextStartupPhaseL( EStartupOfflineModeQuery ); |
|
1471 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1472 DoNextStartupPhaseL( EStartupWaitingTouchScreenCalib ); |
|
1473 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1474 } |
|
1475 TRACES("CStartupAppUi::WaitingCriticalBlockEndingL(): End"); |
|
1476 } |
|
1477 |
|
1478 // --------------------------------------------------------------------------- |
|
1479 // CStartupAppUi::SetWaitingStartupAnimationStartL() |
|
1480 // --------------------------------------------------------------------------- |
|
1481 void CStartupAppUi::SetWaitingStartupAnimationStartL() |
|
1482 { |
|
1483 TRACES("CStartupAppUi::SetWaitingStartupAnimationStartL()"); |
|
1484 iStartupWaitingShowStartupAnimation = ETrue; |
|
1485 if ( iInternalState == EStartupWaitingShowStartupAnimation ) |
|
1486 { |
|
1487 WaitingStartupAnimationStartL(); |
|
1488 } |
|
1489 TRACES("CStartupAppUi::SetWaitingStartupAnimationStartL(): End"); |
|
1490 } |
|
1491 |
|
1492 // --------------------------------------------------------------------------- |
|
1493 // CStartupAppUi::WaitingStartupAnimationStartL() |
|
1494 // --------------------------------------------------------------------------- |
|
1495 void CStartupAppUi::WaitingStartupAnimationStartL() |
|
1496 { |
|
1497 TRACES("CStartupAppUi::WaitingStartupAnimationStartL()"); |
|
1498 |
|
1499 if( iStartupWaitingShowStartupAnimation ) |
|
1500 { |
|
1501 TRACES("CStartupAppUi::WaitingStartupAnimationStartL(): Continue."); |
|
1502 DoNextStartupPhaseL( EStartupShowingWelcomeAnimation ); |
|
1503 } |
|
1504 TRACES("CStartupAppUi::WaitingStartupAnimationStartL(): End"); |
|
1505 } |
|
1506 |
|
1507 // --------------------------------------------------------------------------- |
|
1508 // CStartupAppUi::SetEmergencyCallsOnlyL() |
|
1509 // --------------------------------------------------------------------------- |
|
1510 void CStartupAppUi::SetEmergencyCallsOnlyL() |
|
1511 { |
|
1512 TRACES("CStartupAppUi::SetEmergencyCallsOnlyL()"); |
|
1513 iCriticalBlockEnded = ETrue; |
|
1514 if ( iInternalState == EStartupWaitingCriticalBlock ) |
|
1515 { |
|
1516 TRACES("CStartupAppUi::SetEmergencyCallsOnlyL(): Entered emergency calls only state."); |
|
1517 |
|
1518 DoNextStartupPhaseL( EStartupWaitingCUIStartupReady ); |
|
1519 } |
|
1520 TRACES("CStartupAppUi::SetEmergencyCallsOnlyL(): End"); |
|
1521 } |
|
1522 |
|
1523 // --------------------------------------------------------------------------- |
|
1524 // CStartupAppUi::SwStateFatalStartupErrorL() |
|
1525 // --------------------------------------------------------------------------- |
|
1526 void CStartupAppUi::SwStateFatalStartupErrorL(TBool aPropertyChanged) |
|
1527 { |
|
1528 TRACES("CStartupAppUi::SwStateFatalStartupErrorL()"); |
|
1529 |
|
1530 iSwStateFatalStartupError = ETrue; |
|
1531 |
|
1532 if ( aPropertyChanged ) |
|
1533 { |
|
1534 TRACES("CStartupAppUi::SwStateFatalStartupErrorL(): property changed"); |
|
1535 DoNextStartupPhaseL( EStartupSystemFatalError ); |
|
1536 } |
|
1537 |
|
1538 TRACES("CStartupAppUi::SwStateFatalStartupErrorL(): End"); |
|
1539 } |
|
1540 |
|
1541 |
|
1542 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1543 // --------------------------------------------------------------------------- |
|
1544 // CStartupAppUi::GetOfflineModeQueryShown() |
|
1545 // --------------------------------------------------------------------------- |
|
1546 TBool CStartupAppUi::GetOfflineModeQueryShown() |
|
1547 { |
|
1548 TRACES1("CStartupAppUi::GetOfflineModeQueryShown(): iOfflineModeQueryShown == %d ", iOfflineModeQueryShown ); |
|
1549 return iOfflineModeQueryShown; |
|
1550 } |
|
1551 |
|
1552 // --------------------------------------------------------------------------- |
|
1553 // CStartupAppUi::SetOfflineModeQueryShown() |
|
1554 // --------------------------------------------------------------------------- |
|
1555 void CStartupAppUi::SetOfflineModeQueryShown(TBool aValue) |
|
1556 { |
|
1557 TRACES1("CStartupAppUi::SetOfflineModeQueryShown(): iOfflineModeQueryShown == %d ", iOfflineModeQueryShown ); |
|
1558 iOfflineModeQueryShown = aValue; |
|
1559 } |
|
1560 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1561 |
|
1562 // ---------------------------------------------------------------------------- |
|
1563 // CStartAppUi::DosInOfflineModeL() |
|
1564 // ---------------------------------------------------------------------------- |
|
1565 |
|
1566 TBool CStartupAppUi::DosInOfflineModeL() |
|
1567 { |
|
1568 TRACES("CStartupAppUi::DosInOfflineModeL()"); |
|
1569 if ( iOfflineModeSupported ) |
|
1570 { |
|
1571 TRACES1("CStartupAppUi::DosInOfflineModeL(): iOfflineModeSupported == %d", iOfflineModeSupported ); |
|
1572 return UiInOfflineMode(); |
|
1573 } |
|
1574 else |
|
1575 { |
|
1576 TRACES("CStartupAppUi::DosInOfflineModeL(): return EFalse"); |
|
1577 return EFalse; // device that does not support Off-line Mode can never be in Off-line Mode. |
|
1578 } |
|
1579 } |
|
1580 |
|
1581 |
|
1582 // ---------------------------------------------------------------------------- |
|
1583 // CStartupAppUi::UiInOfflineMode() |
|
1584 // ---------------------------------------------------------------------------- |
|
1585 |
|
1586 TBool CStartupAppUi::UiInOfflineMode() |
|
1587 { |
|
1588 TRACES("CStartupAppUi::UiInOfflineMode()"); |
|
1589 if ( iOfflineModeSupported ) |
|
1590 { |
|
1591 TInt networkConnectionAllowed ( 0 ); |
|
1592 |
|
1593 TRACES("CStartupAppUi::UiInOfflineMode(): Check Offline status from CenRep"); |
|
1594 CRepository* repository(NULL); |
|
1595 |
|
1596 TRAPD( err, repository = CRepository::NewL( KCRUidCoreApplicationUIs ) ); |
|
1597 if ( err == KErrNone ) |
|
1598 { |
|
1599 err = repository->Get( KCoreAppUIsNetworkConnectionAllowed, networkConnectionAllowed ); |
|
1600 } |
|
1601 |
|
1602 #ifdef _DEBUG |
|
1603 if ( err != KErrNone ) |
|
1604 TRACES1("CStartupAppUi::UiInOfflineMode(): Central repository access failed, error code %d.", err ); |
|
1605 else |
|
1606 TRACES1("CStartupAppUi::UiInOfflineMode(): Offline: network connection allowed: %d", networkConnectionAllowed); |
|
1607 #endif |
|
1608 delete repository; |
|
1609 |
|
1610 TRACES1("CStartupAppUi::UiInOfflineMode(): returns %d", !( TBool ) networkConnectionAllowed); |
|
1611 |
|
1612 return ( ! ( TBool ) networkConnectionAllowed ); |
|
1613 } |
|
1614 else |
|
1615 { |
|
1616 TRACES("CStartupAppUi::UiInOfflineMode(): DosInOfflineMode returns EFalse"); |
|
1617 return EFalse; // device that does not support Off-line Mode can never be in Off-line Mode. |
|
1618 } |
|
1619 } |
|
1620 |
|
1621 // --------------------------------------------------------------------------- |
|
1622 // CStartupAppUi::ShowOfflineModeQueryL() |
|
1623 // --------------------------------------------------------------------------- |
|
1624 void CStartupAppUi::ShowOfflineModeQueryL() |
|
1625 { |
|
1626 TRACES("CStartupAppUi::ShowOfflineModeQueryL()"); |
|
1627 |
|
1628 TInt status( EStartupSimInitWait ); |
|
1629 RProperty::Get(KPSUidStartup, KPSSimStatus, status); |
|
1630 |
|
1631 TInt reply ( 0 ); |
|
1632 if (status == ESimUsable || status == ESimReadable || status == ESimNotReady || !iSimSupported) |
|
1633 { |
|
1634 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Show offline mode query if needed"); |
|
1635 |
|
1636 if ( HiddenReset() && DosInOfflineModeL() && !SimStatusChangedReset() ) |
|
1637 { |
|
1638 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Offline Mode: Hidden reset and DOS in offline mode -> Boot to Offline"); |
|
1639 reply = 1; |
|
1640 } |
|
1641 else if ( iOfflineModeSupported && DosInOfflineModeL() ) |
|
1642 { |
|
1643 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Offline mode query needed"); |
|
1644 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1645 RProperty::Set( KPSUidStartup, KPSSplashShutdown, ESplashShutdown ); |
|
1646 iAnimation->BringToForeground(); |
|
1647 iMainView->DrawDeferred(); |
|
1648 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1649 iWelcomeAnimation->UpdateDrawInfo( EStartupDIQueriesOn ); |
|
1650 iWelcomeAnimation->DrawNow(); |
|
1651 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1652 iOfflineModeQueryShown = ETrue; |
|
1653 CAknQueryDialog* dlg = new (ELeave) CAknQueryDialog( CAknQueryDialog::ENoTone ); |
|
1654 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Publish dialog for Secondary UI"); |
|
1655 dlg->PublishDialogL(SecondaryDisplay::ECmdShowOfflineQuery, |
|
1656 SecondaryDisplay::KCatStartup); |
|
1657 if ( dlg->ExecuteLD( R_STARTUP_OFFLINE_MODE_QUERY ) ) |
|
1658 { |
|
1659 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Offline Mode query: YES -> Boot to Offline"); |
|
1660 reply = 1; |
|
1661 } |
|
1662 else |
|
1663 { |
|
1664 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Offline Mode query: NO -> Boot to Online"); |
|
1665 reply = 0; |
|
1666 } |
|
1667 } |
|
1668 else |
|
1669 { |
|
1670 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Offline Mode: DOS in online mode -> Boot to Online"); |
|
1671 reply = 0; |
|
1672 } |
|
1673 |
|
1674 } |
|
1675 #ifdef _DEBUG |
|
1676 else |
|
1677 { |
|
1678 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): SIM card removed. No offline mode query."); |
|
1679 } |
|
1680 #endif |
|
1681 |
|
1682 TRACES1("CStartupAppUi::ShowOfflineModeQueryL(): BootIntoOffline=%d.", reply); |
|
1683 TInt err = RProperty::Set( KPSUidStartup, |
|
1684 KStartupBootIntoOffline, |
|
1685 reply ? EBootIntoOfflineMode : EBootIntoOnlineMode ); |
|
1686 |
|
1687 if( KErrNone != err ) |
|
1688 { |
|
1689 TRACES1("CStartupAppUi::ShowOfflineModeQueryL(): KStartupBootIntoOffline set err %d", err); |
|
1690 } |
|
1691 |
|
1692 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): End"); |
|
1693 } |
|
1694 |
|
1695 // --------------------------------------------------------------------------- |
|
1696 // CStartupAppUi::CancelAnimation(...) |
|
1697 // --------------------------------------------------------------------------- |
|
1698 void CStartupAppUi::CancelAnimation() |
|
1699 { |
|
1700 TRACES("CStartupAppUi::CancelAnimation()"); |
|
1701 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1702 iAnimation->Cancel(); |
|
1703 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1704 iWelcomeAnimation->CancelAnimation(); |
|
1705 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1706 TRACES("CStartupAppUi::CancelAnimation(): End"); |
|
1707 } |
|
1708 |
|
1709 // --------------------------------------------------------------------------- |
|
1710 // CStartupAppUi::ShowCountryAndCityListsL() |
|
1711 // --------------------------------------------------------------------------- |
|
1712 void CStartupAppUi::ShowCountryAndCityListsL() |
|
1713 { |
|
1714 TRACES("CStartupAppUi::ShowCountryAndCityListsL()"); |
|
1715 |
|
1716 TInt cityselected( EFalse ); |
|
1717 while ( !cityselected ) |
|
1718 { |
|
1719 TRACES1("CStartupAppUi::ShowCountryAndCityListsL(): City item to focus: %d", iCounryListIndex); |
|
1720 TInt cityGroupId = ShowCountryListL(); |
|
1721 TRACES1("CStartupAppUi::ShowCountryAndCityListsL(): City group id: %d", cityGroupId); |
|
1722 if ( cityGroupId != KErrCancel ) |
|
1723 { |
|
1724 cityselected = ShowCityListL(cityGroupId); |
|
1725 } |
|
1726 else |
|
1727 { |
|
1728 cityselected = ETrue; |
|
1729 } |
|
1730 } |
|
1731 TRACES("CStartupAppUi::ShowCountryAndCityListsL(): End"); |
|
1732 } |
|
1733 |
|
1734 // --------------------------------------------------------------------------- |
|
1735 // CStartupAppUi::ShowCountryListL() |
|
1736 // --------------------------------------------------------------------------- |
|
1737 TInt CStartupAppUi::ShowCountryListL() |
|
1738 { |
|
1739 TRACES("CStartupAppUi::ShowCountryListL()"); |
|
1740 |
|
1741 CAknSinglePopupMenuStyleListBox* listBox = |
|
1742 new(ELeave) CAknSinglePopupMenuStyleListBox; |
|
1743 CleanupStack::PushL(listBox); |
|
1744 |
|
1745 CStartupPopupList* popupList = CStartupPopupList::NewL(listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, |
|
1746 AknPopupLayouts::EMenuGraphicHeadingWindow ); |
|
1747 |
|
1748 CleanupStack::PushL(popupList); |
|
1749 |
|
1750 listBox->ConstructL(popupList, EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded); |
|
1751 listBox->CreateScrollBarFrameL( ETrue ); |
|
1752 listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, |
|
1753 CEikScrollBarFrame::EAuto ); |
|
1754 |
|
1755 listBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue ); |
|
1756 |
|
1757 CDesCArrayFlat *items = new(ELeave)CDesCArrayFlat(1); |
|
1758 |
|
1759 CleanupStack::PushL(items); |
|
1760 |
|
1761 CTzLocalizer* tzLocalizer = CTzLocalizer::NewL(); |
|
1762 CleanupStack::PushL(tzLocalizer); |
|
1763 |
|
1764 CTzLocalizedCityGroupArray* countryList; |
|
1765 countryList = tzLocalizer->GetAllCityGroupsL(CTzLocalizer::ETzAlphaNameAscending); |
|
1766 CleanupStack::PushL(countryList); |
|
1767 |
|
1768 TRACES("CStartupAppUi::ShowCountryListL(): Create list of cities"); |
|
1769 for(TInt i = 0; i <countryList->Count(); i++) |
|
1770 { |
|
1771 CTzLocalizedCityGroup& cityGroup = countryList->At(i); |
|
1772 |
|
1773 // Check if the country name is blank. |
|
1774 // If it is blank, ignore it. Empty name shouldn't be shown in the list. |
|
1775 if(cityGroup.Name().Compare(KEmpty) != 0) |
|
1776 { |
|
1777 TBuf<KMaxCountryLength> countryitem; |
|
1778 countryitem.Insert(0,cityGroup.Name()); |
|
1779 TRACES1("CStartupAppUi::ShowCountryListL(): Create country to list: %S", &countryitem); |
|
1780 items->AppendL(countryitem); |
|
1781 } |
|
1782 } |
|
1783 |
|
1784 CleanupStack::PopAndDestroy( countryList ); |
|
1785 |
|
1786 CTextListBoxModel* model=listBox->Model(); |
|
1787 model->SetItemTextArray(items); |
|
1788 model->SetOwnershipType(ELbmOwnsItemArray); |
|
1789 |
|
1790 TRACES("CStartupAppUi::ShowCountryListL(): Set title"); |
|
1791 // Set title |
|
1792 HBufC* title = StringLoader::LoadLC( R_QTN_SU_SELECT_COUNTRY ); |
|
1793 popupList->SetTitleL(title->Des()); |
|
1794 CleanupStack::PopAndDestroy( title ); |
|
1795 |
|
1796 popupList->EnableAdaptiveFind(); |
|
1797 listBox->SetCurrentItemIndex(iCounryListIndex); |
|
1798 |
|
1799 TInt cityGroupId; |
|
1800 |
|
1801 if (iCoverUISupported) |
|
1802 { |
|
1803 TRACES("CStartupAppUi::ShowCountryListL(): Publish country list for Secondary UI"); |
|
1804 TPckgBuf<TInt> data( SecondaryDisplay::EShowCountryQuery ); |
|
1805 iStartupMediatorObserver->RaiseEvent( SecondaryDisplay::KCatStartup, |
|
1806 SecondaryDisplay::EMsgStartupEvent, |
|
1807 data ); |
|
1808 } |
|
1809 |
|
1810 TRACES("CStartupAppUi::ShowCountryListL(): Show the list"); |
|
1811 if (popupList->ExecuteLD()) |
|
1812 { |
|
1813 iCounryListIndex = listBox->CurrentItemIndex(); |
|
1814 TRACES1("CStartupAppUi::ShowCountryListL(): CurrentItemIndex: %d", iCounryListIndex); |
|
1815 TPtrC countryName = listBox->Model()->ItemText(iCounryListIndex); |
|
1816 |
|
1817 CTzLocalizedCityGroup* tzLocalizedCityGroup = tzLocalizer->FindCityGroupByNameL(countryName); |
|
1818 CleanupStack::PushL(tzLocalizedCityGroup); |
|
1819 |
|
1820 cityGroupId = tzLocalizedCityGroup->Id(); |
|
1821 CleanupStack::PopAndDestroy( tzLocalizedCityGroup ); |
|
1822 |
|
1823 TRACES1("CStartupAppUi::ShowCountryListL(): Selected country %S", &countryName); |
|
1824 } |
|
1825 else |
|
1826 { |
|
1827 TRACES("CStartupAppUi::ShowCountryListL(): Country list cancelled"); |
|
1828 cityGroupId = KErrCancel; |
|
1829 } |
|
1830 |
|
1831 CleanupStack::PopAndDestroy( tzLocalizer ); |
|
1832 CleanupStack::Pop( items ); |
|
1833 CleanupStack::Pop( popupList ); |
|
1834 CleanupStack::PopAndDestroy( listBox ); |
|
1835 |
|
1836 TRACES1("CStartupAppUi::ShowCountryListL(): End. Return city group id: %d", cityGroupId); |
|
1837 return cityGroupId; |
|
1838 } |
|
1839 |
|
1840 // --------------------------------------------------------------------------- |
|
1841 // CStartupAppUi::ShowCityListL() |
|
1842 // --------------------------------------------------------------------------- |
|
1843 TBool CStartupAppUi::ShowCityListL(TUint8 cityGroupId) |
|
1844 { |
|
1845 TRACES("CStartupAppUi::ShowCityListL()"); |
|
1846 |
|
1847 TBool retval( ETrue ); |
|
1848 |
|
1849 CTzLocalizer* tzLocalizer = CTzLocalizer::NewL(); |
|
1850 CleanupStack::PushL(tzLocalizer); |
|
1851 |
|
1852 CTzLocalizedCityArray* cityList; |
|
1853 |
|
1854 TRACES1("CStartupAppUi::ShowCityListL(): Create list of cities in group %d", cityGroupId); |
|
1855 |
|
1856 cityList = tzLocalizer->GetCitiesInGroupL(cityGroupId,//cityGroup.Id(), |
|
1857 CTzLocalizer::ETzAlphaNameAscending ); |
|
1858 CleanupStack::PushL(cityList); |
|
1859 |
|
1860 if ( cityList->Count() == 1 ) |
|
1861 { |
|
1862 TRACES("CStartupAppUi::ShowCityListL(): Only one city in citygroup. This can be selected automatically."); |
|
1863 |
|
1864 CTzLocalizedCity& city = cityList->At(0); |
|
1865 |
|
1866 CTzLocalizedCity* tzLocalizedCity = tzLocalizer->FindCityByNameL(city.Name()); |
|
1867 CleanupStack::PushL(tzLocalizedCity); |
|
1868 |
|
1869 TInt timeZoneId = tzLocalizedCity->TimeZoneId(); |
|
1870 |
|
1871 tzLocalizer->SetTimeZoneL(timeZoneId); |
|
1872 tzLocalizer->SetFrequentlyUsedZoneL(*tzLocalizedCity, CTzLocalizedTimeZone::ECurrentZone); |
|
1873 |
|
1874 CleanupStack::PopAndDestroy( tzLocalizedCity ); |
|
1875 CleanupStack::PopAndDestroy( cityList ); |
|
1876 CleanupStack::PopAndDestroy( tzLocalizer ); |
|
1877 |
|
1878 TRACES1("CStartupAppUi::ShowCityListL(): End, returns %d", retval); |
|
1879 return retval; |
|
1880 } |
|
1881 |
|
1882 CAknSinglePopupMenuStyleListBox* listBox = |
|
1883 new(ELeave) CAknSinglePopupMenuStyleListBox; |
|
1884 CleanupStack::PushL(listBox); |
|
1885 |
|
1886 CStartupPopupList* popupList = CStartupPopupList::NewL(listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, |
|
1887 AknPopupLayouts::EMenuGraphicHeadingWindow ); |
|
1888 |
|
1889 CleanupStack::PushL(popupList); |
|
1890 |
|
1891 CDesCArrayFlat *items = new(ELeave)CDesCArrayFlat(1); |
|
1892 |
|
1893 CleanupStack::PushL(items); |
|
1894 |
|
1895 for(TInt j = 0; j < cityList->Count(); j++) |
|
1896 { |
|
1897 CTzLocalizedCity& city = cityList->At(j); |
|
1898 |
|
1899 // Check if the city name is blank. |
|
1900 // If it is blank, ignore it. Empty name shouldn't be shown in the list. |
|
1901 if(city.Name().Compare(KEmpty) != 0) |
|
1902 { |
|
1903 TBuf<KMaxCityLength> homecityitem; |
|
1904 homecityitem.Insert(0,city.Name()); |
|
1905 TRACES1("CStartupAppUi::ShowCityListL(): Create to list: %S", &homecityitem); |
|
1906 items->AppendL(homecityitem); |
|
1907 } |
|
1908 } |
|
1909 |
|
1910 listBox->ConstructL(popupList, EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded); |
|
1911 listBox->CreateScrollBarFrameL( ETrue ); |
|
1912 listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, |
|
1913 CEikScrollBarFrame::EAuto ); |
|
1914 |
|
1915 listBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue ); |
|
1916 |
|
1917 CTextListBoxModel* model=listBox->Model(); |
|
1918 model->SetItemTextArray(items); |
|
1919 model->SetOwnershipType(ELbmOwnsItemArray); |
|
1920 |
|
1921 TRACES("CStartupAppUi::ShowCityListL(): Set title"); |
|
1922 // Set title |
|
1923 HBufC* title = StringLoader::LoadLC( R_QTN_SU_SELECT_CITY ); |
|
1924 popupList->SetTitleL(title->Des()); |
|
1925 CleanupStack::PopAndDestroy(title); |
|
1926 |
|
1927 popupList->EnableAdaptiveFind(); |
|
1928 |
|
1929 if (iCoverUISupported) |
|
1930 { |
|
1931 TRACES("CStartupAppUi::ShowCountryListL(): Publish city list for Secondary UI"); |
|
1932 TPckgBuf<TInt> data( SecondaryDisplay::EShowCityQuery ); |
|
1933 iStartupMediatorObserver->RaiseEvent( SecondaryDisplay::KCatStartup, |
|
1934 SecondaryDisplay::EMsgStartupEvent, |
|
1935 data ); |
|
1936 } |
|
1937 |
|
1938 TRACES("CStartupAppUi::ShowCityListL(): Show the list"); |
|
1939 if (popupList->ExecuteLD()) |
|
1940 { |
|
1941 TInt index(listBox->CurrentItemIndex()); |
|
1942 TRACES1("CStartupAppUi::ShowCityListL(): CurrentItemIndex: %d", index); |
|
1943 TPtrC cityName = listBox->Model()->ItemText(index); |
|
1944 |
|
1945 CTzLocalizedCity* tzLocalizedCity = tzLocalizer->FindCityByNameL(cityName); |
|
1946 CleanupStack::PushL(tzLocalizedCity); |
|
1947 |
|
1948 TInt timeZoneId = tzLocalizedCity->TimeZoneId(); |
|
1949 |
|
1950 tzLocalizer->SetTimeZoneL(timeZoneId); |
|
1951 tzLocalizer->SetFrequentlyUsedZoneL(*tzLocalizedCity, CTzLocalizedTimeZone::ECurrentZone); |
|
1952 |
|
1953 CleanupStack::PopAndDestroy(tzLocalizedCity); |
|
1954 |
|
1955 TRACES1("CStartupAppUi::ShowCityListL(): Selected city %S", &cityName); |
|
1956 } |
|
1957 else |
|
1958 { |
|
1959 TRACES("CStartupAppUi::ShowCityListL(): City list cancelled"); |
|
1960 retval = EFalse; |
|
1961 } |
|
1962 |
|
1963 CleanupStack::Pop(items); |
|
1964 CleanupStack::Pop(popupList); |
|
1965 CleanupStack::PopAndDestroy(listBox); |
|
1966 CleanupStack::PopAndDestroy(cityList); |
|
1967 CleanupStack::PopAndDestroy(tzLocalizer); |
|
1968 |
|
1969 |
|
1970 TRACES("CStartupAppUi::ShowCityListL(): Home city selected"); |
|
1971 TRACES1("CStartupAppUi::ShowCityListL(): End, return %d", retval); |
|
1972 return retval; |
|
1973 } |
|
1974 |
|
1975 // --------------------------------------------------------------------------- |
|
1976 // CStartupAppUi::ShowTimeQueryL() |
|
1977 // --------------------------------------------------------------------------- |
|
1978 TBool CStartupAppUi::ShowTimeQueryL() |
|
1979 { |
|
1980 TRACES("CStartupAppUi::ShowTimeQueryL()"); |
|
1981 |
|
1982 TTime time; |
|
1983 GetDefaultTimeAndDate( time ); |
|
1984 |
|
1985 CStartupQueryDialog* dlg = new (ELeave) CStartupQueryDialog(time, CAknQueryDialog::ENoTone); |
|
1986 TRACES("CStartupAppUi::ShowTimeQueryL(): Publish dialog for Secondary UI"); |
|
1987 dlg->PublishDialogL(SecondaryDisplay::ECmdShowTimeQuery, SecondaryDisplay::KCatStartup); |
|
1988 if( dlg->ExecuteLD( R_STARTUP_TIME_SETTING_QUERY ) ) |
|
1989 { |
|
1990 TTime current; |
|
1991 current.HomeTime(); |
|
1992 TDateTime cTime = current.DateTime(); |
|
1993 TDateTime atime = time.DateTime(); |
|
1994 atime.SetYear(cTime.Year()); |
|
1995 atime.SetMonth(cTime.Month()); |
|
1996 atime.SetDay(cTime.Day()); |
|
1997 time = atime; |
|
1998 |
|
1999 RTz rtz; |
|
2000 User::LeaveIfError(rtz.Connect()); |
|
2001 User::LeaveIfError(rtz.SetHomeTime(time)); |
|
2002 rtz.Close(); |
|
2003 |
|
2004 TRACES("CStartupAppUi::ShowTimeQueryL(): End, return ETrue"); |
|
2005 return ETrue; |
|
2006 } |
|
2007 else |
|
2008 { |
|
2009 //in case of poweroff key was pressed and shutdown is occuring |
|
2010 TRACES("CStartupAppUi::ShowTimeQueryL(): End, return EFalse"); |
|
2011 return EFalse; |
|
2012 } |
|
2013 } |
|
2014 |
|
2015 // --------------------------------------------------------------------------- |
|
2016 // CStartupAppUi::ShowDateQueryL() |
|
2017 // --------------------------------------------------------------------------- |
|
2018 TBool CStartupAppUi::ShowDateQueryL() |
|
2019 { |
|
2020 TRACES("CStartupAppUi::ShowDateQueryL()"); |
|
2021 |
|
2022 |
|
2023 CStartupQueryDialog* dlg = new (ELeave) CStartupQueryDialog(iTime, CAknQueryDialog::ENoTone); |
|
2024 TRACES("CStartupAppUi::ShowDateQueryL(): Publish dialog for Secondary UI"); |
|
2025 dlg->PublishDialogL(SecondaryDisplay::ECmdShowDateQuery, SecondaryDisplay::KCatStartup); |
|
2026 |
|
2027 TInt query( R_STARTUP_DATE_SETTING_QUERY_NOBACK ); |
|
2028 if ( iFirstBoot ) |
|
2029 { |
|
2030 query = R_STARTUP_DATE_SETTING_QUERY; |
|
2031 } |
|
2032 |
|
2033 if( dlg->ExecuteLD( query ) ) |
|
2034 { |
|
2035 TTime current; |
|
2036 current.HomeTime(); |
|
2037 TDateTime cTime = current.DateTime(); |
|
2038 TDateTime atime = iTime.DateTime(); |
|
2039 atime.SetHour(cTime.Hour()); |
|
2040 atime.SetMinute(cTime.Minute()); |
|
2041 atime.SetSecond(cTime.Second()); |
|
2042 atime.SetMicroSecond(cTime.MicroSecond()); |
|
2043 iTime = atime; |
|
2044 |
|
2045 RTz rtz; |
|
2046 User::LeaveIfError(rtz.Connect()); |
|
2047 User::LeaveIfError(rtz.SetHomeTime(iTime)); |
|
2048 rtz.Close(); |
|
2049 |
|
2050 TRACES("CStartupAppUi::ShowDateQueryL(): End, return ETrue"); |
|
2051 return ETrue; |
|
2052 } |
|
2053 else |
|
2054 { |
|
2055 // Back key pressed. ( Or poweroff key was pressed and shutdown is occuring ) |
|
2056 TRACES("CStartupAppUi::ShowDateQueryL(): End, return EFalse"); |
|
2057 return EFalse; |
|
2058 } |
|
2059 } |
|
2060 |
|
2061 // --------------------------------------------------------------------------- |
|
2062 // CStartupAppUi::GetDefaultTimeAndDate() |
|
2063 // --------------------------------------------------------------------------- |
|
2064 void CStartupAppUi::GetDefaultTimeAndDate( TTime& aTime ) |
|
2065 { |
|
2066 TRACES("CStartupAppUi::GetDefaultTimeAndDate(): Get Time and Date from CenRep"); |
|
2067 |
|
2068 CRepository* repository(NULL); |
|
2069 |
|
2070 TRAPD( err, repository = CRepository::NewL( KCRUidStartupConf ) ); |
|
2071 if ( !err ) |
|
2072 { |
|
2073 TBuf<KTimeFormatLength> buf; |
|
2074 err = repository->Get( KStartupDefaultTime, buf ); |
|
2075 if( !err ) |
|
2076 { |
|
2077 err = aTime.Set(buf); // returns error if cenrep time format not valid |
|
2078 } |
|
2079 } |
|
2080 |
|
2081 if ( err ) |
|
2082 { |
|
2083 TRACES("CStartupAppUi::GetDefaultTimeAndDate(): Failed to get valid data from CenRep. Using default"); |
|
2084 aTime.Set(KDefaultDateTimeValue); |
|
2085 } |
|
2086 |
|
2087 delete repository; |
|
2088 TRACES("CStartupAppUi::GetDefaultTimeAndDate(): End"); |
|
2089 } |
|
2090 |
|
2091 // --------------------------------------------------------------------------- |
|
2092 // CStartupAppUi::FirstBoot() |
|
2093 // --------------------------------------------------------------------------- |
|
2094 TBool CStartupAppUi::FirstBoot() |
|
2095 { |
|
2096 TRACES("CStartupAppUi::FirstBoot()"); |
|
2097 TInt value( 0 ); |
|
2098 |
|
2099 TRACES("CStartupAppUi::FirstBoot(): Read first boot info from Central Repository "); |
|
2100 CRepository* repository(NULL); |
|
2101 |
|
2102 TRAPD( err, repository = CRepository::NewL( KCRUidStartup ) ); |
|
2103 if ( err == KErrNone ) |
|
2104 { |
|
2105 err = repository->Get( KStartupFirstBoot, value ); |
|
2106 } |
|
2107 |
|
2108 delete repository; |
|
2109 |
|
2110 if (value) |
|
2111 { |
|
2112 TRACES("CStartupAppUi::FirstBoot(): End, return EFalse"); |
|
2113 return EFalse; |
|
2114 } |
|
2115 |
|
2116 else |
|
2117 { |
|
2118 TRACES("CStartupAppUi::FirstBoot(): End, return ETrue"); |
|
2119 return ETrue; |
|
2120 } |
|
2121 } |
|
2122 // --------------------------------------------------------------------------- |
|
2123 // CStartupAppUi::HiddenReset() |
|
2124 // --------------------------------------------------------------------------- |
|
2125 TBool CStartupAppUi::HiddenReset() |
|
2126 { |
|
2127 TRACES("CStartupAppUi::HiddenReset()"); |
|
2128 |
|
2129 TBool ret_val ( EFalse ); |
|
2130 if( !iFirstBoot ) |
|
2131 { |
|
2132 TInt startupReason( ENormalStartup ); |
|
2133 TInt err = RProperty::Get( KPSUidStartup, |
|
2134 KPSStartupReason, |
|
2135 startupReason ); // Use default if this fails |
|
2136 if( KErrNone != err ) |
|
2137 { |
|
2138 TRACES1("CStartupAppUi::HiddenReset(): ENormalStartup get err %d", err); |
|
2139 } |
|
2140 ret_val = ( startupReason != ENormalStartup ); |
|
2141 } |
|
2142 TRACES1("CStartupAppUi::HiddenReset(): End, return %d ",ret_val ); |
|
2143 return ret_val; |
|
2144 } |
|
2145 |
|
2146 // --------------------------------------------------------------------------- |
|
2147 // CStartupAppUi::RTCStatus() |
|
2148 // --------------------------------------------------------------------------- |
|
2149 TBool CStartupAppUi::RTCStatus() |
|
2150 { |
|
2151 TRACES("CStartupAppUi::RTCStatus()"); |
|
2152 TBool ret_val ( EFalse ); |
|
2153 |
|
2154 RStarterSession startersession; |
|
2155 if( startersession.Connect() == KErrNone ) |
|
2156 { |
|
2157 TRACES("CStartupAppUi::RTCStatus(): Connected to Starter "); |
|
2158 ret_val = startersession.IsRTCTimeValid(); |
|
2159 startersession.Close(); |
|
2160 } |
|
2161 else |
|
2162 { |
|
2163 TRACES("CStartupAppUi::RTCStatus(): Unable to connect to Starter "); |
|
2164 } |
|
2165 |
|
2166 TRACES1("CStartupAppUi::RTCStatus(): End, return %d ",ret_val ); |
|
2167 return ret_val; |
|
2168 } |
|
2169 |
|
2170 // --------------------------------------------------------------------------- |
|
2171 // CStartupAppUi::MarkFirstBoot() |
|
2172 // --------------------------------------------------------------------------- |
|
2173 void CStartupAppUi::MarkFirstBoot() |
|
2174 { |
|
2175 TRACES("CStartupAppUi::MarkFirstBoot()"); |
|
2176 TRACES("CStartupAppUi::MarkFirstBoot(): Write first boot info to Central Repository "); |
|
2177 |
|
2178 CRepository* repository(NULL); |
|
2179 |
|
2180 TRAPD( err, repository = CRepository::NewL( KCRUidStartup ) ); |
|
2181 if ( err == KErrNone ) |
|
2182 { |
|
2183 err = repository->Set( KStartupFirstBoot, 1 ); |
|
2184 } |
|
2185 |
|
2186 delete repository; |
|
2187 TRACES("CStartupAppUi::MarkFirstBoot(): End"); |
|
2188 } |
|
2189 |
|
2190 |
|
2191 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2192 // --------------------------------------------------------------------------- |
|
2193 // CStartupAppUi::AnimationFinished() |
|
2194 // --------------------------------------------------------------------------- |
|
2195 void CStartupAppUi::AnimationFinished() |
|
2196 { |
|
2197 TRACES1("CStartupAppUi::AnimationFinished(): iInternalState=%d", iInternalState ); |
|
2198 |
|
2199 // first notify animation completion, it doesn't matter if it was canceled |
|
2200 if ( iAnimation->HasContent() ) |
|
2201 { |
|
2202 switch ( iInternalState ) |
|
2203 { |
|
2204 case EStartupShowingWelcomeAnimation: |
|
2205 UpdateStartupUiPhase( EStartupUiPhaseSystemWelcomeDone ); |
|
2206 break; |
|
2207 |
|
2208 case EStartupShowingOperatorAnimation: |
|
2209 UpdateStartupUiPhase( EStartupUiPhaseOperatorWelcomeDone ); |
|
2210 break; |
|
2211 |
|
2212 default: |
|
2213 TRACES("CStartupAppUi::AnimationFinished(): unknown state"); |
|
2214 break; |
|
2215 } |
|
2216 } |
|
2217 |
|
2218 |
|
2219 TInt err = KErrNone; |
|
2220 |
|
2221 if ( iAnimation->WasCancelled() ) |
|
2222 { |
|
2223 TRACES("Animations cancelled"); |
|
2224 |
|
2225 TRAP(err, DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck )); |
|
2226 } |
|
2227 else if ( iInternalState == EStartupShowingWelcomeAnimation ) |
|
2228 { |
|
2229 TRAP(err, DoNextStartupPhaseL( EStartupShowingOperatorAnimation )); |
|
2230 } |
|
2231 else if ( iInternalState == EStartupShowingOperatorAnimation ) |
|
2232 { |
|
2233 TRAP(err, DoNextStartupPhaseL( EStartupShowingUserWelcomeNote )); |
|
2234 } |
|
2235 |
|
2236 if ( err != KErrNone ) |
|
2237 { |
|
2238 TRAP_IGNORE( DoNextStartupPhaseL(EStartupSystemFatalError) ); |
|
2239 } |
|
2240 |
|
2241 TRACES("CStartupAppUi::AnimationFinished(): End"); |
|
2242 } |
|
2243 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2244 // --------------------------------------------------------------------------- |
|
2245 // CStartupAppUi::StopStartupTone() |
|
2246 // --------------------------------------------------------------------------- |
|
2247 void CStartupAppUi::StopStartupTone() |
|
2248 { |
|
2249 TRACES("CStartupAppUi::StopStartupTone()"); |
|
2250 if ((iStartupTone) && (iStartupTone->Playing())) |
|
2251 { |
|
2252 iStartupTone->Stop(); |
|
2253 } |
|
2254 TRACES("CStartupAppUi::StopStartupTone(): End"); |
|
2255 } |
|
2256 |
|
2257 // --------------------------------------------------------------------------- |
|
2258 // CStartupAppUi::StopOperatorTone() |
|
2259 // --------------------------------------------------------------------------- |
|
2260 void CStartupAppUi::StopOperatorTone() |
|
2261 { |
|
2262 TRACES("CStartupAppUi::StopOperatorTone()"); |
|
2263 if ((iOpStartupTone) && (iOpStartupTone->Playing())) |
|
2264 { |
|
2265 iOpStartupTone->Stop(); |
|
2266 } |
|
2267 TRACES("CStartupAppUi::StopOperatorTone(): End"); |
|
2268 } |
|
2269 |
|
2270 // --------------------------------------------------------------------------- |
|
2271 // CStartupAppUi::StartupTonePlaying() |
|
2272 // --------------------------------------------------------------------------- |
|
2273 TBool CStartupAppUi::StartupTonePlaying() |
|
2274 { |
|
2275 TRACES("CStartupAppUi::StartupTonePlaying()"); |
|
2276 return iStartupTone->Playing(); |
|
2277 } |
|
2278 |
|
2279 // --------------------------------------------------------------------------- |
|
2280 // CStartupAppUi::OperatorTonePlaying() |
|
2281 // --------------------------------------------------------------------------- |
|
2282 TBool CStartupAppUi::OperatorTonePlaying() |
|
2283 { |
|
2284 TRACES("CStartupAppUi::OperatorTonePlaying()"); |
|
2285 return iOpStartupTone->Playing(); |
|
2286 } |
|
2287 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2288 |
|
2289 // --------------------------------------------------------------------------- |
|
2290 // CStartupAppUi::SetCleanBoot() |
|
2291 // --------------------------------------------------------------------------- |
|
2292 void CStartupAppUi::SetCleanBoot() |
|
2293 { |
|
2294 TRACES("CStartupAppUi::SetCleanBoot()"); |
|
2295 iCleanBoot = EStartupCleanBoot; |
|
2296 TRACES("CStartupAppUi::SetCleanBoot(): End"); |
|
2297 } |
|
2298 |
|
2299 // ---------------------------------------------------------------------------- |
|
2300 // CStartupAppUi::SimSupported() |
|
2301 // ---------------------------------------------------------------------------- |
|
2302 TBool CStartupAppUi::SimSupported() |
|
2303 { |
|
2304 TRACES("CStartupAppUi::SimSupported()"); |
|
2305 return iSimSupported; |
|
2306 } |
|
2307 |
|
2308 // ---------------------------------------------------------------------------- |
|
2309 // CStartupAppUi::CoverUISupported() |
|
2310 // ---------------------------------------------------------------------------- |
|
2311 TBool CStartupAppUi::CoverUISupported() |
|
2312 { |
|
2313 TRACES("CStartupAppUi::CoverUISupported()"); |
|
2314 return iCoverUISupported; |
|
2315 } |
|
2316 |
|
2317 // --------------------------------------------------------------------------- |
|
2318 // CStartupAppUi::DoNextStartupPhaseL( TStartupInternalState toState ) |
|
2319 // State# Possible next states |
|
2320 |
|
2321 |
|
2322 // 0 EStartupStartingUp 1, 18 |
|
2323 // 1 EStartupWaitingCriticalBlock 5, 18 |
|
2324 // 5 EStartupWaitingTouchScreenCalib |
|
2325 // 6 EStartupWaitingPhoneLightIdle 8, 18 |
|
2326 // 8 EStartupOfflineModeQuery 9, 18 |
|
2327 // 9 EStartupWaitingCUIWelcomeAnim 10, 18 |
|
2328 // 10 EStartupWaitingStartupTone 11, 18 |
|
2329 // 11 EStartupShowingWelcomeAnimation 12, 14, 18 |
|
2330 // 12 EStartupWaitingCUIOperatorAnim 13, 18 |
|
2331 // 13 EStartupShowingOperatorAnimation 14, 14, 18 |
|
2332 // 14 EStartupShowingUserWelcomeNote 15, 18 |
|
2333 // 15 EStartupFirstBootAndRTCCheck 16, 18 |
|
2334 // 16 EStartupWaitingCUIStartupReady 17, 18 |
|
2335 // 17 EStartupStartupOK - |
|
2336 // 18 EStartupSystemFatalError - |
|
2337 |
|
2338 // --------------------------------------------------------------------------- |
|
2339 |
|
2340 void CStartupAppUi::DoNextStartupPhaseL( TStartupInternalState toState ) |
|
2341 { |
|
2342 TRACES("CStartupAppUi::DoNextStartupPhaseL()"); |
|
2343 TRACES2("CStartupAppUi::DoNextStartupPhaseL(): Change internal state from %d to %d", iInternalState, toState ); |
|
2344 |
|
2345 switch( iInternalState ) |
|
2346 { |
|
2347 case EStartupStartingUp: |
|
2348 { |
|
2349 switch( toState ) |
|
2350 { |
|
2351 case EStartupWaitingCriticalBlock: |
|
2352 iInternalState = EStartupWaitingCriticalBlock; |
|
2353 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingCriticalBlock"); |
|
2354 WaitingCriticalBlockEndingL(); |
|
2355 break; |
|
2356 case EStartupSystemFatalError: |
|
2357 SystemFatalErrorL(); |
|
2358 break; |
|
2359 default: |
|
2360 __ASSERT_DEBUG( EFalse, |
|
2361 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2362 break; |
|
2363 } |
|
2364 } |
|
2365 break; |
|
2366 case EStartupWaitingCriticalBlock: |
|
2367 { |
|
2368 switch( toState ) |
|
2369 { |
|
2370 case EStartupWaitingCUIStartupReady: |
|
2371 iInternalState = EStartupWaitingCUIStartupReady; |
|
2372 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingCUIStartupReady"); |
|
2373 WaitingCoverUIStartupReadySyncL(); |
|
2374 break; |
|
2375 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2376 case EStartupWaitingTouchScreenCalib: |
|
2377 iInternalState = EStartupWaitingTouchScreenCalib; |
|
2378 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingTouchScreenCalib"); |
|
2379 WaitingTouchScreenCalibL(); |
|
2380 break; |
|
2381 case EStartupSystemFatalError: |
|
2382 SystemFatalErrorL(); |
|
2383 break; |
|
2384 default: |
|
2385 __ASSERT_DEBUG( |
|
2386 EFalse, |
|
2387 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2388 break; |
|
2389 } |
|
2390 } |
|
2391 break; |
|
2392 case EStartupWaitingTouchScreenCalib: |
|
2393 { |
|
2394 switch( toState ) |
|
2395 { |
|
2396 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2397 case EStartupOfflineModeQuery: |
|
2398 iInternalState = EStartupOfflineModeQuery; |
|
2399 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupOfflineModeQuery"); |
|
2400 ShowOfflineModeQueryL(); |
|
2401 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2402 DoNextStartupPhaseL( EStartupWaitingShowStartupAnimation ); |
|
2403 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2404 DoNextStartupPhaseL( EStartupWaitingCUIWelcomeAnim ); |
|
2405 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2406 break; |
|
2407 case EStartupSystemFatalError: |
|
2408 SystemFatalErrorL(); |
|
2409 break; |
|
2410 default: |
|
2411 __ASSERT_DEBUG( |
|
2412 EFalse, |
|
2413 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2414 break; |
|
2415 } |
|
2416 } |
|
2417 break; |
|
2418 case EStartupOfflineModeQuery: |
|
2419 { |
|
2420 switch( toState ) |
|
2421 { |
|
2422 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2423 case EStartupWaitingShowStartupAnimation: |
|
2424 iInternalState = EStartupWaitingShowStartupAnimation; |
|
2425 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingShowStartupAnimation"); |
|
2426 WaitingStartupAnimationStartL(); |
|
2427 break; |
|
2428 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2429 case EStartupWaitingCUIWelcomeAnim: |
|
2430 iInternalState = EStartupWaitingCUIWelcomeAnim; |
|
2431 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingCUIWelcomeAnim"); |
|
2432 WaitingCoverUIWelcomeAnimationSyncL(); |
|
2433 break; |
|
2434 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2435 case EStartupSystemFatalError: |
|
2436 SystemFatalErrorL(); |
|
2437 break; |
|
2438 default: |
|
2439 __ASSERT_DEBUG( |
|
2440 EFalse, |
|
2441 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2442 break; |
|
2443 } |
|
2444 } |
|
2445 break; |
|
2446 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2447 case EStartupWaitingCUIWelcomeAnim: |
|
2448 { |
|
2449 switch( toState ) |
|
2450 { |
|
2451 case EStartupWaitingStartupTone: |
|
2452 iInternalState = EStartupWaitingStartupTone; |
|
2453 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingStartupTone"); |
|
2454 WaitingStartupToneL(); |
|
2455 break; |
|
2456 case EStartupSystemFatalError: |
|
2457 SystemFatalErrorL(); |
|
2458 break; |
|
2459 default: |
|
2460 __ASSERT_DEBUG( EFalse, |
|
2461 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2462 break; |
|
2463 } |
|
2464 } |
|
2465 break; |
|
2466 case EStartupWaitingStartupTone: |
|
2467 { |
|
2468 switch( toState ) |
|
2469 { |
|
2470 case EStartupShowingWelcomeAnimation: |
|
2471 iInternalState = EStartupShowingWelcomeAnimation; |
|
2472 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupShowingWelcomeAnimation"); |
|
2473 iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeAnimStart ); |
|
2474 iWelcomeAnimation->DrawNow(); |
|
2475 DoStartupShowWelcomeAnimationL(); |
|
2476 iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeAnimEnd ); |
|
2477 iWelcomeAnimation->DrawNow(); |
|
2478 break; |
|
2479 case EStartupSystemFatalError: |
|
2480 SystemFatalErrorL(); |
|
2481 break; |
|
2482 default: |
|
2483 __ASSERT_DEBUG( EFalse, |
|
2484 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2485 break; |
|
2486 } |
|
2487 } |
|
2488 break; |
|
2489 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2490 case EStartupWaitingShowStartupAnimation: |
|
2491 { |
|
2492 switch( toState ) |
|
2493 { |
|
2494 case EStartupShowingWelcomeAnimation: |
|
2495 iInternalState = EStartupShowingWelcomeAnimation; |
|
2496 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupShowingWelcomeAnimation"); |
|
2497 DoStartupShowWelcomeAnimationL(); |
|
2498 break; |
|
2499 case EStartupSystemFatalError: |
|
2500 SystemFatalErrorL(); |
|
2501 break; |
|
2502 default: |
|
2503 __ASSERT_DEBUG( |
|
2504 EFalse, |
|
2505 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2506 break; |
|
2507 } |
|
2508 } |
|
2509 break; |
|
2510 case EStartupShowingWelcomeAnimation: |
|
2511 { |
|
2512 switch( toState ) |
|
2513 { |
|
2514 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2515 case EStartupShowingOperatorAnimation: |
|
2516 iInternalState = EStartupShowingOperatorAnimation; |
|
2517 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState: EStartupShowingOperatorAnimation"); |
|
2518 DoStartupShowOperatorAnimationL(); |
|
2519 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2520 case EStartupWaitingCUIOperatorAnim: |
|
2521 iOperatorAnimation = CStartupOperatorAnimation::NewL( this, ClientRect()); |
|
2522 AddToStackL( iOperatorAnimation); |
|
2523 iInternalState = EStartupWaitingCUIOperatorAnim; |
|
2524 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState: EStartupWaitingCUIOperatorAnim"); |
|
2525 WaitingCoverUIOperatorAnimationSyncL(); |
|
2526 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2527 break; |
|
2528 case EStartupFirstBootAndRTCCheck: |
|
2529 iInternalState = EStartupFirstBootAndRTCCheck; |
|
2530 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupFirstBootAndRTCCheck"); |
|
2531 DoStartupFirstBootAndRTCCheckL(); |
|
2532 break; |
|
2533 case EStartupSystemFatalError: |
|
2534 SystemFatalErrorL(); |
|
2535 break; |
|
2536 default: |
|
2537 __ASSERT_DEBUG( EFalse, |
|
2538 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2539 break; |
|
2540 } |
|
2541 } |
|
2542 break; |
|
2543 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2544 case EStartupWaitingCUIOperatorAnim: |
|
2545 { |
|
2546 switch( toState ) |
|
2547 { |
|
2548 case EStartupShowingOperatorAnimation: |
|
2549 iInternalState = EStartupShowingOperatorAnimation; |
|
2550 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState: EStartupShowingOperatorAnimation"); |
|
2551 iOperatorAnimation->UpdateDrawInfo( EStartupDIOperatorAnimStart ); |
|
2552 DoStartupShowOperatorAnimationL(); |
|
2553 break; |
|
2554 case EStartupSystemFatalError: |
|
2555 SystemFatalErrorL(); |
|
2556 break; |
|
2557 default: |
|
2558 __ASSERT_DEBUG( EFalse, |
|
2559 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2560 break; |
|
2561 } |
|
2562 } |
|
2563 break; |
|
2564 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2565 case EStartupShowingOperatorAnimation: |
|
2566 { |
|
2567 switch( toState ) |
|
2568 { |
|
2569 case EStartupShowingUserWelcomeNote: |
|
2570 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2571 iUserWelcomeNote = CStartupUserWelcomeNote::NewL( *this, ClientRect()); |
|
2572 AddToStackL( iUserWelcomeNote ); |
|
2573 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2574 iInternalState = EStartupShowingUserWelcomeNote; |
|
2575 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState: EStartupShowingUserWelcomeNote"); |
|
2576 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2577 iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeNoteStart ); |
|
2578 iUserWelcomeNote->SetUserWelcomeNoteShowing(ETrue); |
|
2579 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2580 DoStartupShowUserWelcomeNoteL(); |
|
2581 break; |
|
2582 case EStartupFirstBootAndRTCCheck: |
|
2583 iInternalState = EStartupFirstBootAndRTCCheck; |
|
2584 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupFirstBootAndRTCCheck"); |
|
2585 DoStartupFirstBootAndRTCCheckL(); |
|
2586 break; |
|
2587 case EStartupSystemFatalError: |
|
2588 SystemFatalErrorL(); |
|
2589 break; |
|
2590 default: |
|
2591 __ASSERT_DEBUG( EFalse, |
|
2592 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2593 break; |
|
2594 } |
|
2595 } |
|
2596 break; |
|
2597 case EStartupShowingUserWelcomeNote: |
|
2598 { |
|
2599 switch( toState ) |
|
2600 { |
|
2601 case EStartupFirstBootAndRTCCheck: |
|
2602 iInternalState = EStartupFirstBootAndRTCCheck; |
|
2603 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupFirstBootAndRTCCheck"); |
|
2604 DoStartupFirstBootAndRTCCheckL(); |
|
2605 break; |
|
2606 case EStartupSystemFatalError: |
|
2607 SystemFatalErrorL(); |
|
2608 break; |
|
2609 default: |
|
2610 __ASSERT_DEBUG( EFalse, |
|
2611 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2612 break; |
|
2613 } |
|
2614 } |
|
2615 break; |
|
2616 case EStartupFirstBootAndRTCCheck: |
|
2617 { |
|
2618 switch( toState ) |
|
2619 { |
|
2620 case EStartupWaitingCUIStartupReady: |
|
2621 iInternalState = EStartupWaitingCUIStartupReady; |
|
2622 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingCUIStartupReady"); |
|
2623 WaitingCoverUIStartupReadySyncL(); |
|
2624 break; |
|
2625 case EStartupSystemFatalError: |
|
2626 SystemFatalErrorL(); |
|
2627 break; |
|
2628 default: |
|
2629 __ASSERT_DEBUG( EFalse, |
|
2630 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2631 break; |
|
2632 } |
|
2633 } |
|
2634 break; |
|
2635 case EStartupWaitingCUIStartupReady: |
|
2636 { |
|
2637 switch( toState ) |
|
2638 { |
|
2639 case EStartupStartupOK: |
|
2640 iInternalState = EStartupStartupOK; |
|
2641 TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupStartupOK"); |
|
2642 DoStartupEndPart(); |
|
2643 break; |
|
2644 case EStartupSystemFatalError: |
|
2645 SystemFatalErrorL(); |
|
2646 break; |
|
2647 default: |
|
2648 __ASSERT_DEBUG( EFalse, |
|
2649 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2650 break; |
|
2651 } |
|
2652 } |
|
2653 break; |
|
2654 case EStartupSystemFatalError: |
|
2655 { |
|
2656 switch( toState ) |
|
2657 { |
|
2658 case EStartupStartingUp: |
|
2659 case EStartupOfflineModeQuery: |
|
2660 case EStartupShowingWelcomeAnimation: |
|
2661 case EStartupShowingOperatorAnimation: |
|
2662 case EStartupShowingUserWelcomeNote: |
|
2663 case EStartupFirstBootAndRTCCheck: |
|
2664 case EStartupWaitingCUIStartupReady: |
|
2665 case EStartupStartupOK: |
|
2666 case EStartupSystemFatalError: |
|
2667 //no need to continue, because state is |
|
2668 //already in EStartupSystemFatalError |
|
2669 //so stop the execution of the other branch of |
|
2670 //the startup application. The other |
|
2671 //is displayin the "Selftest failed. Contact service"-dialog. |
|
2672 TRACES1("CStartupAppUi::DoNextStartupPhaseL(): InternalState : from EStartupSystemFatalError to %d -> so stop here.", toState ); |
|
2673 break; |
|
2674 default: |
|
2675 __ASSERT_DEBUG( EFalse, |
|
2676 PANIC( EStartupInvalidInternalStateChange ) ); |
|
2677 break; |
|
2678 } |
|
2679 } |
|
2680 break; |
|
2681 default: |
|
2682 __ASSERT_DEBUG( EFalse, PANIC( EStartupInvalidInternalStateChange ) ); |
|
2683 break; |
|
2684 } |
|
2685 } |
|
2686 |
|
2687 |
|
2688 // --------------------------------------------------------------------------- |
|
2689 // CStartupAppUi::SystemFatalErrorL() |
|
2690 // Call this only from DoNextStartupPhaseL() |
|
2691 // --------------------------------------------------------------------------- |
|
2692 void CStartupAppUi::SystemFatalErrorL() |
|
2693 { |
|
2694 TRACES("CStartupAppUi::SystemFatalErrorL()"); |
|
2695 |
|
2696 iInternalState = EStartupSystemFatalError; |
|
2697 |
|
2698 TRACES("CStartupAppUi::SystemFatalErrorL(): End"); |
|
2699 } |
|
2700 |
|
2701 // --------------------------------------------------------------------------- |
|
2702 // CStartupAppUi::SimStatusChangedReset() |
|
2703 // --------------------------------------------------------------------------- |
|
2704 TBool CStartupAppUi::SimStatusChangedReset() |
|
2705 { |
|
2706 TRACES( "CStartupAppUi::SimStatusChangedReset()" ); |
|
2707 TBool ret_val( EFalse ); |
|
2708 if( !iFirstBoot ) |
|
2709 { |
|
2710 TInt startupReason( 0 ); |
|
2711 RProperty::Get( KPSUidStartup, KPSStartupReason, startupReason ); |
|
2712 ret_val = ( startupReason == ESIMStatusChangeReset ); |
|
2713 } |
|
2714 TRACES1( "CStartupAppUi::SimStatusChangedReset(): End, return %d", ret_val ); |
|
2715 return ret_val; |
|
2716 } |
|
2717 |
|
2718 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2719 // --------------------------------------------------------------------------- |
|
2720 // CStartupAppUi::UpdateStartupUiPhase() |
|
2721 // --------------------------------------------------------------------------- |
|
2722 void CStartupAppUi::UpdateStartupUiPhase( TInt aValue ) |
|
2723 { |
|
2724 TRACES1("CStartupAppUi::UpdateStartupUiPhase(): aValue=%d", aValue); |
|
2725 |
|
2726 TInt err = RProperty::Set( KPSUidStartup, KPSStartupUiPhase, aValue ); |
|
2727 |
|
2728 if( KErrNone != err ) |
|
2729 { |
|
2730 TRACES1("CStartupAppUi::UpdateStartupUiPhase(): KPSStartupUiPhase set err %d", err); |
|
2731 } |
|
2732 } |
|
2733 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2734 // End of file |