diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-FDD42A61-9FFE-53F5-A0B3-D8087270C7F6.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-FDD42A61-9FFE-53F5-A0B3-D8087270C7F6.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,99 @@ + + + + + +Phone +Lock Tutorial This tutorial describes how to get the device lock information +by the client applications. +

The phone can have up to two locks specified by the user. The +client application can retrieve the lock information to prevent unauthorised +use of the device. The client applications must specify a lock to retrieve +the information.

+ + + + +create a new instance of CTelephony + + +use CTelephony::GetLockInfo() to +get the lock information +Specify the lock in a TIccLock object. + + +the function returns the lock information in CTelephony::TIccLockInfoV1 + + +use CTelephony::EPin1LockInfoChange and CTelephony::EPin2LockInfoChangenotification to +get the notification of any changes in the lock1 and lock2 + + +pass the enumeration CTelephony::EPin1LockInfoChangeCancel and CTelephony::EPin2LockInfoChangeCancel to cancel +the notification requests of lock1 and lock2. + + +Phone lock +example #include <e32base.h> +#include <Etel3rdParty.h> + +class CClientApp : public CActive + { + +private: + CTelephony* iTelephony; + CTelephony::TIccLockInfoV1 iIccLockInfoV1; + CTelephony::TIccLockInfoV1Pckg iIccLockInfoV1Pckg; +public: + CClientApp(CTelephony* aTelephony); + void SomeFunction(); + +private: + /* + These are the pure virtual methods from CActive that + MUST be implemented by all active objects + */ + void RunL(); + void DoCancel(); + }; + +CClientApp::CClientApp(CTelephony* aTelephony) + : CActive(EPriorityStandard), + iTelephony(aTelephony), + iIccLockInfoV1Pckg(iIccLockInfoV1) + { + //default constructor + } + +void CClientApp::SomeFunction() + { + CTelephony::TIccLock lockSelect = CTelephony::ELockPin2; + iTelephony->GetLockInfo(iStatus, lockSelect, iIccLockInfoV1Pckg); + SetActive(); + } + +void CClientApp::RunL() + { + if(iStatus==KErrNone) + { + if( iIccLockInfoV1.iSetting == CTelephony::ELockSetEnabled + && iIccLockInfoV1.iStatus == CTelephony::EStatusUnlocked) + { + // Lock 2 is available for the phone to use + // and its current statues is open, + // The user can access functionality governed by this lock. + } + } + } + +void CClientApp::DoCancel() + { + iTelephony->CancelAsync(CTelephony::EGetLockInfoCancel); + } +
\ No newline at end of file