diff -r 318c4eab2439 -r 8957df7b0072 securitydialogs/SecUi/Src/SecUiSystemLock.cpp --- a/securitydialogs/SecUi/Src/SecUiSystemLock.cpp Fri Apr 16 15:53:24 2010 +0300 +++ b/securitydialogs/SecUi/Src/SecUiSystemLock.cpp Mon May 03 13:20:16 2010 +0300 @@ -30,6 +30,8 @@ #include #include #include +#include + /***************************************************** * Series 60 Customer / TSY * Needs customer TSY implementation @@ -154,84 +156,12 @@ RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL()")); #endif // close fast-swap window - CEikonEnv::Static()->DismissTaskList(); - -#ifdef __WINS__ - // can not verify security code in emulator ---> lock system -#ifdef RD_REMOTELOCK - iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked); -#else// !RD_REMOTELOCK - iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOn); -#endif//RD_REMOTELOCK -#else //__WINS__ - - if(IsActive()) - return; - - - RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; - RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; - RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); - RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled); - CWait* wait = CWait::NewL(); - CleanupStack::PushL( wait ); - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() GetLockInfo")); - #endif - iPhone.GetLockInfo(wait->iStatus, lockType, lockInfoPkg); - if (wait->WaitForRequestL() == KErrNone) - { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() KErrNone")); - #endif - if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) - { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() ELockSetDisabled")); - #endif - // ask code - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() SetLockSetting")); - #endif - //iCustomPhone.CheckSecurityCode(iStatus, RMmCustomAPI::ESecurityCodePassPhrase); - lockChange = RMobilePhone::ELockSetEnabled; - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSystemLockOriginated); - iPhone.SetLockSetting(iStatus, lockType, lockChange); - SetActive(); - } - else - { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() Lock System")); - #endif - // lock system -#ifdef RD_REMOTELOCK - iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked); -#else// !RD_REMOTELOCK - iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOn); -#endif //RD_REMOTELOCK - - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() Lock System OK")); - #endif - } - } - else - { - // ask code - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() ask code (SLS) ")); - #endif - lockChange = RMobilePhone::ELockSetEnabled; - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSystemLockOriginated); - iPhone.SetLockSetting(iStatus, lockType, lockChange); - SetActive(); - } - CleanupStack::PopAndDestroy(); - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() END")); - #endif // DEBUG - #endif // WINS + RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); + CDevicelockAccessApi* iDevicelockAccess = CDevicelockAccessApi::NewL( ); + RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); + iDevicelockAccess->OfferDevicelock(); + // EnableDevicelock( EDevicelockManual ); + RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); } // // ----------------------------------------------------------