1 /* |
1 /* |
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
37 #include <starterclient.h> |
37 #include <starterclient.h> |
38 #include <syslangutil.h> // default language |
38 #include <syslangutil.h> // default language |
39 |
39 |
40 #include <secui.h> // security UI |
40 #include <secui.h> // security UI |
41 #include <secuisecurityhandler.h> |
41 #include <secuisecurityhandler.h> |
42 #include <StringLoader.h> |
42 |
|
43 #include <aknnotewrappers.h> |
|
44 #include <AknQueryDialog.h> |
|
45 |
43 #include <hal.h> |
46 #include <hal.h> |
44 #include <centralrepository.h> |
47 #include <centralrepository.h> |
45 #include <CommonEngineDomainCRKeys.h> |
48 #include <CommonEngineDomainCRKeys.h> |
46 |
49 |
47 #include <data_caging_path_literals.hrh> |
50 #include <data_caging_path_literals.hrh> |
48 |
51 |
49 #include "CleanupResetPointer.h" |
52 #include "CleanupResetPointer.h" |
|
53 #include <AknWaitDialog.h> |
50 #include <pdpcontextmanagerpskeys.h> |
54 #include <pdpcontextmanagerpskeys.h> |
51 #include <pdpcontextmanagerinternalcrkeys.h> |
55 #include <pdpcontextmanagerinternalcrkeys.h> |
52 #include "rfsConnectionObserver.h" |
56 #include "rfsConnectionObserver.h" |
53 #include "rfsHandler.h" |
57 #include "rfsHandler.h" |
54 #include "rfsClient.h" |
58 #include "rfsClient.h" |
55 #include "RfsTraces.h" |
59 #include "RfsTraces.h" |
56 #include <hbdevicemessageboxsymbian.h> |
|
57 |
60 |
58 |
61 |
59 _LIT( KRfsResourceFileName, "Z:rfs.rsc"); |
62 _LIT( KRfsResourceFileName, "Z:rfs.rsc"); |
60 _LIT(KYes,"yes"); |
|
61 _LIT(KNo,"No"); |
|
62 |
63 |
63 // CONSTANTS |
64 // CONSTANTS |
64 const TInt KPhoneIndex = 0; |
65 const TInt KPhoneIndex = 0; |
65 const TInt KRfsHandlerActivated = 0x0001; |
66 const TInt KRfsHandlerActivated = 0x0001; |
66 const TInt KRfsHandlerPhoneModuleLoaded = 0x0002; |
67 const TInt KRfsHandlerPhoneModuleLoaded = 0x0002; |
184 } |
185 } |
185 RStarterSession startersession; |
186 RStarterSession startersession; |
186 if( startersession.Connect() == KErrNone ) |
187 if( startersession.Connect() == KErrNone ) |
187 { |
188 { |
188 // Displays information note to the user telling that the device will restart |
189 // Displays information note to the user telling that the device will restart |
189 HBufC* prompt = StringLoader::LoadLC( R_DEVICE_RESTART ); |
190 HBufC* prompt = iEnv->AllocReadResourceLC( R_DEVICE_RESTART ); |
190 |
191 CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue ); |
191 CHbDeviceMessageBoxSymbian* note = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EInformation); |
192 note->ExecuteLD( *prompt ); |
192 CleanupStack::PushL(note); |
193 CleanupStack::PopAndDestroy( prompt ); |
193 note->SetTextL(*prompt); |
194 |
194 //could have used show() but it is aynchronous and execution proceeds before note is seen so have used synchronous API exec() |
|
195 note->ExecL(); |
|
196 CleanupStack::PopAndDestroy(note); |
|
197 CleanupStack::PopAndDestroy( prompt ); |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 if (aType == ERfsNormal ) startersession.Reset( RStarterSession::ENormalRFSReset ); |
195 if (aType == ERfsNormal ) startersession.Reset( RStarterSession::ENormalRFSReset ); |
203 else if (aType == ERfsDeep ) startersession.Reset( RStarterSession::EDeepRFSReset ); |
196 else if (aType == ERfsDeep ) startersession.Reset( RStarterSession::EDeepRFSReset ); |
204 else startersession.Reset( RStarterSession::EUnknownReset ); |
197 else startersession.Reset( RStarterSession::EUnknownReset ); |
205 startersession.Close(); |
198 startersession.Close(); |
206 } |
199 } |
243 // CRfsHandler::Cancel() |
236 // CRfsHandler::Cancel() |
244 // ----------------------------------------------------------------------------- |
237 // ----------------------------------------------------------------------------- |
245 EXPORT_C void CRfsHandler::Cancel() |
238 EXPORT_C void CRfsHandler::Cancel() |
246 { |
239 { |
247 TRACES("CRfsHandler::Cancel()"); |
240 TRACES("CRfsHandler::Cancel()"); |
248 |
241 |
249 |
242 // delete confirmation query |
250 // delete security handler |
243 delete iQuery; |
|
244 iQuery = NULL; |
|
245 |
|
246 // delete security handler |
251 if ( iSecurityHandler ) |
247 if ( iSecurityHandler ) |
252 { |
248 { |
253 iSecurityHandler->CancelSecCodeQuery(); |
249 iSecurityHandler->CancelSecCodeQuery(); |
254 |
250 |
255 delete iSecurityHandler; |
251 delete iSecurityHandler; |
328 // CRfsHandler::AskConfirmationL() |
324 // CRfsHandler::AskConfirmationL() |
329 // ----------------------------------------------------------------------------- |
325 // ----------------------------------------------------------------------------- |
330 TBool CRfsHandler::AskConfirmationL( const TBool& aThisDestroyed, TRfsType aType ) |
326 TBool CRfsHandler::AskConfirmationL( const TBool& aThisDestroyed, TRfsType aType ) |
331 { |
327 { |
332 TRACES("CRfsHandler::AskConfirmationL()"); |
328 TRACES("CRfsHandler::AskConfirmationL()"); |
333 |
329 CleanupResetPointerPushL( iQuery ); |
334 |
330 |
|
331 // Show the confirmation query. |
|
332 |
|
333 iQuery = CAknQueryDialog::NewL(); // no tone as default |
|
334 |
335 TInt resourceId = ( aType == ERfsNormal ) ? R_CONFIRM_RFS : R_CONFIRM_DEEP_RFS; |
335 TInt resourceId = ( aType == ERfsNormal ) ? R_CONFIRM_RFS : R_CONFIRM_DEEP_RFS; |
336 HBufC* query = iEnv->AllocReadResourceLC( resourceId ); |
336 //iQuery->SetSize(); |
337 |
337 //iQuery->pref |
338 // Show the confirmation query. |
338 |
339 |
339 TBool ret = iQuery->ExecuteLD( resourceId ); |
340 CHbDeviceMessageBoxSymbian::TButtonId selection = CHbDeviceMessageBoxSymbian::QuestionL(*query, KYes, KNo); |
340 |
341 TBool ret; |
341 if ( aThisDestroyed ) |
342 if (selection == CHbDeviceMessageBoxSymbian::EAcceptButton) // user pressed yes |
342 { |
343 { |
343 // this object was destroyed |
344 ret=ETrue; |
344 ret = EFalse; |
345 } |
345 // remove cleanup item |
346 else |
346 CleanupStack::Pop(); |
347 { |
347 } |
348 ret=EFalse; |
348 else |
349 } |
349 { |
350 CleanupStack::PopAndDestroy(query); |
350 // NULLs iQuery |
351 return ret; |
351 CleanupStack::PopAndDestroy(); |
352 |
352 } |
|
353 |
|
354 return ret; |
353 } |
355 } |
354 |
356 |
355 // ----------------------------------------------------------------------------- |
357 // ----------------------------------------------------------------------------- |
356 // CRfsHandler::DoCleanup() |
358 // CRfsHandler::DoCleanup() |
357 // ----------------------------------------------------------------------------- |
359 // ----------------------------------------------------------------------------- |
437 ( wlanState == EPSWlanIndicatorActive || wlanState == EPSWlanIndicatorActiveSecure )) |
439 ( wlanState == EPSWlanIndicatorActive || wlanState == EPSWlanIndicatorActiveSecure )) |
438 #endif //__WINS__ |
440 #endif //__WINS__ |
439 { |
441 { |
440 HBufC* prompt = iEnv->AllocReadResourceLC( R_ACTIVE_CALLS ); |
442 HBufC* prompt = iEnv->AllocReadResourceLC( R_ACTIVE_CALLS ); |
441 |
443 |
442 CHbDeviceMessageBoxSymbian* note = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EInformation); |
444 CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue ); |
443 CleanupStack::PushL(note); |
445 |
444 note->SetTextL(*prompt); |
446 note->ExecuteLD( *prompt ); |
445 note->ShowL(); |
447 |
446 CleanupStack::PopAndDestroy( note ); |
448 CleanupStack::PopAndDestroy( prompt ); |
447 CleanupStack::PopAndDestroy( prompt ); |
|
448 |
|
449 return ETrue; |
449 return ETrue; |
450 } |
450 } |
451 |
451 |
452 return EFalse; |
452 return EFalse; |
453 } |
453 } |