72 // Constructor passes the reference to the main state control. |
72 // Constructor passes the reference to the main state control. |
73 // --------------------------------------------------------------------------- |
73 // --------------------------------------------------------------------------- |
74 CLockAppDevicelockControl::CLockAppDevicelockControl(MLockAppStateControl& aStateControl) : |
74 CLockAppDevicelockControl::CLockAppDevicelockControl(MLockAppStateControl& aStateControl) : |
75 CLockAppBaseControl(aStateControl), iShowingSecCodeQuery(EFalse) |
75 CLockAppBaseControl(aStateControl), iShowingSecCodeQuery(EFalse) |
76 { |
76 { |
77 RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
77 INFO_4( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
78 |
78 |
79 } |
79 } |
80 |
80 |
81 // --------------------------------------------------------------------------- |
81 // --------------------------------------------------------------------------- |
82 // Destructor. |
82 // Destructor. |
83 // --------------------------------------------------------------------------- |
83 // --------------------------------------------------------------------------- |
84 CLockAppDevicelockControl::~CLockAppDevicelockControl( ) |
84 CLockAppDevicelockControl::~CLockAppDevicelockControl( ) |
85 { |
85 { |
86 RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
86 INFO_4( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
87 |
87 |
88 /***************************************************** |
88 /***************************************************** |
89 * S60 Customer / ETel |
89 * S60 Customer / ETel |
90 * S60 ETel API |
90 * S60 ETel API |
91 *****************************************************/ |
91 *****************************************************/ |
92 /***************************************************** |
92 /***************************************************** |
93 * S60 Customer / TSY |
93 * S60 Customer / TSY |
94 * Needs customer TSY implementation |
94 * Needs customer TSY implementation |
95 *****************************************************/ |
95 *****************************************************/ |
96 RDebug::Printf( "%s %s (%u) iCustomPhoneInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized ); |
96 INFO_4( "%s %s (%u) iCustomPhoneInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized ); |
97 iCustomPhoneInitialized=-1; |
97 iCustomPhoneInitialized=-1; |
98 if ( iCustomPhone.SubSessionHandle( ) ) |
98 if ( iCustomPhone.SubSessionHandle( ) ) |
99 { |
99 { |
100 iCustomPhone.Close( ); |
100 iCustomPhone.Close( ); |
101 RDebug::Printf( "%s %s (%u) iCustomPhoneInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized ); |
101 INFO_4( "%s %s (%u) iCustomPhoneInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized ); |
102 iCustomPhoneInitialized=-2; |
102 iCustomPhoneInitialized=-2; |
103 } |
103 } |
104 |
104 |
105 RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
105 INFO_4( "%s %s (%u) iPhoneInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
106 iPhoneInitialized=-1; |
106 iPhoneInitialized=-1; |
107 if ( iPhone.SubSessionHandle( ) ) |
107 if ( iPhone.SubSessionHandle( ) ) |
108 { |
108 { |
109 iPhone.Close( ); |
109 iPhone.Close( ); |
110 RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
110 INFO_4( "%s %s (%u) iPhoneInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
111 iPhoneInitialized=-2; |
111 iPhoneInitialized=-2; |
112 } |
112 } |
113 |
113 |
114 RDebug::Printf( "%s %s (%u) iTelServerInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized ); |
114 INFO_4( "%s %s (%u) iTelServerInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized ); |
115 iTelServerInitialized=-1; |
115 iTelServerInitialized=-1; |
116 if ( iTelServer.Handle( ) ) |
116 if ( iTelServer.Handle( ) ) |
117 { |
117 { |
118 iTelServer.UnloadPhoneModule( KMmTsyModuleName ); |
118 iTelServer.UnloadPhoneModule( KMmTsyModuleName ); |
119 iTelServer.Close( ); |
119 iTelServer.Close( ); |
120 RDebug::Printf( "%s %s (%u) iTelServerInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized ); |
120 INFO_4( "%s %s (%u) iTelServerInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized ); |
121 iTelServerInitialized=-2; |
121 iTelServerInitialized=-2; |
122 } |
122 } |
123 if ( iActivityManager ) |
123 if ( iActivityManager ) |
124 { |
124 { |
125 iActivityManager->Cancel( ); |
125 iActivityManager->Cancel( ); |
233 // may return also KErrAlreadyExists if some other |
233 // may return also KErrAlreadyExists if some other |
234 // is already loaded the tsy module. And that is not an error. |
234 // is already loaded the tsy module. And that is not an error. |
235 ERROR(err, "CLockAppDevicelockControl::ConnectToPhoneL - loading TSY"); |
235 ERROR(err, "CLockAppDevicelockControl::ConnectToPhoneL - loading TSY"); |
236 User::LeaveIfError( err ); |
236 User::LeaveIfError( err ); |
237 } |
237 } |
238 RDebug::Printf( "%s %s (%u) iTelServerInitialized=%x -> 3 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized ); |
238 INFO_4( "%s %s (%u) iTelServerInitialized=%x -> 3 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized ); |
239 iTelServerInitialized=3; |
239 iTelServerInitialized=3; |
240 |
240 |
241 /***************************************************** |
241 /***************************************************** |
242 * S60 Customer / ETel |
242 * S60 Customer / ETel |
243 * S60 ETel API |
243 * S60 ETel API |
244 *****************************************************/ |
244 *****************************************************/ |
245 INFO( "CLockAppDevicelockControl::ConnectToPhoneL - opening phone"); |
245 INFO( "CLockAppDevicelockControl::ConnectToPhoneL - opening phone"); |
246 RTelServer::TPhoneInfo PhoneInfo; |
246 RTelServer::TPhoneInfo PhoneInfo; |
247 User::LeaveIfError( iTelServer.SetExtendedErrorGranularity( RTelServer::EErrorExtended ) ); |
247 User::LeaveIfError( iTelServer.SetExtendedErrorGranularity( RTelServer::EErrorExtended ) ); |
248 RDebug::Printf( "%s %s (%u) iTelServerInitialized=%x -> 5 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized ); |
248 INFO_4( "%s %s (%u) iTelServerInitialized=%x -> 5 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized ); |
249 iTelServerInitialized=5; |
249 iTelServerInitialized=5; |
250 User::LeaveIfError( iTelServer.GetPhoneInfo( KPhoneIndex, PhoneInfo ) ); |
250 User::LeaveIfError( iTelServer.GetPhoneInfo( KPhoneIndex, PhoneInfo ) ); |
251 RDebug::Printf( "%s %s (%u) iTelServerInitialized=%x -> 6 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized ); |
251 INFO_4( "%s %s (%u) iTelServerInitialized=%x -> 6 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized ); |
252 iTelServerInitialized=6; |
252 iTelServerInitialized=6; |
253 User::LeaveIfError( iPhone.Open( iTelServer, PhoneInfo.iName ) ); |
253 User::LeaveIfError( iPhone.Open( iTelServer, PhoneInfo.iName ) ); |
254 RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
254 INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
255 iPhoneInitialized=2; |
255 iPhoneInitialized=2; |
256 User::LeaveIfError( iCustomPhone.Open( iPhone ) ); |
256 User::LeaveIfError( iCustomPhone.Open( iPhone ) ); |
257 RDebug::Printf( "%s %s (%u) iCustomPhoneInitialized=%x -> 2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized ); |
257 INFO_4( "%s %s (%u) iCustomPhoneInitialized=%x -> 2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized ); |
258 iCustomPhoneInitialized=2; |
258 iCustomPhoneInitialized=2; |
259 |
259 |
260 INFO( "CLockAppDevicelockControl::ConnectToPhoneL - phone opened"); |
260 INFO( "CLockAppDevicelockControl::ConnectToPhoneL - phone opened"); |
261 |
261 |
262 |
262 |
559 * S60 Customer / ETel |
559 * S60 Customer / ETel |
560 * S60 ETel API |
560 * S60 ETel API |
561 *****************************************************/ |
561 *****************************************************/ |
562 |
562 |
563 |
563 |
564 RDebug::Printf( "%s %s (%u) 111 value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
564 INFO_4( "%s %s (%u) 111 value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
565 |
565 |
566 // RDebug::Printf( "%s %s (%u) iStateControl=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iStateControl ); |
566 // INFO_4( "%s %s (%u) iStateControl=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iStateControl ); |
567 |
567 |
568 RDebug::Printf( "%s %s (%u) checking iPhoneInitialized=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
568 INFO_4( "%s %s (%u) checking iPhoneInitialized=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
569 RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 4 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
569 INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 4 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
570 iPhoneInitialized=4; |
570 iPhoneInitialized=4; |
571 |
571 |
572 RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; |
572 RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; |
573 RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; |
573 RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; |
574 RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); |
574 RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); |
575 RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled); |
575 RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled); |
576 |
576 |
577 RDebug::Printf( "%s %s (%u) before getLockInfoStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
577 INFO_4( "%s %s (%u) before getLockInfoStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
578 TRequestStatus getLockInfoStatus; |
578 TRequestStatus getLockInfoStatus; |
579 RDebug::Printf( "%s %s (%u) after getLockInfoStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
579 INFO_4( "%s %s (%u) after getLockInfoStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
580 |
580 |
581 RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 5 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
581 INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 5 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
582 iPhoneInitialized=5; |
582 iPhoneInitialized=5; |
583 iPhone.GetLockInfo( getLockInfoStatus, lockType, lockInfoPkg ); |
583 iPhone.GetLockInfo( getLockInfoStatus, lockType, lockInfoPkg ); |
584 RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 6 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
584 INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 6 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
585 iPhoneInitialized=6; |
585 iPhoneInitialized=6; |
586 User::WaitForRequest( getLockInfoStatus ); |
586 User::WaitForRequest( getLockInfoStatus ); |
587 |
587 |
588 INFO_1( "CLockAppDevicelockControl::ETelActivationAllowed - GetLockInfo status: %d ", getLockInfoStatus.Int() ); |
588 INFO_1( "CLockAppDevicelockControl::ETelActivationAllowed - GetLockInfo status: %d ", getLockInfoStatus.Int() ); |
589 if ( getLockInfoStatus.Int( )== KErrNone ) |
589 if ( getLockInfoStatus.Int( )== KErrNone ) |
619 // Raise a flag to indicate that the UPIN request coming from ETEL |
619 // Raise a flag to indicate that the UPIN request coming from ETEL |
620 // has originated from SecUi and not from Engine. |
620 // has originated from SecUi and not from Engine. |
621 RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSystemLockOriginated ); |
621 RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSystemLockOriginated ); |
622 TRequestStatus setLockSettingStatus; |
622 TRequestStatus setLockSettingStatus; |
623 lockChange = RMobilePhone::ELockSetEnabled; |
623 lockChange = RMobilePhone::ELockSetEnabled; |
624 RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 8 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
624 INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 8 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
625 iPhoneInitialized=8; |
625 iPhoneInitialized=8; |
626 iPhone.SetLockSetting( setLockSettingStatus, lockType, lockChange ); |
626 iPhone.SetLockSetting( setLockSettingStatus, lockType, lockChange ); |
627 RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 9 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
627 INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 9 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
628 iPhoneInitialized=9; |
628 iPhoneInitialized=9; |
629 User::WaitForRequest(setLockSettingStatus); |
629 User::WaitForRequest(setLockSettingStatus); |
630 INFO_1( "CLockAppDevicelockControl::ETelActivationAllowed - SetLockSetting status: %d ", setLockSettingStatus.Int() ); |
630 INFO_1( "CLockAppDevicelockControl::ETelActivationAllowed - SetLockSetting status: %d ", setLockSettingStatus.Int() ); |
631 // Lower the flag |
631 // Lower the flag |
632 RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsETelAPIOriginated ); |
632 RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsETelAPIOriginated ); |
671 } |
671 } |
672 { // if another query is displayed, the future un-lock query will crash. Don't allow time-lock in this case. |
672 { // if another query is displayed, the future un-lock query will crash. Don't allow time-lock in this case. |
673 TInt secQueryStatus = ESecurityQueryUninitialized; |
673 TInt secQueryStatus = ESecurityQueryUninitialized; |
674 TInt tRet = RProperty::Get(KPSUidStartup, KStartupSecurityCodeQueryStatus, secQueryStatus); // also 0 if can't get because permissions or because doesn't exists |
674 TInt tRet = RProperty::Get(KPSUidStartup, KStartupSecurityCodeQueryStatus, secQueryStatus); // also 0 if can't get because permissions or because doesn't exists |
675 #if defined(_DEBUG) |
675 #if defined(_DEBUG) |
676 RDebug::Printf( "%s %s (%u) getting KPSUidStartup+KStartupSecurityCodeQueryStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, tRet ); |
676 INFO_4( "%s %s (%u) getting KPSUidStartup+KStartupSecurityCodeQueryStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, tRet ); |
677 RDebug::Printf( "%s %s (%u) secQueryStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, secQueryStatus ); |
677 INFO_4( "%s %s (%u) secQueryStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, secQueryStatus ); |
678 #endif |
678 #endif |
679 if(secQueryStatus==ESecurityQueryActive) |
679 if(secQueryStatus==ESecurityQueryActive) |
680 { |
680 { |
681 #if defined(_DEBUG) |
681 #if defined(_DEBUG) |
682 RDebug::Print(_L("(LOCKAPP)CLockAppDevicelockControl::ActivationAllowedL() Asking some other security code. No locking possible.")); |
682 RDebug::Print(_L("(LOCKAPP)CLockAppDevicelockControl::ActivationAllowedL() Asking some other security code. No locking possible.")); |
846 // --------------------------------------------------------------------------- |
846 // --------------------------------------------------------------------------- |
847 // Handle environment changes (Screensaver, Telephony, etc.) |
847 // Handle environment changes (Screensaver, Telephony, etc.) |
848 // --------------------------------------------------------------------------- |
848 // --------------------------------------------------------------------------- |
849 void CLockAppDevicelockControl::HandleEnvironmentChange( TUint aEnvMask, TUint aEventMask ) |
849 void CLockAppDevicelockControl::HandleEnvironmentChange( TUint aEnvMask, TUint aEventMask ) |
850 { |
850 { |
851 RDebug::Printf( "%s %s (%u) aEnvMask=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aEnvMask ); |
851 INFO_4( "%s %s (%u) aEnvMask=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aEnvMask ); |
852 RDebug::Printf( "%s %s (%u) aEventMask=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aEventMask ); |
852 INFO_4( "%s %s (%u) aEventMask=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aEventMask ); |
853 |
853 |
854 if ( IsBitFieldSet( aEventMask, KLockAppEnvScreenSaverOn ) ) |
854 if ( IsBitFieldSet( aEventMask, KLockAppEnvScreenSaverOn ) ) |
855 { |
855 { |
856 // screen saver state changed |
856 // screen saver state changed |
857 CapturePrimaryKeys( IsBitFieldSet( aEnvMask, KLockAppEnvScreenSaverOn ) ); |
857 CapturePrimaryKeys( IsBitFieldSet( aEnvMask, KLockAppEnvScreenSaverOn ) ); |
858 } |
858 } |
859 if ( IsBitFieldSet( aEventMask, KLockAppEnvFPS ) ) |
859 if ( IsBitFieldSet( aEventMask, KLockAppEnvFPS ) ) |
860 { |
860 { |
861 TInt lockValue=0; |
861 TInt lockValue=0; |
862 iPSAutolockState->GetKeyValue( lockValue ); |
862 iPSAutolockState->GetKeyValue( lockValue ); |
863 RDebug::Printf( "%s %s (%u) lockValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, lockValue ); |
863 INFO_4( "%s %s (%u) lockValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, lockValue ); |
864 if(lockValue>EAutolockOff) // device is locked and query is not open |
864 if(lockValue>EAutolockOff) // device is locked and query is not open |
865 { |
865 { |
866 // indicate to TARM that it should not ask for password |
866 // indicate to TARM that it should not ask for password |
867 TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); |
867 TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); |
868 RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); |
868 RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); |
869 RDebug::Printf( "%s %s (%u) secUiOriginatedQuery=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, secUiOriginatedQuery ); |
869 INFO_4( "%s %s (%u) secUiOriginatedQuery=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, secUiOriginatedQuery ); |
870 RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsFpsOriginated ); |
870 RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsFpsOriginated ); |
871 |
871 |
872 HandleUnlockCommandL( ); |
872 HandleUnlockCommandL( ); |
873 RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery ); // reset to initial |
873 RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery ); // reset to initial |
874 } |
874 } |
875 else // device needs to be locked. Same happens in keyguard control becasue probably this is never called |
875 else // device needs to be locked. Same happens in keyguard control becasue probably this is never called |
876 iStateControl.EnableDevicelockL( EDevicelockManual ); |
876 iStateControl.EnableDevicelockL( EDevicelockManual ); |
877 } |
877 } |
878 if ( IsBitFieldSet( aEnvMask, KLockAppEnvGrip ) ) |
878 if ( IsBitFieldSet( aEnvMask, KLockAppEnvGrip ) ) |
879 { |
879 { |
880 RDebug::Printf( "%s %s (%u) iShowingSecCodeQuery=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iShowingSecCodeQuery ); |
880 INFO_4( "%s %s (%u) iShowingSecCodeQuery=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iShowingSecCodeQuery ); |
881 if ( IsBitFieldSet( aEventMask, KLockAppEnvGrip ) ) //Grip opened |
881 if ( IsBitFieldSet( aEventMask, KLockAppEnvGrip ) ) //Grip opened |
882 { |
882 { |
883 if(iShowingSecCodeQuery==EFalse) |
883 if(iShowingSecCodeQuery==EFalse) |
884 { |
884 { |
885 TInt lockValue=0; |
885 TInt lockValue=0; |
886 iPSAutolockState->GetKeyValue( lockValue ); |
886 iPSAutolockState->GetKeyValue( lockValue ); |
887 RDebug::Printf( "%s %s (%u) lockValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, lockValue ); |
887 INFO_4( "%s %s (%u) lockValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, lockValue ); |
888 if(lockValue>EAutolockOff) |
888 if(lockValue>EAutolockOff) |
889 { |
889 { |
890 // ask unlock code by sending the menu key. This works on touch? |
890 // ask unlock code by sending the menu key. This works on touch? |
891 TApaTaskList tasklist( iEikonEnv->WsSession() ); |
891 TApaTaskList tasklist( iEikonEnv->WsSession() ); |
892 #define KAknCapServerUid TUid::Uid( 0x10207218 ) |
892 #define KAknCapServerUid TUid::Uid( 0x10207218 ) |
893 TApaTask capserver = tasklist.FindApp( KAknCapServerUid ); |
893 TApaTask capserver = tasklist.FindApp( KAknCapServerUid ); |
894 RDebug::Printf( "%s %s (%u) KAknCapServerUid=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KAknCapServerUid ); |
894 INFO_4( "%s %s (%u) KAknCapServerUid=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KAknCapServerUid ); |
895 if( capserver.Exists() ) |
895 if( capserver.Exists() ) |
896 { |
896 { |
897 RDebug::Printf( "%s %s (%u) capserver.Exists() EStdKeyDevice0=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStdKeyDevice0 ); |
897 INFO_4( "%s %s (%u) capserver.Exists() EStdKeyDevice0=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStdKeyDevice0 ); |
898 TKeyEvent key; |
898 TKeyEvent key; |
899 key.iCode = EKeyDevice0; |
899 key.iCode = EKeyDevice0; |
900 key.iModifiers = 0; |
900 key.iModifiers = 0; |
901 key.iRepeats = 0; |
901 key.iRepeats = 0; |
902 key.iScanCode = EStdKeyDevice0; |
902 key.iScanCode = EStdKeyDevice0; |
925 // --------------------------------------------------------------------------- |
925 // --------------------------------------------------------------------------- |
926 // Handle all Central Repository observer callbacks. |
926 // Handle all Central Repository observer callbacks. |
927 // --------------------------------------------------------------------------- |
927 // --------------------------------------------------------------------------- |
928 void CLockAppDevicelockControl::HandleCenRepNotify(TUid /*aCenRepUid*/, TUint32 aKeyId, TInt aValue ) |
928 void CLockAppDevicelockControl::HandleCenRepNotify(TUid /*aCenRepUid*/, TUint32 aKeyId, TInt aValue ) |
929 { |
929 { |
930 RDebug::Printf( "%s %s (%u) aKeyId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyId ); |
930 INFO_4( "%s %s (%u) aKeyId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyId ); |
931 RDebug::Printf( "%s %s (%u) aValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aValue ); |
931 INFO_4( "%s %s (%u) aValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aValue ); |
932 switch ( aKeyId ) |
932 switch ( aKeyId ) |
933 { |
933 { |
934 case KSettingsAutoLockTime: |
934 case KSettingsAutoLockTime: |
935 { |
935 { |
936 INFO_1( "CLockAppDevicelockControl::HandleCenRepNotify - KSettingsAutoLockTime = %d", aValue ); |
936 INFO_1( "CLockAppDevicelockControl::HandleCenRepNotify - KSettingsAutoLockTime = %d", aValue ); |
945 // --------------------------------------------------------------------------- |
945 // --------------------------------------------------------------------------- |
946 // Handle all Publish & Subscribe observer callbacks. |
946 // Handle all Publish & Subscribe observer callbacks. |
947 // --------------------------------------------------------------------------- |
947 // --------------------------------------------------------------------------- |
948 void CLockAppDevicelockControl::HandlePubSubNotify(TUid aPubSubUid, TUint aKeyId, TInt aValue ) |
948 void CLockAppDevicelockControl::HandlePubSubNotify(TUid aPubSubUid, TUint aKeyId, TInt aValue ) |
949 { |
949 { |
950 RDebug::Printf( "%s %s (%u) KPSUidCoreApplicationUIs=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KPSUidCoreApplicationUIs ); |
950 INFO_4( "%s %s (%u) KPSUidCoreApplicationUIs=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KPSUidCoreApplicationUIs ); |
951 RDebug::Printf( "%s %s (%u) aKeyId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyId ); |
951 INFO_4( "%s %s (%u) aKeyId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyId ); |
952 RDebug::Printf( "%s %s (%u) aValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aValue ); |
952 INFO_4( "%s %s (%u) aValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aValue ); |
953 if ( aPubSubUid == KPSUidCoreApplicationUIs ) |
953 if ( aPubSubUid == KPSUidCoreApplicationUIs ) |
954 { |
954 { |
955 switch ( aKeyId ) |
955 switch ( aKeyId ) |
956 { |
956 { |
957 case KCoreAppUIsAutolockStatus: |
957 case KCoreAppUIsAutolockStatus: |
971 // --------------------------------------------------------------------------- |
971 // --------------------------------------------------------------------------- |
972 // Devicelock UI key events are handled trough here. |
972 // Devicelock UI key events are handled trough here. |
973 // --------------------------------------------------------------------------- |
973 // --------------------------------------------------------------------------- |
974 TKeyResponse CLockAppDevicelockControl::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) |
974 TKeyResponse CLockAppDevicelockControl::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) |
975 { |
975 { |
976 RDebug::Printf( "%s %s (%u) aKeyEvent.iCode=%x aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyEvent.iCode, aType ); |
976 INFO_4( "%s (%u) aKeyEvent.iCode=%x aType=%x", __FILE__, __LINE__, aKeyEvent.iCode, aType ); |
977 RDebug::Printf( "%s %s (%u) iActive=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iActive ); |
977 INFO_4( "%s %s (%u) iActive=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iActive ); |
978 if ( iActive ) |
978 if ( iActive ) |
979 { |
979 { |
980 if(AknLayoutUtils::PenEnabled()) |
980 if(AknLayoutUtils::PenEnabled()) |
981 { |
981 { |
982 if(aKeyEvent.iCode == EKeyDeviceF) // any Type |
982 if(aKeyEvent.iCode == EKeyDeviceF) // any Type |
1008 void CLockAppDevicelockControl::HandleUnlockCommandL( ) |
1008 void CLockAppDevicelockControl::HandleUnlockCommandL( ) |
1009 { |
1009 { |
1010 INFO( "CLockAppDevicelockControl::HandleUnlockCommandL" ); |
1010 INFO( "CLockAppDevicelockControl::HandleUnlockCommandL" ); |
1011 // inform sysap to put lights on left soft key press |
1011 // inform sysap to put lights on left soft key press |
1012 SendMessageToSysAp( EEikKeyLockLightsOnRequest ); |
1012 SendMessageToSysAp( EEikKeyLockLightsOnRequest ); |
1013 RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 10 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
1013 INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 10 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized ); |
1014 iPhoneInitialized=10; |
1014 iPhoneInitialized=10; |
1015 CSecurityHandler* handler = new (ELeave) CSecurityHandler( iPhone ); |
1015 CSecurityHandler* handler = new (ELeave) CSecurityHandler( iPhone ); |
1016 RDebug::Printf( "%s %s (%u) got handler=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1016 INFO_4( "%s %s (%u) got handler=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1017 CleanupStack::PushL( handler ); |
1017 CleanupStack::PushL( handler ); |
1018 TSecUi::InitializeLibL( ); |
1018 TSecUi::InitializeLibL( ); |
1019 RDebug::Printf( "%s %s (%u) got TSecUi::InitializeLibL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1019 INFO_4( "%s %s (%u) got TSecUi::InitializeLibL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1020 iShowingSecCodeQuery = ETrue; |
1020 iShowingSecCodeQuery = ETrue; |
1021 TRAPD(err, { |
1021 TRAPD(err, { |
1022 RDebug::Printf( "%s %s (%u) before AskSecCodeInAutoLockL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1022 INFO_4( "%s %s (%u) before AskSecCodeInAutoLockL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1023 TBool ret = handler->AskSecCodeInAutoLockL(); |
1023 TBool ret = handler->AskSecCodeInAutoLockL(); |
1024 RDebug::Printf( "%s %s (%u) after AskSecCodeInAutoLockL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, ret ); |
1024 INFO_4( "%s %s (%u) after AskSecCodeInAutoLockL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, ret ); |
1025 INFO_1( "CLockAppDevicelockControl::HandleUnlockCommandL - AskSecCodeInAutoLockL = %d", ret ); |
1025 INFO_1( "CLockAppDevicelockControl::HandleUnlockCommandL - AskSecCodeInAutoLockL = %d", ret ); |
1026 if ( ret ) |
1026 if ( ret ) |
1027 { |
1027 { |
1028 iStateControl.DisableDevicelockL(); |
1028 iStateControl.DisableDevicelockL(); |
1029 } |
1029 } |