Changing screensaver timeout in Symbian application

There is a easy way to programmatically change screensaver timeout to a value other than the default settings dialog provides:

const TUid KUidProfileFile = {0x100058EC};
_LIT(KKey_ScrSvrPrd, "ScrSvrPrd");

// there's no error checking for this sample code!
RSharedDataClient kClient;
kClient.Connect(0);
kClient.Assign(KUidProfileFile);

// set timeout value in minutes
kClient.SetInt(KKey_ScrSvrPrd, 24 * 60);
kClient.Flush();
kClient.Close();

Valid XHTML 1.1 Valid CSS!