syncmlfw/common/sosserver/src/nsmlsosthread.cpp
branchRCL_3
changeset 26 19bba8228ff0
parent 25 b183ec05bd8c
equal deleted inserted replaced
25:b183ec05bd8c 26:19bba8228ff0
    17 
    17 
    18 #include <e32math.h>
    18 #include <e32math.h>
    19 #include <DevManInternalCRKeys.h>
    19 #include <DevManInternalCRKeys.h>
    20 #include <centralrepository.h>
    20 #include <centralrepository.h>
    21 #include <nsmldebug.h>
    21 #include <nsmldebug.h>
    22 #include "PnpLogger.h"
    22 
    23 #include "nsmlsosthread.h"
    23 #include "nsmlsosthread.h"
    24 #include <DataSyncInternalPSKeys.h>
    24 #include <DataSyncInternalPSKeys.h>
    25 
    25 
    26 #include <PolicyEngineClient.h>
    26 #include <PolicyEngineClient.h>
    27 #include <centralrepository.h>
    27 #include <centralrepository.h>
    28 #include "PMUtilInternalCRKeys.h"
    28 #include "PMUtilInternalCRKeys.h"
    29 #include <featmgr.h>
    29 #include <featmgr.h>
    30 #include <e32property.h>
       
    31 #include <DevManInternalCRKeys.h>
       
    32 #include <nsmldmconst.h>
       
    33 
       
    34 
       
    35 enum TSyncmlHbNotifierKeys 
       
    36 		{
       
    37 
       
    38      EHbSOSNotifierKeyStatus = 11, // status set will complete the client subscribe
       
    39      EHbSOSNotifierKeyStatusReturn = 12, // Return the content of actual status value accepted from UI
       
    40      
       
    41      EHbDMSyncNotifierKeyStatus = 13,
       
    42      EHbDMSyncNotifierKeyStatusReturn = 14
       
    43 		};
       
    44 		
       
    45  TUid sosserverpsuid =
       
    46            {
       
    47            0x101F99FB
       
    48            };
       
    49     	  
       
    50   
       
    51 // --------------------------------------------------------------------------
    30 // --------------------------------------------------------------------------
    52 // EXPORT_C TInt ThreadFunction( TAny* )
    31 // EXPORT_C TInt ThreadFunction( TAny* )
    53 // --------------------------------------------------------------------------
    32 // --------------------------------------------------------------------------
    54 //
    33 //
    55 TInt ThreadFunction( TAny* aStarted )
    34 TInt ThreadFunction( TAny* aStarted )
    89 			}
    68 			}
    90 		else
    69 		else
    91 			{
    70 			{
    92 			//if not a silent mode behave as in a normal DM session
    71 			//if not a silent mode behave as in a normal DM session
    93 			threadEngine->ForcedCertificateCheckL( EFalse );
    72 			threadEngine->ForcedCertificateCheckL( EFalse );
    94 			threadEngine->VerifyJobFromNotifierL(ETrue);		
    73 			threadEngine->VerifyJobFromNotifierL();		
    95 			}
    74 			}
    96 		}
    75 		}
    97 	else
    76 	else
    98 		{
    77 		{
    99 		//when sync session is not alerted behave as in a normal DM session
    78 		//when sync session is not alerted behave as in a normal DM session
   119 	    if ( threadEngine->IsActive() )
    98 	    if ( threadEngine->IsActive() )
   120 	        {
    99 	        {
   121 	        CActiveScheduler::Start();                
   100 	        CActiveScheduler::Start();                
   122 	        }	    
   101 	        }	    
   123 	    }	
   102 	    }	
   124 	LOGSTRING("P&S is deleted");  
   103 	
   125 	RProperty::Delete(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob);
       
   126 	delete scheduler;
   104 	delete scheduler;
   127 	
   105 	
   128 	if ( endStatus == KErrNone )
   106 	if ( endStatus == KErrNone )
   129 		{
   107 		{
   130 		endStatus = threadEngine->FinishedStatus();	
   108 		endStatus = threadEngine->FinishedStatus();	
   167 void CNSmlThreadEngine::ConstructL()
   145 void CNSmlThreadEngine::ConstructL()
   168 	{
   146 	{
   169 		FeatureManager::InitializeLibL();
   147 		FeatureManager::InitializeLibL();
   170 	iThreadParams.iThreadEngine = this;
   148 	iThreadParams.iThreadEngine = this;
   171 	iContentArray = new(ELeave) CArrayFixFlat<TNSmlContentSpecificSyncType>(1);
   149 	iContentArray = new(ELeave) CArrayFixFlat<TNSmlContentSpecificSyncType>(1);
   172 	
   150 	// Fix for cancel not happening when cancel key is
       
   151 	// pressed .
       
   152 	iSyncCancelled = EFalse;
   173 	if ( iThreadParams.iCSArray )
   153 	if ( iThreadParams.iCSArray )
   174 		{
   154 		{
   175 		for (TInt i = 0; i < iThreadParams.iCSArray->Count(); i++)
   155 		for (TInt i = 0; i < iThreadParams.iCSArray->Count(); i++)
   176 			{
   156 			{
   177 			TNSmlContentSpecificSyncType type;
   157 			TNSmlContentSpecificSyncType type;
   357 		}
   337 		}
   358 		
   338 		
   359 	TInt status( KErrNone );			
   339 	TInt status( KErrNone );			
   360 	if ( iThreadParams.iCurrentJob.UsageType() == ESmlDevMan )
   340 	if ( iThreadParams.iCurrentJob.UsageType() == ESmlDevMan )
   361 		{
   341 		{
       
   342 		CRepository* centrep = NULL;
       
   343 		TRAPD( err, centrep = CRepository::NewL(KCRUidDeviceManagementInternalKeys));  
       
   344 		TInt phoneLock(0);
       
   345 		TInt factoryProfileID(0);
       
   346 		if (err==KErrNone ) 
       
   347 		{
       
   348 			TInt err = centrep->Get( KLAWMOPhoneLock , phoneLock );
       
   349 			err = centrep->Get( KLAWMOfactoryDmProfileID , factoryProfileID );
       
   350 			delete centrep;
       
   351 			centrep = NULL;
       
   352 		}
       
   353 		if(phoneLock != 30)
       
   354 		{
       
   355 			_DBG_FILE("CNSmlThreadEngine phonelock != 30");
       
   356 			if(factoryProfileID>0)   
       
   357 			{   
       
   358 
       
   359 				TInt profileId = iThreadParams.iCurrentJob.ProfileId();    
       
   360 	
       
   361 				if(profileId!= factoryProfileID) 
       
   362 					{
       
   363 					   _DBG_FILE("CNSmlThreadEngine profid doesnt match with factory");
       
   364 					   TRequestStatus* stat = &iStatus;
       
   365 					   User::RequestComplete( stat, KErrNone );
       
   366 					   return;
       
   367 					}   
       
   368 			
       
   369 			}
       
   370 			else
       
   371 				{
       
   372 				    _DBG_FILE("CNSmlThreadEngine factoryprofileid<0");
       
   373 				    TRequestStatus* stat = &iStatus;
       
   374 					User::RequestComplete( stat, KErrNone );
       
   375 					return;	
       
   376 				}
       
   377 		}
       
   378 		_DBG_FILE("CNSmlThreadEngine startDMSessionL");
   362 		TRAP( status, StartDMSessionL() );
   379 		TRAP( status, StartDMSessionL() );
   363 		}
   380 		}
   364 	else
   381 	else
   365 		{
   382 		{
   366 		TRAP( status, StartDSSessionL() );	
   383 		// Scenario 1:
       
   384 		// Fix for cancel not happening when cancel key is
       
   385 		// pressed .
       
   386         if(!iSyncCancelled)
       
   387             {
       
   388             TRAP( status, StartDSSessionL() );	
       
   389             }
       
   390         else
       
   391             {
       
   392 			// Sync is cancelled from the UI before the
       
   393 			// the job session has started.
       
   394 			// Fix for cancel not happening when cancel key is
       
   395 			// pressed .
       
   396             status = KErrCancel;
       
   397             iSyncCancelled = EFalse;
       
   398             }
   367 		}
   399 		}
   368 	
   400 	
   369 	if ( status != KErrNone )
   401 	if ( status != KErrNone )
   370 	    {
   402 	    {
   371 	   	TRequestStatus* sStatus = &iStatus;
   403 	   	TRequestStatus* sStatus = &iStatus;
   379 // Cancel current running job
   411 // Cancel current running job
   380 // --------------------------------------------------------------------------
   412 // --------------------------------------------------------------------------
   381 //
   413 //
   382 void CNSmlThreadEngine::CancelJob()
   414 void CNSmlThreadEngine::CancelJob()
   383 	{
   415 	{
       
   416 	// Fix for cancel not happening when cancel key is
       
   417 	// pressed .
       
   418     // job has been created but it is not running and from ui
       
   419     // Cancel has been called
       
   420     iSyncCancelled = ETrue;
   384 	if ( iCancelTimeout )
   421 	if ( iCancelTimeout )
   385 	    {
   422 	    {
   386 		iCancelTimeout->SetJobCancelled( iThreadParams.iCurrentJob.UsageType() );
   423 		iCancelTimeout->SetJobCancelled( iThreadParams.iCurrentJob.UsageType() );
   387 	    }	
   424 	    }	
   388 	}
   425 	}
   429 	
   466 	
   430 	iCancelTimeout = new (ELeave) CNSmlCancelTimeOut( *iDMAgent, *iDSAgent );
   467 	iCancelTimeout = new (ELeave) CNSmlCancelTimeOut( *iDMAgent, *iDSAgent );
   431 	
   468 	
   432 	// Select correct sync method and start sync
   469 	// Select correct sync method and start sync
   433 	TNSmlSyncInitiation syncInit = (TNSmlSyncInitiation)iThreadParams.iSyncInit;
   470 	TNSmlSyncInitiation syncInit = (TNSmlSyncInitiation)iThreadParams.iSyncInit;
   434 	
   471 	// Scenario 2:
       
   472 	// Fix for cancel not happening when cancel key is
       
   473 	// pressed .
       
   474 	if(iSyncCancelled)
       
   475 	    {
       
   476 	    iSyncCancelled = EFalse;
       
   477         User::Leave( KErrCancel );
       
   478 	    }
       
   479 
   435     switch ( iThreadParams.iCurrentJob.JobType() )
   480     switch ( iThreadParams.iCurrentJob.JobType() )
   436         {
   481         {
   437         case EDSJobProfile:
   482         case EDSJobProfile:
   438             iDSAgent->Synchronise( iStatus, iThreadParams.iCurrentJob.ProfileId(), KNSmlNullId, NULL, syncInit );
   483             iDSAgent->Synchronise( iStatus, iThreadParams.iCurrentJob.ProfileId(), KNSmlNullId, NULL, syncInit );
   439             break;           
   484             break;           
   466 // --------------------------------------------------------------------------
   511 // --------------------------------------------------------------------------
   467 // CNSmlThreadEngine::VerifyJobFromNotifierL()
   512 // CNSmlThreadEngine::VerifyJobFromNotifierL()
   468 // Launches notifier and waits for 
   513 // Launches notifier and waits for 
   469 // --------------------------------------------------------------------------
   514 // --------------------------------------------------------------------------
   470 //
   515 //
   471 TInt CNSmlThreadEngine::VerifyJobFromNotifierL(TBool aServerInitiated)
   516 TInt CNSmlThreadEngine::VerifyJobFromNotifierL()
   472     {
   517 	{
   473     LOGSTRING("CNSmlThreadEngine::VerifyJobFromNotifierL()");
   518 	_DBG_FILE("CNSmlThreadEngine::VerifyJobFromNotifierL() : Begin");
   474     LOGSTRING("CNSmlThreadEngine::VerifyJobFromNotifierL() : Begin");
   519 	iNotifierObserver = new (ELeave) CNSmlNotifierObserver(iStatus, iThreadParams);
   475     LOGSTRING2("VerifyJobFromNotifierL before iCallerStatus == iStatus in Threadengine %d", iStatus.Int());
   520 	SetActive();
   476     iNotifierObserver = new (ELeave) CNSmlNotifierObserver(iStatus,
   521 	
   477             iThreadParams);
   522 	TSyncMLAppLaunchNotifParams params;
   478     SetActive();
   523 	params.iSessionType = ( iThreadParams.iCurrentJob.UsageType() == ESmlDataSync ) ? ESyncMLSyncSession : ESyncMLMgmtSession;
   479     LOGSTRING2("VerifyJobFromNotifierL before iCallerStatus == iStatus in Threadengine %d after setactive", iStatus.Int());
   524 	params.iJobId = iThreadParams.iCurrentJob.JobId();
   480     TSyncMLAppLaunchNotifParams params;
   525 	params.iProfileId = iThreadParams.iCurrentJob.ProfileId();
   481     params.iSessionType = (iThreadParams.iCurrentJob.UsageType()
   526     params.iUimode = iThreadParams.iCurrentJob.iUimode;	
   482             == ESmlDataSync) ? ESyncMLSyncSession : ESyncMLMgmtSession;
   527 	iNotifierObserver->ConnectToNotifierL( params );
   483     params.iJobId = iThreadParams.iCurrentJob.JobId();
   528 	_DBG_FILE("CNSmlThreadEngine::VerifyJobFromNotifierL() : End");
   484     params.iProfileId = iThreadParams.iCurrentJob.ProfileId();
       
   485     params.iUimode = iThreadParams.iCurrentJob.iUimode;
       
   486     iNotifierObserver->ConnectToNotifierL(params);
       
   487     LOGSTRING2("iCallerStatus in iNotifierObserver->ConnectToNotifierL( params ); %d", iStatus.Int());
       
   488     LOGSTRING("CNSmlThreadEngine::VerifyJobFromNotifierL() : End");
       
   489     return KErrNone;
   529     return KErrNone;
   490 	}
   530 	}
   491 
   531 
   492 // --------------------------------------------------------------------------
   532 // --------------------------------------------------------------------------
   493 // CNSmlThreadEngine::DMAgentL()
   533 // CNSmlThreadEngine::DMAgentL()
   782 // --------------------------------------------------------------------------
   822 // --------------------------------------------------------------------------
   783 // CNSmlNotifierObserver::CNSmlNotifierObserver(TRequestStatus& aStatus, CNSmlThreadEngine* aEngine, CNSmlThreadParams& aParams)
   823 // CNSmlNotifierObserver::CNSmlNotifierObserver(TRequestStatus& aStatus, CNSmlThreadEngine* aEngine, CNSmlThreadParams& aParams)
   784 // Constructor
   824 // Constructor
   785 // --------------------------------------------------------------------------
   825 // --------------------------------------------------------------------------
   786 //	
   826 //	
   787 CNSmlNotifierObserver::CNSmlNotifierObserver(TRequestStatus& aStatus,
   827 CNSmlNotifierObserver::CNSmlNotifierObserver(TRequestStatus& aStatus, CNSmlThreadParams& aParams)
   788         CNSmlThreadParams& aParams) :
   828 : CActive(0), iCallerStatus(aStatus), iThreadParams(aParams)
   789     CActive(0), iCallerStatus(aStatus), iThreadParams(aParams)
   829 	{
   790     {
   830 	CActiveScheduler::Add(this);
   791     LOGSTRING2("iCallerStatus in RunL %d", iCallerStatus.Int());
   831 	}
   792     // If the current job is DM job then proceed to use Hb Notifiers
       
   793     
       
   794     if(aParams.iCurrentJob.UsageType() == ESmlDevMan)
       
   795         {    
       
   796         TRAP_IGNORE(iHbSyncmlNotifierEnabled = IsHbSyncmlNotifierEnabledL());
       
   797         }
       
   798     
       
   799     CActiveScheduler::Add(this);
       
   800     }
       
   801 
   832 
   802 // --------------------------------------------------------------------------
   833 // --------------------------------------------------------------------------
   803 // CNSmlNotifierObserver::~CNSmlNotifierObserver()
   834 // CNSmlNotifierObserver::~CNSmlNotifierObserver()
   804 // Destructor
   835 // Destructor
   805 // --------------------------------------------------------------------------
   836 // --------------------------------------------------------------------------
   806 //	
   837 //	
   807 CNSmlNotifierObserver::~CNSmlNotifierObserver()
   838 CNSmlNotifierObserver::~CNSmlNotifierObserver()
   808     {
   839 	{
   809     LOGSTRING("~CNSmlNotifierObserver");
   840 	
   810     // StartNotifier called to avoid Notifier server panic, if 
   841 	// StartNotifier called to avoid Notifier server panic, if 
   811     // notifier does not exist anymore.
   842 	// notifier does not exist anymore.
   812     TBuf8<1> dummy;
   843 	TBuf8<1> dummy;	
   813 
   844 	iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
   814     if (!iHbSyncmlNotifierEnabled)
   845 	
   815         {
   846 	iNotifier.CancelNotifier( KUidNotifier );
   816 //        iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
   847 	iNotifier.Close();
   817 
   848 	Cancel();
   818 //        iNotifier.CancelNotifier(KUidNotifier);
   849 	}
   819 //        iNotifier.Close();
       
   820         }
       
   821     else
       
   822         {
       
   823         if(iDmDevdialog.Handle() )
       
   824              iDmDevdialog.Close();
       
   825         }
       
   826 
       
   827     Cancel();
       
   828     }
       
   829 
   850 
   830 // --------------------------------------------------------------------------
   851 // --------------------------------------------------------------------------
   831 // CNSmlNotifierObserver::ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam )
   852 // CNSmlNotifierObserver::ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam )
   832 // Starts connection with notifier
   853 // Starts connection with notifier
   833 // --------------------------------------------------------------------------
   854 // --------------------------------------------------------------------------
   834 //		
   855 //		
   835 void CNSmlNotifierObserver::ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam )
   856 void CNSmlNotifierObserver::ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam )
   836 	{
   857 	{
   837 		_DBG_FILE( "CNSmlNotifierObserver::ConnectToNotifierL:Begin" );
   858 	_DBG_FILE( "CNSmlNotifierObserver::ConnectToNotifierL:Begin" );
   838 		iTimeOut = EFalse;
   859 	iTimeOut = EFalse;
       
   860 	
       
   861 	if ( !IsActive() )
       
   862 		{
       
   863 		SetActive();
       
   864 		}
       
   865 		
       
   866 	   
       
   867     TSyncMLAppLaunchNotifParamsPckg data( aParam );
   839     
   868     
   840     if ( !KNSmlWaitNotifierForEver )
   869     if ( !KNSmlWaitNotifierForEver )
   841         {
   870         {
   842         iNotifierTimeOut.LaunchNotifierTimer( this );
   871         iNotifierTimeOut.LaunchNotifierTimer( this );
   843         }
   872         }
   844 
   873         
   845     if (!iHbSyncmlNotifierEnabled)
   874     TInt err = iNotifier.Connect();
   846     {
   875     if ( err == KErrNone )
   847     	LOGSTRING2( "CNSmlNotifierObserver::ConnectToNotifierL %d after connect, StartNotifierAndGetResponse and after setactive" , iStatus.Int());
       
   848     }
       
   849     else
       
   850     {
       
   851        iStatus = KRequestPending;
       
   852        HbNotifierObserverL(aParam);
       
   853     }
       
   854     if ( !IsActive() )
       
   855     {
       
   856     	SetActive();
       
   857     }      
       
   858      _DBG_FILE("CNSmlNotifierObserver::ConnectToNotifierL:End");   
       
   859 	}
       
   860 
       
   861 // --------------------------------------------------------------------------
       
   862 // CNSmlNotifierObserver::IsHbNotifierEnabled()
       
   863 // Launch Hb Notifier Process
       
   864 // --------------------------------------------------------------------------
       
   865 //
       
   866 TBool CNSmlNotifierObserver::IsHbSyncmlNotifierEnabledL()
       
   867     {
       
   868     CRepository * rep =
       
   869             CRepository::NewLC(KCRUidDeviceManagementInternalKeys);
       
   870 
       
   871     TInt notifierenabled = KErrNone;
       
   872 
       
   873     TInt err = rep->Get(KDevManEnableHbNotifier, notifierenabled);
       
   874 
       
   875     CleanupStack::PopAndDestroy(rep);
       
   876 
       
   877     if (err == KErrNone && notifierenabled)
       
   878         {
   876         {
   879         return ETrue;
   877         iNotifier.StartNotifierAndGetResponse( iStatus, KUidNotifier, data, iResBuf );                
   880         }
   878         }
   881     else
   879     else
   882         {
   880         {
   883         return EFalse;
   881         // Stop job. Error connecting to notifier.
       
   882         TRequestStatus* sStatus = &iStatus;
       
   883 		User::RequestComplete( sStatus, err );            
   884         }
   884         }
   885 
   885      _DBG_FILE("CNSmlNotifierObserver::ConnectToNotifierL:End");   
   886     }
   886 	}
   887 
       
   888 // --------------------------------------------------------------------------
       
   889 // CNSmlNotifierObserver::HbNotifierObserverL()
       
   890 // Launch Hb Notifier Process
       
   891 // --------------------------------------------------------------------------
       
   892 //
       
   893 void CNSmlNotifierObserver::HbNotifierObserverL(const TSyncMLAppLaunchNotifParams& aParam)
       
   894     {
       
   895 
       
   896     LOGSTRING2("iCallerStatus before HbNotifierObserverL creation %d", iCallerStatus.Int());
       
   897    TInt err = iDmDevdialog.OpenL();
       
   898    User::LeaveIfError(err);
       
   899   iDmDevdialog.LaunchPkgZero(aParam.iProfileId,aParam.iJobId,aParam.iUimode,iResBuf,iStatus);
       
   900      
       
   901     LOGSTRING2("CNSmlNotifierObserver hb notifier %d after subscribe", iStatus.Int());
       
   902 
       
   903     LOGSTRING2("iCallerStatus before HbNotifierObserverL creation %d", iCallerStatus.Int());
       
   904     }
       
   905 
   887 
   906 // --------------------------------------------------------------------------
   888 // --------------------------------------------------------------------------
   907 // CNSmlNotifierObserver::NotifierTimeOut()
   889 // CNSmlNotifierObserver::NotifierTimeOut()
   908 // Starts notifier time out timer
   890 // Starts notifier time out timer
   909 // --------------------------------------------------------------------------
   891 // --------------------------------------------------------------------------
   910 //
   892 //
   911 void CNSmlNotifierObserver::NotifierTimeOut()
   893 void CNSmlNotifierObserver::NotifierTimeOut()
   912     {
   894 	{
   913     LOGSTRING("CNSmlNotifierObserver NotifierTimeOut ");
   895 	iTimeOut = ETrue;
   914     iTimeOut = ETrue;
   896 	
   915 
   897 	// StartNotifier called to avoid Notifier server panic, if 
   916     // StartNotifier called to avoid Notifier server panic, if 
   898 	// notifier does not exist anymore.
   917     // notifier does not exist anymore.
   899 	TBuf8<1> dummy;
   918     if(!iHbSyncmlNotifierEnabled)
   900 	iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
   919         {
   901 	iNotifier.CancelNotifier( KUidNotifier );
   920         TBuf8<1> dummy;
   902 	}
   921 //        iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
       
   922 //        iNotifier.CancelNotifier( KUidNotifier );
       
   923         }
       
   924     else
       
   925         {
       
   926         iProperty.Close();
       
   927         }
       
   928     }
       
   929 
   903 
   930 // --------------------------------------------------------------------------
   904 // --------------------------------------------------------------------------
   931 // CNSmlNotifierObserver::DoCancel()
   905 // CNSmlNotifierObserver::DoCancel()
   932 // From base class
   906 // From base class
   933 // --------------------------------------------------------------------------
   907 // --------------------------------------------------------------------------
   940 // CNSmlNotifierObserver::RunL()
   914 // CNSmlNotifierObserver::RunL()
   941 // From base class
   915 // From base class
   942 // --------------------------------------------------------------------------
   916 // --------------------------------------------------------------------------
   943 //	
   917 //	
   944 void CNSmlNotifierObserver::RunL()
   918 void CNSmlNotifierObserver::RunL()
   945     {
   919 	{
   946 
   920 	    
   947 
       
   948 
       
   949     LOGSTRING("CNSmlNotifierObserver RunL start");
       
   950 
       
   951     TInt ret = iStatus.Int();
   921     TInt ret = iStatus.Int();
   952     if ( ret == KErrCancel && iTimeOut )
   922     if ( ret == KErrCancel && iTimeOut )
   953     	{
   923     	{
   954     	
   924     	
   955     	}
   925     	}
   956     else
   926     else
   957     if ( ret == KErrNone )
   927     if ( ret == KErrNone )
   958     	{	   
   928     	{	   
   959         
   929         
   960 	  	TInt sid = iResBuf(); // read secure id from notifier.
   930 	  	TInt sid = iResBuf().iSecureId.iUid; // read secure id from notifier.
   961 	   	
   931 	   	
   962 	    // Check the response and error code. If there is a fail, dump the job.        
   932 	    // Check the response and error code. If there is a fail, dump the job.        
   963 	    // Also compare sid to creator id saved for current job to secure that listener owns the job.
   933 	    // Also compare sid to creator id saved for current job to secure that listener owns the job.
   964 	    if ( ret != KErrNone || sid != iThreadParams.iCurrentJob.CreatorId() )
   934 	    if ( ret != KErrNone || sid != iThreadParams.iCurrentJob.CreatorId() )
   965 	        {
   935 	        {