EXPORT_C void KillApplicationL(RWsSession& aWs, TUid aUid, TInt aRetryInterval )
	{
		TTime wait_until; wait_until.HomeTime();
		wait_until+=TTimeIntervalSeconds(15);
	
		TApaTaskList taskList( aWs );

		for(;;) {
			TApaTask task = taskList.FindApp(aUid);
			if(! task.Exists()) {
				break;
			}
			TTime now; now.HomeTime();
			if (now < wait_until) {
				task.EndTask();
				//DebugMsg(_L("waiting..."), aDebugLog);
				User::After(TTimeIntervalMicroSeconds32(aRetryInterval*1000) );
			} else {
				break;
			}
		}
		TApaTask task = taskList.FindApp(aUid);
		if( task.Exists()) {
#ifdef __S60V3__
			task.KillTask();
#else
			RThread t;
			if (t.Open(task.ThreadId())==KErrNone) {
				//DebugMsg(_L("killing"), aDebugLog);
				t.Kill(2003);
				t.Close();
			}
#endif
		}
	}
void MpFetcherTestAppView::killMP()
{
    TApaTaskList taskList(CEikonEnv::Static()->WsSession());
    TApaTask task = taskList.FindApp(TUid::Uid(270564450));
    if (task.Exists()) {
        task.KillTask();
    } else {
        qCritical("Cannot bring to forward task %08x", 270564450);
    }
}
Пример #3
0
void CApStartTestStep::TestStartAndForgetL(RWsSession& aWsSession)
	{
	INFO_PRINTF1(_L("Entering test case: APPFWK-APSTART-0001"));
	
	TApaTask task = TestStartL(NULL, aWsSession);
	
	if(task.Exists())
		{
		task.KillTask();
		INFO_PRINTF1(_L("Leaving test case: APPFWK-APSTART-0001\n"));
		}
	else
		{
		ERR_PRINTF1(_L("APPFWK-APSTART-0001 failed\n"));  
		}
	}
Пример #4
0
void CApStartTestStep::TestStartAndFollowUpL(RWsSession& aWsSession)
	{
	INFO_PRINTF1(_L("Entering test case: APPFWK-APSTART-0002"));	
	
	TRequestStatus status;
	TApaTask task = TestStartL(&status, aWsSession);
	TESTE(KErrNone == status.Int(), status.Int());
	
	if(task.Exists())
		{
		task.KillTask();
		INFO_PRINTF1(_L("Leaving test case: APPFWK-APSTART-0002\n"));
		}
	else
		{
		ERR_PRINTF1(_L("APPFWK-APSTART-0002 failed\n"));  
		}
	}
Пример #5
0
/* 
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
TInt CExPolicy_Server::KillTasks(TUid& aUid)
{		
	TInt RetErr(KErrNone);
	
	RWsSession wsSession;
	RetErr= wsSession.Connect();
	if(RetErr == KErrNone)
	{
		TApaTaskList taskList( wsSession );
		TApaTask task = taskList.FindApp(aUid);

		if( task.Exists() ) 
		{
			task.KillTask();
		}		
	}

	wsSession.Close();
	
	return RetErr;
}