telephonyserverplugins/common_tsy/commontsy/src/mmcustomtsy/CMmCustomSecurityTsy.cpp
equal
deleted
inserted
replaced
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
14 // |
14 // |
15 |
15 |
16 |
16 |
17 |
17 |
18 // INCLUDE FILES |
18 // INCLUDE FILES |
|
19 |
|
20 #include "OstTraceDefinitions.h" |
|
21 #ifdef OST_TRACE_COMPILER_IN_USE |
|
22 #include "CMmCustomSecurityTsyTraces.h" |
|
23 #endif |
|
24 |
19 #include "CMmCustomSecurityTsy.h" |
25 #include "CMmCustomSecurityTsy.h" |
20 #include <ctsy/tflogger.h> |
|
21 #include "cmmphonegsmwcdmaext.h" |
26 #include "cmmphonegsmwcdmaext.h" |
22 #include <ctsy/serviceapi/mmtsy_ipcdefs.h> |
27 #include <ctsy/serviceapi/mmtsy_ipcdefs.h> |
23 #include <ctsy/pluginapi/cmmdatapackage.h> |
28 #include <ctsy/pluginapi/cmmdatapackage.h> |
24 |
29 |
25 // ======== MEMBER FUNCTIONS ======== |
30 // ======== MEMBER FUNCTIONS ======== |
30 |
35 |
31 void CMmCustomSecurityTsy::ConstructL( |
36 void CMmCustomSecurityTsy::ConstructL( |
32 CMmCustomTsy* aMmCustomTsy, |
37 CMmCustomTsy* aMmCustomTsy, |
33 CMmPhoneTsy* aMmPhoneTsy ) |
38 CMmPhoneTsy* aMmPhoneTsy ) |
34 { |
39 { |
35 TFLOGSTRING("TSY: CMmCustomSecurityTsy::ConstructL"); |
40 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMCUSTOMSECURITYTSY_CONSTRUCTL_1, "TSY: CMmCustomSecurityTsy::ConstructL"); |
36 iMmCustomTsy = aMmCustomTsy; |
41 iMmCustomTsy = aMmCustomTsy; |
37 iMmPhoneTsy = aMmPhoneTsy; |
42 iMmPhoneTsy = aMmPhoneTsy; |
38 |
43 |
39 // register securitytsy in the message manager |
44 // register securitytsy in the message manager |
40 iMmPhoneTsy->MessageManager()->RegisterTsyObject( |
45 iMmPhoneTsy->MessageManager()->RegisterTsyObject( |
56 |
61 |
57 CMmCustomSecurityTsy* CMmCustomSecurityTsy::NewL( |
62 CMmCustomSecurityTsy* CMmCustomSecurityTsy::NewL( |
58 CMmCustomTsy* aMmCustomTsy, |
63 CMmCustomTsy* aMmCustomTsy, |
59 CMmPhoneTsy* aPhoneTsy ) |
64 CMmPhoneTsy* aPhoneTsy ) |
60 { |
65 { |
61 TFLOGSTRING("TSY: CMmCustomSecurityTsy::NewL"); |
66 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMCUSTOMSECURITYTSY_NEWL_1, "TSY: CMmCustomSecurityTsy::NewL"); |
62 CMmCustomSecurityTsy* self = new (ELeave) CMmCustomSecurityTsy(); |
67 CMmCustomSecurityTsy* self = new (ELeave) CMmCustomSecurityTsy(); |
63 |
68 |
64 CleanupStack::PushL( self ); |
69 CleanupStack::PushL( self ); |
65 self->ConstructL( aMmCustomTsy, aPhoneTsy ); |
70 self->ConstructL( aMmCustomTsy, aPhoneTsy ); |
66 CleanupStack::Pop(); |
71 CleanupStack::Pop(); |
330 // |
335 // |
331 void CMmCustomSecurityTsy::Complete( |
336 void CMmCustomSecurityTsy::Complete( |
332 TInt aReqHandleType, |
337 TInt aReqHandleType, |
333 TInt aError ) |
338 TInt aError ) |
334 { |
339 { |
335 TFLOGSTRING3( "CustomTSY: CMmCustomSecurityTsy::Complete.\n\t ReqHandleType:%d \n\t Error:%d\n", aReqHandleType, aError ); |
340 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMCUSTOMSECURITYTSY_COMPLETE_1, "CustomTSY: CMmCustomSecurityTsy::Complete.\n\t ReqHandleType:%d \n\t Error:%d\n", aReqHandleType, aError ); |
336 // All possible TSY req handle types are listed in the |
341 // All possible TSY req handle types are listed in the |
337 // switch case below. |
342 // switch case below. |
338 switch ( aReqHandleType ) |
343 switch ( aReqHandleType ) |
339 { |
344 { |
340 case ESecurityRequestTypeCheckSecurityCode: |
345 case ESecurityRequestTypeCheckSecurityCode: |
368 if ( NULL != iTsyReqHandleStore->GetTsyReqHandle( |
373 if ( NULL != iTsyReqHandleStore->GetTsyReqHandle( |
369 ESecurityRequestTypeIsBlocked ) ) |
374 ESecurityRequestTypeIsBlocked ) ) |
370 { |
375 { |
371 return KErrServerBusy; |
376 return KErrServerBusy; |
372 } |
377 } |
373 TFLOGSTRING2( "TSY: CMmPhoneTsy::IsBlocked - Code to check: %d", *aCode ); |
378 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMCUSTOMSECURITYTSY_ISBLOCKED_1, "TSY: CMmPhoneTsy::IsBlocked - Code to check: %d", *aCode ); |
374 |
379 |
375 switch ( *aCode ) |
380 switch ( *aCode ) |
376 { |
381 { |
377 case RMmCustomAPI::ESecurityCodePin1: |
382 case RMmCustomAPI::ESecurityCodePin1: |
378 iCodeID = KSecCodePin; |
383 iCodeID = KSecCodePin; |
494 } |
499 } |
495 |
500 |
496 CMmDataPackage aPackage; |
501 CMmDataPackage aPackage; |
497 aPackage.PackData( &iCodeID, &iSecCode ); |
502 aPackage.PackData( &iCodeID, &iSecCode ); |
498 |
503 |
499 TFLOGSTRING2( "TSY: CMmCustomSecurityTsy::CheckSecurityCodeL iSecCode: %S", &iSecCode ); |
504 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMCUSTOMSECURITYTSY_CHECKSECURITYCODEL_1, "TSY: CMmCustomSecurityTsy::CheckSecurityCodeL iSecCode: %S", iSecCode ); |
500 TInt retValue ( iMmPhoneTsy->MessageManager()->HandleRequestL( |
505 TInt retValue ( iMmPhoneTsy->MessageManager()->HandleRequestL( |
501 ECustomCheckSecurityCodeIPC, &aPackage ) ); |
506 ECustomCheckSecurityCodeIPC, &aPackage ) ); |
502 |
507 |
503 // check result |
508 // check result |
504 if ( KErrNone != retValue ) |
509 if ( KErrNone != retValue ) |
521 // --------------------------------------------------------------------------- |
526 // --------------------------------------------------------------------------- |
522 // |
527 // |
523 void CMmCustomSecurityTsy::CompleteCheckSecurityCode( |
528 void CMmCustomSecurityTsy::CompleteCheckSecurityCode( |
524 TInt aErrorCode ) |
529 TInt aErrorCode ) |
525 { |
530 { |
526 TFLOGSTRING2("TSY: CMmCustomSecurityTsy::CompleteCheckSecurityCode - Error code: %d", aErrorCode ); |
531 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMCUSTOMSECURITYTSY_COMPLETECHECKSECURITYCODE_1, "TSY: CMmCustomSecurityTsy::CompleteCheckSecurityCode - Error code: %d", aErrorCode ); |
527 // reset req handle. Returns the deleted req handle |
532 // reset req handle. Returns the deleted req handle |
528 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
533 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
529 ESecurityRequestTypeCheckSecurityCode ); |
534 ESecurityRequestTypeCheckSecurityCode ); |
530 |
535 |
531 if ( ESecurityTsyReqHandleUnknown != reqHandle ) |
536 if ( ESecurityTsyReqHandleUnknown != reqHandle ) |
575 // (other items were commented in a header). |
580 // (other items were commented in a header). |
576 // --------------------------------------------------------------------------- |
581 // --------------------------------------------------------------------------- |
577 // |
582 // |
578 void CMmCustomSecurityTsy::CompleteCheckSecurityCodeCancel() |
583 void CMmCustomSecurityTsy::CompleteCheckSecurityCodeCancel() |
579 { |
584 { |
580 TFLOGSTRING("TSY: CMmCustomSecurityTsy::CompleteCheckSecurityCodeCancel"); |
585 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMCUSTOMSECURITYTSY_COMPLETECHECKSECURITYCODECANCEL_1, "TSY: CMmCustomSecurityTsy::CompleteCheckSecurityCodeCancel"); |
581 } |
586 } |
582 |
587 |
583 // --------------------------------------------------------------------------- |
588 // --------------------------------------------------------------------------- |
584 // CMmCustomSecurityTsy::DeliverCodeL |
589 // CMmCustomSecurityTsy::DeliverCodeL |
585 // Brings required code to the Custom TSY. |
590 // Brings required code to the Custom TSY. |
594 CMmDataPackage aPackage; |
599 CMmDataPackage aPackage; |
595 aPackage.PackData( &iSecCode ); |
600 aPackage.PackData( &iSecCode ); |
596 iMmPhoneTsy->MessageManager()->HandleRequestL( |
601 iMmPhoneTsy->MessageManager()->HandleRequestL( |
597 ECustomSecurityDeliverCodeIPC, &aPackage ); |
602 ECustomSecurityDeliverCodeIPC, &aPackage ); |
598 |
603 |
599 TFLOGSTRING2( "TSY: CMmCustomSecurityTsy::DeliverCodeL iSecCode: %S", &iSecCode ); |
604 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMCUSTOMSECURITYTSY_DELIVERCODEL_1, "TSY: CMmCustomSecurityTsy::DeliverCodeL iSecCode: %S", iSecCode ); |
600 |
605 |
601 return KErrNone; |
606 return KErrNone; |
602 } |
607 } |
603 |
608 |
604 // --------------------------------------------------------------------------- |
609 // --------------------------------------------------------------------------- |
645 // --------------------------------------------------------------------------- |
650 // --------------------------------------------------------------------------- |
646 // |
651 // |
647 void CMmCustomSecurityTsy::CompleteDisablePhoneLock( |
652 void CMmCustomSecurityTsy::CompleteDisablePhoneLock( |
648 TInt aErrorCode ) |
653 TInt aErrorCode ) |
649 { |
654 { |
650 TFLOGSTRING2("TSY: CMmCustomSecurityTsy::CompleteDisablePhoneLock - Error code: %d", aErrorCode ); |
655 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMCUSTOMSECURITYTSY_COMPLETEDISABLEPHONELOCK_1, "TSY: CMmCustomSecurityTsy::CompleteDisablePhoneLock - Error code: %d", aErrorCode ); |
651 // reset req handle. Returns the deleted req handle |
656 // reset req handle. Returns the deleted req handle |
652 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
657 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
653 ESecurityRequestTypeDisablePhoneLock ); |
658 ESecurityRequestTypeDisablePhoneLock ); |
654 |
659 |
655 if ( ESecurityTsyReqHandleUnknown != reqHandle ) |
660 if ( ESecurityTsyReqHandleUnknown != reqHandle ) |