50 #ifdef RD_REMOTELOCK |
50 #ifdef RD_REMOTELOCK |
51 #include <RemoteLockSettings.h> |
51 #include <RemoteLockSettings.h> |
52 #endif // RD_REMOTELOCK |
52 #endif // RD_REMOTELOCK |
53 #include <StringLoader.h> |
53 #include <StringLoader.h> |
54 #include <featmgr.h> |
54 #include <featmgr.h> |
|
55 |
|
56 #include "SecQueryUi.h" |
|
57 |
55 // LOCAL CONSTANTS AND MACROS |
58 // LOCAL CONSTANTS AND MACROS |
56 const TInt KMaxNumberOfPUKAttempts(10); |
59 const TInt KMaxNumberOfPUKAttempts(10); |
57 const TInt KMaxNumberOfPINAttempts(3); |
60 const TInt KMaxNumberOfPINAttempts(3); |
58 const TInt KLastRemainingInputAttempt(1); |
61 const TInt KLastRemainingInputAttempt(1); |
59 |
62 |
60 const TInt KTriesToConnectServer( 2 ); |
63 const TInt KTriesToConnectServer( 2 ); |
61 const TInt KTimeBeforeRetryingRequest( 50000 ); |
64 const TInt KTimeBeforeRetryingRequest( 50000 ); |
62 |
65 |
|
66 |
63 // ================= MEMBER FUNCTIONS ======================= |
67 // ================= MEMBER FUNCTIONS ======================= |
64 // |
68 // |
65 // ---------------------------------------------------------- |
69 // ---------------------------------------------------------- |
66 // CSecurityHandler::CSecurityHandler() |
70 // CSecurityHandler::CSecurityHandler() |
67 // C++ constructor |
71 // C++ constructor |
68 // ---------------------------------------------------------- |
72 // ---------------------------------------------------------- |
69 // |
73 // |
70 EXPORT_C CSecurityHandler::CSecurityHandler(RMobilePhone& aPhone): |
74 EXPORT_C CSecurityHandler::CSecurityHandler(RMobilePhone& aPhone): |
71 iPhone(aPhone), iQueryCanceled(ETrue), iSecurityDlg(NULL), iNoteDlg(NULL) |
75 iPhone(aPhone), iQueryCanceled(ETrue), iSecurityDlg(NULL), iNoteDlg(NULL) |
72 { |
76 { |
|
77 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
|
78 |
73 TInt result = iCustomPhone.Open(aPhone); |
79 TInt result = iCustomPhone.Open(aPhone); |
74 TRAP_IGNORE( FeatureManager::InitializeLibL() ); //Shouldn't this panic if FM does not initialise?? |
80 TRAP_IGNORE( FeatureManager::InitializeLibL() ); //Shouldn't this panic if FM does not initialise?? |
75 } |
81 } |
76 |
82 |
77 // |
83 // |
228 // code is the default one; no need to request it. |
243 // code is the default one; no need to request it. |
229 return ETrue; |
244 return ETrue; |
230 } |
245 } |
231 /* end check for default code */ |
246 /* end check for default code */ |
232 |
247 |
233 // Destructor sets thisDestroyed to ETrue |
|
234 TBool thisDestroyed( EFalse ); |
|
235 iDestroyedPtr = &thisDestroyed; |
|
236 |
248 |
237 iQueryCanceled = EFalse; |
249 iQueryCanceled = EFalse; |
238 RMobilePhone::TMobilePassword password; |
|
239 RMobilePhone::TMobilePassword required_fourth; |
250 RMobilePhone::TMobilePassword required_fourth; |
240 |
251 |
241 TInt ret = KErrNone; |
252 TInt ret = KErrNone; |
242 TInt err = KErrNone; |
253 TInt err = KErrNone; |
243 TInt status = KErrNone; |
254 TInt status = KErrNone; |
244 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) && |
255 |
245 FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
256 RMobilePhone::TMobilePassword iSecUi_password; |
246 { |
257 TBool queryAccepted = EFalse; |
247 // Connect to the SCP server, and request the code query |
258 |
248 RSCPClient scpClient; |
259 |
249 User::LeaveIfError( scpClient.Connect() ); |
260 while (!queryAccepted) |
250 CleanupClosePushL( scpClient ); |
261 { |
251 status = scpClient.SecCodeQuery( password, |
262 RMobilePhone::TMobilePhoneSecurityCode secCodeType; |
252 RSCPClient::SCP_OK_CANCEL, |
263 secCodeType = RMobilePhone::ESecurityCodePhonePassword; |
253 EFalse, |
264 |
254 0 ); |
265 /* request PIN using QT */ |
255 |
266 CSecQueryUi *iSecQueryUi; |
256 if ( status != KErrCancel ) |
267 RDebug::Printf( "%s %s (%u) CSecQueryUi=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
257 { |
268 iSecQueryUi = CSecQueryUi::NewL(); |
258 // Set this "true" to indicate that the input wasn't cancelled |
269 RDebug::Printf( "%s %s (%u) Copy=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
259 ret = ETrue; |
270 iSecUi_password.Copy(_L("666")); |
260 } |
271 RDebug::Printf( "%s %s (%u) InstallConfirmationQueryL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
261 else |
272 queryAccepted = iSecQueryUi->SecQueryDialog( _L("AskSecCodeL"), iSecUi_password, 4, 8, secCodeType /*aMode*/ ); |
262 { |
273 RDebug::Printf( "%s %s (%u) iSecUi_password=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
263 ret = EFalse; |
274 RDebug::Print( iSecUi_password ); |
264 } |
275 RDebug::Printf( "%s %s (%u) delete=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
265 |
276 delete iSecQueryUi; |
266 CleanupStack::PopAndDestroy(); //scpClient |
277 RDebug::Printf( "%s %s (%u) done=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
267 } |
278 if(queryAccepted) res=0xFFFFFFFE; // this is the value returned from iSecurityDlg |
268 else |
279 /* end request PIN using QT */ |
269 { |
|
270 iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiNone); |
|
271 #ifdef __COVER_DISPLAY |
|
272 iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup); |
|
273 CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided |
|
274 if (covercl) // returns null if __COVER_DISPLAY is not defined |
|
275 { |
|
276 // … - add data that cover ui is interested in |
|
277 covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowSecCode);// adds int to additional data to be posted to cover ui |
|
278 covercl->BufStream().CommitL(); // no more data to send so commit buf |
|
279 } |
|
280 #endif //__COVER_DISPLAY |
|
281 CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg); |
|
282 CleanupStack::PushL(deviceLockStatusObserver); |
|
283 err =KErrNone; |
|
284 TRAP(err,ret = iSecurityDlg->ExecuteLD(R_SECURITY_QUERY)); |
|
285 CleanupStack::PopAndDestroy(deviceLockStatusObserver); |
|
286 } |
|
287 |
|
288 // check if CSecurityHandler has been "killed" |
|
289 if ( thisDestroyed ) |
|
290 { |
|
291 return EFalse; |
|
292 } |
|
293 |
|
294 iDestroyedPtr = NULL; |
|
295 iSecurityDlg = NULL; |
|
296 |
|
297 if (err != KErrNone) |
|
298 { |
|
299 User::Leave(err); |
|
300 } |
|
301 |
|
302 if (ret) |
|
303 { |
|
304 while (!iQueryCanceled) |
|
305 { |
|
306 if (!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
|
307 { |
|
308 RMobilePhone::TMobilePhoneSecurityCode secCodeType; |
|
309 secCodeType = RMobilePhone::ESecurityCodePhonePassword; |
|
310 CWait* wait = CWait::NewL(); |
|
311 iPhone.VerifySecurityCode(wait->iStatus,secCodeType, password, required_fourth); |
|
312 status = wait->WaitForRequestL(); |
|
313 delete wait; |
|
314 |
280 |
315 } |
281 CWait* wait = CWait::NewL(); |
316 |
282 iPhone.VerifySecurityCode(wait->iStatus,secCodeType, iSecUi_password, required_fourth); |
|
283 status = wait->WaitForRequestL(); |
|
284 delete wait; |
|
285 |
|
286 ret = ETrue; |
|
287 if (!queryAccepted) |
|
288 { |
|
289 ret = EFalse; |
|
290 return ret; |
|
291 } |
|
292 queryAccepted = EFalse; // because it's not yet validated |
317 switch(status) |
293 switch(status) |
318 { |
294 { |
319 case KErrNone: |
295 case KErrNone: |
320 { |
296 { |
321 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) && |
297 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) && |
324 RSCPClient scpClient; |
300 RSCPClient scpClient; |
325 User::LeaveIfError( scpClient.Connect() ); |
301 User::LeaveIfError( scpClient.Connect() ); |
326 CleanupClosePushL( scpClient ); |
302 CleanupClosePushL( scpClient ); |
327 |
303 |
328 TSCPSecCode newCode; |
304 TSCPSecCode newCode; |
329 newCode.Copy( password ); |
305 newCode.Copy( iSecUi_password ); |
330 scpClient.StoreCode( newCode ); |
306 scpClient.StoreCode( newCode ); |
331 |
307 |
332 CleanupStack::PopAndDestroy(); //scpClient |
308 CleanupStack::PopAndDestroy(); //scpClient |
|
309 queryAccepted = ETrue; |
333 } |
310 } |
334 |
311 |
335 iQueryCanceled = ETrue; |
312 iQueryCanceled = ETrue; // TODO |
336 return ETrue; |
313 return ETrue; |
337 } |
314 } |
338 case KErrGsmSSPasswordAttemptsViolation: |
315 case KErrGsmSSPasswordAttemptsViolation: |
339 case KErrLocked: |
316 case KErrLocked: |
340 { |
317 { |
341 iDestroyedPtr = &thisDestroyed; |
|
342 // security code blocked! |
318 // security code blocked! |
343 iNoteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&iNoteDlg)); |
319 CSecuritySettings::ShowResultNoteL(R_SEC_BLOCKED, CAknNoteDialog::EErrorTone); // TODO |
344 iNoteDlg->SetTimeout(CAknNoteDialog::ELongTimeout); |
|
345 iNoteDlg->SetTone(CAknNoteDialog::EErrorTone); |
|
346 err =KErrNone; |
|
347 TRAP(err,iNoteDlg->ExecuteLD(R_SEC_BLOCKED)); |
|
348 |
|
349 // check if CSecurityHandler has been "killed" |
|
350 if ( thisDestroyed ) |
|
351 { |
|
352 return EFalse; |
|
353 } |
|
354 |
|
355 iDestroyedPtr = NULL; |
|
356 iNoteDlg = NULL; |
|
357 |
|
358 if (err != KErrNone) |
|
359 { |
|
360 User::Leave(err); |
|
361 } |
|
362 break; |
320 break; |
363 } |
321 } |
364 case KErrGsm0707IncorrectPassword: |
322 case KErrGsm0707IncorrectPassword: |
365 case KErrAccessDenied: |
323 case KErrAccessDenied: |
366 { |
324 { |
367 iDestroyedPtr = &thisDestroyed; |
|
368 // code was entered erroneusly |
325 // code was entered erroneusly |
369 iNoteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&iNoteDlg)); |
326 CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); // TODO |
370 iNoteDlg->SetTimeout(CAknNoteDialog::ELongTimeout); |
|
371 iNoteDlg->SetTone(CAknNoteDialog::EErrorTone); |
|
372 err =KErrNone; |
|
373 TRAP(err,iNoteDlg->ExecuteLD(R_CODE_ERROR)); |
|
374 |
|
375 // check if CSecurityHandler has been "killed" |
|
376 if ( thisDestroyed ) |
|
377 { |
|
378 return EFalse; |
|
379 } |
|
380 |
|
381 iDestroyedPtr = NULL; |
|
382 iNoteDlg = NULL; |
|
383 |
|
384 if (err != KErrNone) |
|
385 { |
|
386 User::Leave(err); |
|
387 } |
|
388 break; |
|
389 } |
327 } |
390 default: |
328 default: |
391 { |
329 { |
392 iDestroyedPtr = &thisDestroyed; |
330 CSecuritySettings::ShowResultNoteL(status, CAknNoteDialog::EErrorTone); // TODO |
393 err =KErrNone; |
|
394 TRAP(err,ShowGenericErrorNoteL(status)); |
|
395 |
|
396 // check if CSecurityHandler has been "killed" |
|
397 if ( thisDestroyed ) |
|
398 { |
|
399 return EFalse; |
|
400 } |
|
401 |
|
402 iDestroyedPtr = NULL; |
|
403 iNoteDlg = NULL; |
|
404 |
|
405 if (err != KErrNone) |
|
406 { |
|
407 User::Leave(err); |
|
408 } |
|
409 break; |
|
410 } |
331 } |
411 } |
332 } |
412 |
|
413 if (iQueryCanceled) |
|
414 { |
|
415 ret = EFalse; |
|
416 break; |
|
417 } |
|
418 |
|
419 password = _L(""); |
|
420 iDestroyedPtr = &thisDestroyed; |
|
421 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) && |
|
422 FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
|
423 { |
|
424 // Connect to the SCP server, and request the code query |
|
425 RSCPClient scpClient; |
|
426 User::LeaveIfError( scpClient.Connect() ); |
|
427 CleanupClosePushL( scpClient ); |
|
428 status = scpClient.SecCodeQuery( password, |
|
429 RSCPClient::SCP_OK_CANCEL, |
|
430 EFalse, |
|
431 0 ); |
|
432 |
|
433 if ( status != KErrCancel ) |
|
434 { |
|
435 // Set this "true" to indicate that the input wasn't cancelled |
|
436 ret = ETrue; |
|
437 } |
|
438 else |
|
439 { |
|
440 ret = EFalse; |
|
441 } |
|
442 |
|
443 CleanupStack::PopAndDestroy(); //scpClient |
|
444 } |
|
445 else |
|
446 { |
|
447 iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiNone); |
|
448 CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg); |
|
449 CleanupStack::PushL(deviceLockStatusObserver); |
|
450 err =KErrNone; |
|
451 TRAP(err,ret = iSecurityDlg->ExecuteLD(R_SECURITY_QUERY)); |
|
452 CleanupStack::PopAndDestroy(deviceLockStatusObserver); |
|
453 } |
|
454 |
|
455 // check if CSecurityHandler has been "killed" |
|
456 if ( thisDestroyed ) |
|
457 { |
|
458 return EFalse; |
|
459 } |
|
460 |
|
461 iDestroyedPtr = NULL; |
|
462 iSecurityDlg = NULL; |
|
463 |
|
464 if (err != KErrNone) |
|
465 { |
|
466 User::Leave(err); |
|
467 } |
|
468 |
|
469 if (!ret) |
|
470 break; |
|
471 } // while |
333 } // while |
472 } // if |
|
473 |
334 |
474 iQueryCanceled = ETrue; |
335 iQueryCanceled = ETrue; |
475 return ret; |
336 return ret; |
476 } |
337 } |
477 // |
338 // |
775 else |
641 else |
776 { |
642 { |
777 if (StartUp) |
643 if (StartUp) |
778 isConditionSatisfied = ETrue; |
644 isConditionSatisfied = ETrue; |
779 } |
645 } |
780 if (isConditionSatisfied) |
|
781 { |
|
782 #if defined(_DEBUG) |
646 #if defined(_DEBUG) |
783 RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Dialog 1")); |
647 RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Dialog 1")); |
784 #endif |
648 #endif |
785 // Security code at bootup: No "cancel" softkey; Emergency calls enabled. |
649 // Security code at bootup: No "cancel" softkey; Emergency calls enabled. |
786 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) && |
650 RMobilePhone::TMobilePhoneSecurityCode secCodeTypeToAsk = RMobilePhone::ESecurityCodePhonePassword; // for starters |
787 FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
651 |
788 { |
652 if (isConditionSatisfied) |
789 // Connect to the SCP server, and request the code query |
653 { |
790 RSCPClient scpClient; |
654 // starter or special TARM. NoCancel+Emergency |
791 User::LeaveIfError( scpClient.Connect() ); |
655 lCancelSupported = ESecUiCancelNotSupported; |
792 CleanupClosePushL( scpClient ); |
656 lEmergencySupported = ESecUiEmergencyNotSupported; |
793 |
657 } |
794 status = scpClient.SecCodeQuery( password, |
658 else if (autolockState > EAutolockOff) |
795 RSCPClient::SCP_OK_ETEL, |
659 { |
796 ETrue, |
660 // from unlock. Cancel+Emergency |
797 KSCPEtelRequest ); |
661 lCancelSupported = ESecUiCancelSupported; |
798 // Note that SecCodeQuery doesn't indicate the return value from the dialog |
662 lEmergencySupported = ESecUiEmergencySupported; |
799 |
663 } |
800 CleanupStack::PopAndDestroy(); //scpClient |
664 else |
801 } |
665 { |
802 else |
666 // from settings. Cancel+NoEmergency |
803 { |
667 lCancelSupported = ESecUiCancelSupported; |
804 CCodeQueryDialog* securityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiCodeEtelReqest); |
668 lEmergencySupported = ESecUiEmergencyNotSupported; |
805 if(AknLayoutUtils::PenEnabled()) |
669 } |
806 securityDlg->SetEmergencyCallSupportForCBA( ETrue ); |
670 |
807 else |
671 /* request PIN using QT */ |
808 securityDlg->SetEmergencyCallSupport(ETrue); |
672 status = KErrNone; |
809 #ifdef __COVER_DISPLAY |
673 CSecQueryUi *iSecQueryUi; |
810 securityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup); |
674 RDebug::Printf( "%s %s (%u) CSecQueryUi=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
811 CAknMediatorFacade* covercl = AknMediatorFacade(securityDlg); // uses MOP, so control provided |
675 iSecQueryUi = CSecQueryUi::NewL(); |
812 if (covercl) // returns null if __COVER_DISPLAY is not defined |
676 RDebug::Printf( "%s %s (%u) Copy=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
813 { |
677 iSecUi_password.Copy(_L("666")); |
814 // … - add data that cover ui is interested in |
678 RDebug::Printf( "%s %s (%u) SecQueryDialog aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, lCancelSupported | lEmergencySupported | secCodeTypeToAsk ); |
815 covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowSecCode); // adds int to additional data to be posted to cover ui |
679 queryAccepted = iSecQueryUi->SecQueryDialog( _L("PassPhraseRequiredL"), iSecUi_password, 4, 8, lCancelSupported | lEmergencySupported | secCodeTypeToAsk ); |
816 covercl->BufStream().CommitL(); // no more data to send so commit buf |
680 RDebug::Printf( "%s %s (%u) iSecUi_password=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
817 } |
681 RDebug::Print( iSecUi_password ); |
818 #endif //__COVER_DISPLAY |
682 RDebug::Printf( "%s %s (%u) delete=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
819 status = securityDlg->ExecuteLD(R_SECURITY_REQUEST_QUERY); |
683 delete iSecQueryUi; |
820 } |
684 RDebug::Printf( "%s %s (%u) done=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
821 } |
685 if(queryAccepted) status=0xFFFFFFFE; // this is the value returned from iSecurityDlg |
822 else if ( (autolockState > EAutolockOff)) |
686 /* end request PIN using QT */ |
823 { |
687 |
824 #if defined(_DEBUG) |
688 // TODO if Emergency was possible, then consider status == ESecUiEmergencyCall |
825 RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Dialog 2")); |
689 /* I don't think I need this |
826 #endif |
690 TInt secUiOriginatedQuery(ESecurityUIsETelAPIOriginated); |
827 // Autolock is On. Security event came from user pressing "unlock". |
691 RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); |
828 // Emergency call support must be enabled and there must be a "cancel" softkey. |
692 CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg); |
829 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) && |
693 */ |
830 FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
694 |
831 { |
695 TBool wasCancelledOrEmergency = EFalse; |
832 // Connect to the SCP server, and request the code query |
|
833 RSCPClient scpClient; |
|
834 User::LeaveIfError( scpClient.Connect() ); |
|
835 CleanupClosePushL( scpClient ); |
|
836 |
|
837 status = scpClient.SecCodeQuery( password, |
|
838 RSCPClient::SCP_OK_CANCEL, |
|
839 ETrue, |
|
840 KSCPEtelRequest ); |
|
841 // Note that SecCodeQuery doesn't indicate the return value from the dialog |
|
842 |
|
843 CleanupStack::PopAndDestroy(); //scpClient |
|
844 } |
|
845 else |
|
846 { |
|
847 CCodeQueryDialog* securityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiNone); |
|
848 if(AknLayoutUtils::PenEnabled()) |
|
849 securityDlg->SetEmergencyCallSupportForCBA( ETrue ); |
|
850 else |
|
851 securityDlg->SetEmergencyCallSupport(ETrue); |
|
852 #ifdef __COVER_DISPLAY |
|
853 securityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup); |
|
854 CAknMediatorFacade* covercl = AknMediatorFacade(securityDlg); // uses MOP, so control provided |
|
855 if (covercl) // returns null if __COVER_DISPLAY is not defined |
|
856 { |
|
857 // … - add data that cover ui is interested in |
|
858 covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowSecCode); // adds int to additional data to be posted to cover ui |
|
859 covercl->BufStream().CommitL(); // no more data to send so commit buf |
|
860 } |
|
861 #endif //__COVER_DISPLAY |
|
862 status = securityDlg->ExecuteLD(R_SECURITY_QUERY); |
|
863 } |
|
864 } |
|
865 else |
|
866 { |
|
867 #if defined(_DEBUG) |
|
868 RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Dialog 3")); |
|
869 #endif |
|
870 // Code query due to a setting change; "Cancel" softkey active; |
|
871 // no emergency call support. |
|
872 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) && |
|
873 FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
|
874 { |
|
875 // Connect to the SCP server, and request the code query |
|
876 RSCPClient scpClient; |
|
877 User::LeaveIfError( scpClient.Connect() ); |
|
878 CleanupClosePushL( scpClient ); |
|
879 |
|
880 status = scpClient.SecCodeQuery( password, |
|
881 RSCPClient::SCP_OK_CANCEL, |
|
882 EFalse, |
|
883 KSCPEtelRequest ); |
|
884 // Note that SecCodeQuery doesn't indicate the return value from the dialog |
|
885 |
|
886 CleanupStack::PopAndDestroy(); //scpClient |
|
887 } |
|
888 else |
|
889 { |
|
890 iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiNone); |
|
891 #ifdef __COVER_DISPLAY |
|
892 iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup); |
|
893 CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided |
|
894 if (covercl) // returns null if __COVER_DISPLAY is not defined |
|
895 { |
|
896 covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowSecCode); // adds int to additional data to be posted to cover ui |
|
897 covercl->BufStream().CommitL(); // no more data to send so commit buf |
|
898 } |
|
899 #endif //__COVER_DISPLAY |
|
900 // read a flag to see whether the query is SecUi originated. |
|
901 TInt secUiOriginatedQuery(ESecurityUIsETelAPIOriginated); |
|
902 RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); |
|
903 CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg); |
|
904 CleanupStack::PushL(deviceLockStatusObserver); |
|
905 CSecUiLockObserver* queryStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg, ESecUiRequestStateObserver); |
|
906 CleanupStack::PushL(queryStatusObserver); |
|
907 CSecUiLockObserver* callStatusObserver = NULL; |
|
908 if(secUiOriginatedQuery == ESecurityUIsSystemLockOriginated) |
|
909 { |
|
910 callStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg, ESecUiCallStateObserver); |
|
911 CleanupStack::PushL(callStatusObserver); |
|
912 } |
|
913 status = iSecurityDlg->ExecuteLD(R_SECURITY_QUERY); |
|
914 |
|
915 if(callStatusObserver == NULL) |
|
916 CleanupStack::PopAndDestroy(2); //deviceLockStatusObserver, queryStatusObserver |
|
917 else |
|
918 CleanupStack::PopAndDestroy(3); //deviceLockStatusObserver, queryStatusObserver, callStatusObserver |
|
919 iSecurityDlg = NULL; |
|
920 } |
|
921 } |
|
922 TBool isCondition = EFalse; |
|
923 if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
696 if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
924 { |
697 { |
925 if (!status || (status == ESecUiEmergencyCall) |
698 if (!status || (status == ESecUiEmergencyCall) |
926 || (status == EAknSoftkeyEmergencyCall) || (status == ESecUiDeviceLocked)) |
699 || (status == EAknSoftkeyEmergencyCall) || (status == ESecUiDeviceLocked)) |
927 isCondition = ETrue; |
700 wasCancelledOrEmergency = ETrue; |
928 } |
701 } |
929 else |
702 else |
930 { |
703 { |
931 if ( ( status == KErrCancel ) || (status == ESecUiEmergencyCall) || |
704 if ( ( status == KErrCancel ) || (status == ESecUiEmergencyCall) || |
932 (status == EAknSoftkeyEmergencyCall) || (status == ESecUiDeviceLocked)) |
705 (status == EAknSoftkeyEmergencyCall) || (status == ESecUiDeviceLocked)) |
933 isCondition = ETrue; |
706 wasCancelledOrEmergency = ETrue; |
934 } |
707 } |
935 if (isCondition) |
708 RDebug::Printf( "%s %s (%u) wasCancelledOrEmergency=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, wasCancelledOrEmergency ); |
|
709 if (wasCancelledOrEmergency) |
936 { |
710 { |
937 #if defined(_DEBUG) |
711 #if defined(_DEBUG) |
938 RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() DIALOG ERROR")); |
712 RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() DIALOG ERROR")); |
939 #endif |
713 #endif |
940 if (!StartUp) |
714 if (!StartUp) |
1174 { |
944 { |
1175 /***************************************************** |
945 /***************************************************** |
1176 * Series 60 Customer / ETel |
946 * Series 60 Customer / ETel |
1177 * Series 60 ETel API |
947 * Series 60 ETel API |
1178 *****************************************************/ |
948 *****************************************************/ |
1179 |
949 RDebug::Printf( "%s %s (%u) 11=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
1180 RMobilePhone::TMobilePassword password; |
950 |
|
951 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
|
952 RMobilePhone::TMobilePassword iSecUi_password; |
|
953 TInt lCancelSupported = ESecUiCancelNotSupported; |
|
954 TBool queryAccepted = EFalse; |
1181 RMobilePhone::TMobilePassword required_fourth; |
955 RMobilePhone::TMobilePassword required_fourth; |
1182 RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityCodePin1; |
956 RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityCodePin1; |
1183 RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; |
957 RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; |
1184 RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); |
958 RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); |
1185 TBool StartUp = ETrue; |
959 TBool StartUp = ETrue; |
1186 TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); |
960 TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); |
1187 TInt err = KErrNone; |
961 TInt err = KErrNone; |
1188 TInt res = KErrGeneral; |
962 TInt res = KErrGeneral; |
1189 CWait* wait = CWait::NewL(); |
963 CWait* wait = CWait::NewL(); |
1190 CleanupStack::PushL(wait); |
964 CleanupStack::PushL(wait); |
|
965 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1191 |
966 |
1192 |
967 |
1193 StartUp = iStartup; |
968 StartUp = iStartup; |
1194 |
969 |
1195 #if defined(_DEBUG) |
970 #if defined(_DEBUG) |
1196 RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL()")); |
971 RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL()")); |
1197 #endif |
972 #endif |
1198 |
973 |
|
974 RDebug::Printf( "%s %s (%u) StartUp=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, StartUp ); |
1199 if(!StartUp) |
975 if(!StartUp) |
1200 { |
976 { |
1201 // read a flag to see whether the query is SecUi originated. |
977 // read a flag to see whether the query is SecUi originated. For example, from CSecuritySettings::ChangePinRequestParamsL |
1202 err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); |
978 err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); |
1203 |
979 |
1204 if ( err != KErrNone ) |
980 if ( err != KErrNone ) |
1205 { |
981 { |
1206 #if defined(_DEBUG) |
982 #if defined(_DEBUG) |
1218 } |
994 } |
1219 #if defined(_DEBUG) |
995 #if defined(_DEBUG) |
1220 RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Execute dlg")); |
996 RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Execute dlg")); |
1221 #endif |
997 #endif |
1222 |
998 |
|
999 RDebug::Printf( "%s %s (%u) StartUp=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, StartUp ); |
|
1000 RDebug::Printf( "%s %s (%u) secUiOriginatedQuery=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, secUiOriginatedQuery ); |
|
1001 RDebug::Printf( "%s %s (%u) ESecurityUIsSecUIOriginated=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, ESecurityUIsSecUIOriginated ); |
|
1002 RDebug::Printf( "%s %s (%u) err=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, err ); |
1223 if(StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated) || (err != KErrNone)) |
1003 if(StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated) || (err != KErrNone)) |
1224 { |
1004 { |
1225 iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiCodeEtelReqest); |
1005 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1226 if(AknLayoutUtils::PenEnabled()) |
1006 lCancelSupported = ESecUiCancelSupported; |
1227 iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue ); |
1007 } |
1228 else |
1008 else |
1229 iSecurityDlg->SetEmergencyCallSupport(ETrue); |
1009 { |
1230 #ifdef __COVER_DISPLAY |
1010 /* TODO do I need this ? */ |
1231 iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup); |
1011 /* |
1232 CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided |
1012 CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg); |
1233 if (covercl) // returns null if __COVER_DISPLAY is not defined |
1013 CleanupStack::PushL(deviceLockStatusObserver); |
1234 { |
1014 CSecUiLockObserver* queryStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg, ESecUiRequestStateObserver); |
1235 // … - add data that cover ui is interested in |
1015 CleanupStack::PushL(queryStatusObserver); |
1236 covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowPIN1); // adds int to additional data to be posted to cover ui |
1016 ... |
1237 covercl->BufStream().CommitL(); // no more data to send so commit buf |
1017 CleanupStack::PopAndDestroy(2); //deviceLockStatusObserver, queryStatusObserver |
1238 } |
1018 */ |
1239 #endif //__COVER_DISPLAY |
1019 // it will be RMobilePhone::ESecurityCodePin1 , equivalent to ESecUiNone |
1240 |
1020 } |
1241 wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); |
1021 wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); |
1242 iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg); |
1022 iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg); |
1243 res = wait->WaitForRequestL(); |
1023 res = wait->WaitForRequestL(); |
1244 #if defined(_DEBUG) |
1024 #if defined(_DEBUG) |
1245 TInt attempts(codeInfo.iRemainingEntryAttempts); |
1025 TInt attempts(codeInfo.iRemainingEntryAttempts); |
1246 RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Remaining Attempts query status: %d"), res); |
1026 RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Remaining Attempts query status: %d"), res); |
1247 RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Remaining Attempts: %d"), attempts); |
1027 RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Remaining Attempts: %d"), attempts); |
1248 #endif |
1028 #endif |
|
1029 RDebug::Printf( "%s %s (%u) res=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, res ); |
|
1030 #ifdef __WINS__ |
|
1031 RDebug::Printf( "%s %s (%u) emulator can't read PIN attempts=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, res ); |
|
1032 res=KErrNone; |
|
1033 codeInfo.iRemainingEntryAttempts=3; |
|
1034 #endif |
|
1035 |
1249 User::LeaveIfError(res); |
1036 User::LeaveIfError(res); |
1250 |
1037 /* request PIN using QT */ |
1251 if(codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) |
1038 CSecQueryUi *iSecQueryUi; |
1252 res = iSecurityDlg->ExecuteLD(R_PIN_REQUEST_QUERY); |
1039 RDebug::Printf( "%s %s (%u) CSecQueryUi=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
1253 else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt) |
1040 iSecQueryUi = CSecQueryUi::NewL(); |
1254 { |
1041 RDebug::Printf( "%s %s (%u) Copy=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
1255 HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PIN_ATTEMPTS, codeInfo.iRemainingEntryAttempts); |
1042 iSecUi_password.Copy(_L("666")); |
1256 res = iSecurityDlg->ExecuteLD(R_PIN_REQUEST_QUERY, *queryPrompt); |
1043 RDebug::Printf( "%s %s (%u) SecQueryDialog=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
1257 CleanupStack::PopAndDestroy(queryPrompt); |
1044 // TODO use codeInfo.iRemainingEntryAttempts for setting the Caption |
1258 } |
1045 // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful |
1259 else |
1046 // TODO also support Emergency |
1260 { |
1047 queryAccepted = iSecQueryUi->SecQueryDialog( _L("Pin1RequiredL"), iSecUi_password, 4, 8, lCancelSupported | secCodeType /*aMode*/ ); |
1261 HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PIN_ATTEMPT); |
1048 RDebug::Printf( "%s %s (%u) iSecUi_password=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
1262 res = iSecurityDlg->ExecuteLD(R_PIN_REQUEST_QUERY, *queryPrompt); |
1049 RDebug::Print( iSecUi_password ); |
1263 CleanupStack::PopAndDestroy(queryPrompt); |
1050 RDebug::Printf( "%s %s (%u) delete=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
1264 } |
1051 delete iSecQueryUi; |
1265 |
1052 RDebug::Printf( "%s %s (%u) done=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
1266 iSecurityDlg = NULL; |
1053 if(queryAccepted) res=0xFFFFFFFE; // this is the value returned from iSecurityDlg |
1267 #if defined(_DEBUG) |
1054 // TODO handle emergency |
1268 RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Execute dlg RESULT: %d"), res); |
1055 /* end request PIN using QT */ |
1269 #endif |
1056 |
|
1057 RDebug::Printf( "%s %s (%u) res=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, res ); |
1270 if ((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall)) |
1058 if ((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall)) |
1271 { |
1059 { |
1272 #if defined(_DEBUG) |
1060 #if defined(_DEBUG) |
1273 RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() R_PIN_REQUEST_QUERY CANCEL!")); |
1061 RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() R_PIN_REQUEST_QUERY CANCEL!")); |
1274 #endif |
1062 #endif |
1275 CleanupStack::PopAndDestroy(wait); |
1063 CleanupStack::PopAndDestroy(wait); // TODO this is needed ??? |
1276 return KErrCancel; |
1064 return KErrCancel; |
1277 } |
1065 } |
1278 } |
1066 if( lCancelSupported && (!res || (res == ESecUiDeviceLocked))) |
1279 else |
1067 { |
1280 { |
1068 // cancel code request |
1281 iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone); |
|
1282 #ifdef __COVER_DISPLAY |
|
1283 iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup); |
|
1284 CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided |
|
1285 if (covercl) // returns null if __COVER_DISPLAY is not defined |
|
1286 { |
|
1287 // … - add data that cover ui is interested in |
|
1288 covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowPIN1); // adds int to additional data to be posted to cover ui |
|
1289 covercl->BufStream().CommitL(); // no more data to send so commit buf |
|
1290 } |
|
1291 #endif //__COVER_DISPLAY |
|
1292 |
|
1293 wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); |
|
1294 iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg); |
|
1295 res = wait->WaitForRequestL(); |
|
1296 User::LeaveIfError(res); |
|
1297 |
|
1298 CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg); |
|
1299 CleanupStack::PushL(deviceLockStatusObserver); |
|
1300 CSecUiLockObserver* queryStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg, ESecUiRequestStateObserver); |
|
1301 CleanupStack::PushL(queryStatusObserver); |
|
1302 |
|
1303 if(codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) |
|
1304 res = iSecurityDlg->ExecuteLD(R_PIN_QUERY); |
|
1305 else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt) |
|
1306 { |
|
1307 HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PIN_ATTEMPTS, codeInfo.iRemainingEntryAttempts ); |
|
1308 res = iSecurityDlg->ExecuteLD(R_PIN_QUERY, *queryPrompt); |
|
1309 CleanupStack::PopAndDestroy(queryPrompt); |
|
1310 } |
|
1311 else |
|
1312 { |
|
1313 HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PIN_ATTEMPT); |
|
1314 res = iSecurityDlg->ExecuteLD(R_PIN_QUERY, *queryPrompt); |
|
1315 CleanupStack::PopAndDestroy(queryPrompt); |
|
1316 } |
|
1317 |
|
1318 CleanupStack::PopAndDestroy(2); //deviceLockStatusObserver, queryStatusObserver |
|
1319 iSecurityDlg = NULL; |
|
1320 if( !res || (res == ESecUiDeviceLocked)) |
|
1321 { |
|
1322 #if defined(_DEBUG) |
|
1323 RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() R_PIN_QUERY cancel!")); |
|
1324 #endif |
|
1325 // cancel code request |
|
1326 iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePin1); |
1069 iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePin1); |
1327 CleanupStack::PopAndDestroy(wait); |
1070 CleanupStack::PopAndDestroy(wait); // TODO this is needed ??? |
1328 return KErrCancel; |
1071 return KErrCancel; |
1329 } |
1072 } |
1330 } |
1073 |
1331 #if defined(_DEBUG) |
1074 #if defined(_DEBUG) |
1332 RDebug::Print(_L("CSecurityNotifier::Pin1RequiredL()VerifySecurityCode")); |
1075 RDebug::Print(_L("CSecurityNotifier::Pin1RequiredL()VerifySecurityCode")); |
1333 #endif |
1076 #endif |
1334 iPhone.VerifySecurityCode(wait->iStatus,secCodeType, password, required_fourth); |
1077 |
|
1078 RDebug::Printf( "%s %s (%u) iSecUi_password=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
|
1079 RDebug::Print( iSecUi_password ); |
|
1080 iPhone.VerifySecurityCode(wait->iStatus,secCodeType, iSecUi_password, required_fourth); |
|
1081 |
1335 res = wait->WaitForRequestL(); |
1082 res = wait->WaitForRequestL(); |
1336 CleanupStack::PopAndDestroy(wait); |
1083 CleanupStack::PopAndDestroy(wait); |
1337 #if defined(_DEBUG) |
1084 #if defined(_DEBUG) |
1338 RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL() VerifySecurityCode STATUS: %d"), res); |
1085 RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL() VerifySecurityCode STATUS: %d"), res); |
1339 #endif |
1086 #endif |
1582 { |
1330 { |
1583 /***************************************************** |
1331 /***************************************************** |
1584 * Series 60 Customer / ETel |
1332 * Series 60 Customer / ETel |
1585 * Series 60 ETel API |
1333 * Series 60 ETel API |
1586 *****************************************************/ |
1334 *****************************************************/ |
|
1335 /* request PIN using QT */ |
|
1336 TBool queryAccepted = EFalse; |
|
1337 RMobilePhone::TMobilePassword iSecUi_password; |
|
1338 CSecQueryUi *iSecQueryUi; |
|
1339 RDebug::Printf( "%s %s (%u) CSecQueryUi=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
|
1340 iSecQueryUi = CSecQueryUi::NewL(); |
|
1341 RDebug::Printf( "%s %s (%u) Copy=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
|
1342 iSecUi_password.Copy(_L("666")); |
|
1343 RDebug::Printf( "%s %s (%u) SecQueryDialog=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
|
1344 queryAccepted = iSecQueryUi->SecQueryDialog( _L("Pin2RequiredL"), iSecUi_password, 4, 8, RMobilePhone::ESecurityCodePin2 /*aMode*/ ); |
|
1345 RDebug::Printf( "%s %s (%u) iSecUi_password=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
|
1346 RDebug::Print( iSecUi_password ); |
|
1347 RDebug::Printf( "%s %s (%u) delete=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
|
1348 delete iSecQueryUi; |
|
1349 RDebug::Printf( "%s %s (%u) done=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
|
1350 // if(queryAccepted) res=0xFFFFFFFE; // this is the value returned from iSecurityDlg |
|
1351 /* end request PIN using QT */ |
|
1352 |
|
1353 |
1587 #if defined(_DEBUG) |
1354 #if defined(_DEBUG) |
1588 RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL() BEGIN")); |
1355 RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL() BEGIN")); |
1589 #endif |
1356 #endif |
1590 RMobilePhone::TMobilePassword password; |
1357 RMobilePhone::TMobilePassword password; |
1591 RMobilePhone::TMobilePassword required_fourth; |
1358 RMobilePhone::TMobilePassword required_fourth; |