securitydialogs/Securitynotifier/Src/SecurityNotifier.cpp
branchGCC_SURGE
changeset 40 604cd42065d1
parent 26 aad866c37519
child 39 61986511a9c8
equal deleted inserted replaced
29:b63e8c2d8cff 40:604cd42065d1
   226 void CSecurityNotifier::GetParamsL(const TDesC8& aBuffer, TInt aReturnVal, const RMessagePtr2& aMessage)
   226 void CSecurityNotifier::GetParamsL(const TDesC8& aBuffer, TInt aReturnVal, const RMessagePtr2& aMessage)
   227     {
   227     {
   228 	#if defined(_DEBUG)
   228 	#if defined(_DEBUG)
   229 	RDebug::Printf( "%s %s (%u) searching for autolock.exe =%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x0 );
   229 	RDebug::Printf( "%s %s (%u) searching for autolock.exe =%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x0 );
   230 	#endif
   230 	#endif
   231 	
       
   232    // Start Dirty and quick hack    
       
   233    #include <PSVariables.h>   // Property values
       
   234    #include <coreapplicationuisdomainpskeys.h>
       
   235    _LIT_SECURITY_POLICY_PASS(KReadPolicy);
       
   236    _LIT_SECURITY_POLICY_C1(KWritePolicy, ECapabilityWriteDeviceData);
       
   237    int ret = RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, RProperty::EInt, KReadPolicy, KWritePolicy);
       
   238    RDebug::Printf( "%s %s (%u) EAutolockOff=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
       
   239    RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, 1);
       
   240    // End Dirty and quick hack
       
   241 		
   231 		
   242 	
       
   243 	TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
   232 	TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
   244 	const TUid KAutolockUid = { 0x100059B5 };
   233 	const TUid KAutolockUid = { 0x100059B5 };
   245 	TApaTask task( taskList.FindApp( KAutolockUid ) );
   234 	TApaTask task( taskList.FindApp( KAutolockUid ) );
   246 	if ( !task.Exists() )
   235 	if ( !task.Exists() )
   247 		{
   236 		{
   255 		CApaCommandLine* commandLine = CApaCommandLine::NewLC();
   244 		CApaCommandLine* commandLine = CApaCommandLine::NewLC();
   256 		commandLine->SetExecutableNameL( _L("autolock.exe" ) );     
   245 		commandLine->SetExecutableNameL( _L("autolock.exe" ) );     
   257 		commandLine->SetCommandL( EApaCommandRun );
   246 		commandLine->SetCommandL( EApaCommandRun );
   258 		
   247 		
   259 		// Try to launch the application.        
   248 		// Try to launch the application.        
   260 		User::LeaveIfError(ls.StartApp(*commandLine));
   249 		TInt err = ls.StartApp(*commandLine);
   261 		#if defined(_DEBUG)
   250 		#if defined(_DEBUG)
   262 		RDebug::Printf( "%s %s (%u) autolock.exe created=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x2 );
   251 		RDebug::Printf( "%s %s (%u) autolock.exe err=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, err );
   263 		#endif
   252 		#endif
   264 		
   253 		
   265 		CleanupStack::PopAndDestroy(2); // commandLine, ls
   254 		CleanupStack::PopAndDestroy(2); // commandLine, ls
   266 		}
   255 		}
   267 
   256