本文整理汇总了C++中TApaTask::ThreadId方法的典型用法代码示例。如果您正苦于以下问题:C++ TApaTask::ThreadId方法的具体用法?C++ TApaTask::ThreadId怎么用?C++ TApaTask::ThreadId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TApaTask
的用法示例。
在下文中一共展示了TApaTask::ThreadId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckKeyDownPermissionL
// --------------------------------------------------------------------------
// Check whether client key event request can be executed
// --------------------------------------------------------------------------
void CAknCompaSrvSession::CheckKeyDownPermissionL(const RMessage2& aMessage)
{
// We try to increase security by allowing only foreground application
// to set key down. As the simulated key events are sent to the
// foreground application by window server, the application is
// sending a key event to itself.
// Granted if client has ECapabilitySwEvent or request is coming from
// EikSrv. TApaTaskList won't report EikSrv in foreground though
// it's displaying a note.
if (!aMessage.HasCapability(ECapabilitySwEvent) &&
!CAknCompaServer::IsGlobalUiSrv(aMessage))
{
// Allow key down only from a foreground task
TApaTaskList tasklist(Server().WsSession());
TApaTask foregroundTask = tasklist.FindByPos(0);
RThread thread;
User::LeaveIfError(thread.Open(foregroundTask.ThreadId()));
TSecurityPolicy securityPolicy(thread.SecureId());
thread.Close();
if (!securityPolicy.CheckPolicy(aMessage))
{
User::Leave(KErrPermissionDenied);
}
}
}
示例2: KillApplicationL
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
}
}
示例3: Start
void COomAppCloseWatcher::Start(const TApaTask& aTask)
{
FUNC_LOG;
if (!IsActive())
{
TInt err = iThread.Open(aTask.ThreadId());
if (err == KErrNone)
{
iOriginalProcessPriority = iThread.ProcessPriority();
iThread.SetProcessPriority(EPriorityForeground);
iThread.Logon(iStatus);
SetActive();
}
else
{
TRequestStatus* s = &iStatus;
User::RequestComplete(s, err);
SetActive();
}
}
}