uifw/AvKon/src/aknsgcc.cpp
branchRCL_3
changeset 51 fcdfafb36fe7
parent 0 2f259fa3e83a
child 55 aecbbf00d063
equal deleted inserted replaced
50:a1caeb42b3a3 51:fcdfafb36fe7
    44 enum TSgcClientFlags
    44 enum TSgcClientFlags
    45 	{
    45 	{
    46 	EHandlingChange,
    46 	EHandlingChange,
    47 	EInAknSrv,
    47 	EInAknSrv,
    48 	ESystemFaded,
    48 	ESystemFaded,
    49 	ENeverRelinquish
    49 	ENeverRelinquish,
       
    50 	EUseForegroundPriority
    50 	};
    51 	};
    51 
    52 
    52 
    53 
    53 NONSHARABLE_CLASS(CAknSgcClientImpl) : public CAknSgcImpl
    54 NONSHARABLE_CLASS(CAknSgcClientImpl) : public CAknSgcImpl
    54 	{
    55 	{
   616 void CAknSgcClient::DoRelinquishPriorityToForegroundAppLC(TBool aIsForeground)
   617 void CAknSgcClient::DoRelinquishPriorityToForegroundAppLC(TBool aIsForeground)
   617 	{
   618 	{
   618 	RThread myThread;
   619 	RThread myThread;
   619 	TProcessPriority priority = myThread.ProcessPriority();
   620 	TProcessPriority priority = myThread.ProcessPriority();
   620 
   621 
   621 	if( IsSystemFaded() )
   622 	if ( IsSystemFaded() || iFlags[EUseForegroundPriority] )
   622 		{
   623 		{
   623 		// Solution for EKKG-7RQ9U8:
       
   624 		// If the system is faded we have a popup on screen.
   624 		// If the system is faded we have a popup on screen.
   625 		// Get the process behind the foreground process. 
   625 		// Get the process behind the foreground process, the
       
   626 	    // EUseForegroundPriority should also affect only that process. 
   626 		TApaTask task = TApaTaskList(iEikonEnv->WsSession()).FindByPos(1);
   627 		TApaTask task = TApaTaskList(iEikonEnv->WsSession()).FindByPos(1);
   627 
   628 
   628 		// Check if this application is next behind the foreground app.
   629 		// Check if this application is next behind the foreground app.
   629 		if( task.Exists() && myThread.Id() == task.ThreadId())
   630 		if( task.Exists() && myThread.Id() == task.ThreadId())
   630 			{
   631 			{
   655 	    // push a dummy cleanup item onto the cleanup stack
   656 	    // push a dummy cleanup item onto the cleanup stack
   656         CleanupStack::PushL(TCleanupItem(RestorePriority, NULL));
   657         CleanupStack::PushL(TCleanupItem(RestorePriority, NULL));
   657 	    }
   658 	    }
   658 	}
   659 	}
   659 
   660 
       
   661 void CAknSgcClient::UseForegroundPriorityDuringRelinquish(
       
   662     TBool aUseForeground )
       
   663     {
       
   664     CAknSgcClient* self = Static();
       
   665     if ( self )
       
   666         {
       
   667         if ( aUseForeground )
       
   668             {
       
   669             self->iFlags.Set( EUseForegroundPriority );
       
   670             }
       
   671         else
       
   672             {
       
   673             self->iFlags.Clear( EUseForegroundPriority );
       
   674             }
       
   675         }
       
   676     }
       
   677 
   660 EXPORT_C CAknLayoutConfig& CAknSgcClient::LayoutConfig()
   678 EXPORT_C CAknLayoutConfig& CAknSgcClient::LayoutConfig()
   661 	{
   679 	{
   662 	CAknSgcClient* self = Static();
   680 	CAknSgcClient* self = Static();
   663 	__ASSERT_ALWAYS(self && self->iLayoutConfig, Panic(EAknPanicSgccLayoutConfigNull));
   681 	__ASSERT_ALWAYS(self && self->iLayoutConfig, Panic(EAknPanicSgccLayoutConfigNull));
   664 	return *self->iLayoutConfig;
   682 	return *self->iLayoutConfig;