syncmlfw/common/sosserver/src/nsmlsosthread.cpp
branchRCL_3
changeset 61 b183ec05bd8c
parent 59 13d7c31c74e0
child 62 19bba8228ff0
equal deleted inserted replaced
59:13d7c31c74e0 61:b183ec05bd8c
    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 
    22 #include "PnpLogger.h"
    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   
    30 // --------------------------------------------------------------------------
    51 // --------------------------------------------------------------------------
    31 // EXPORT_C TInt ThreadFunction( TAny* )
    52 // EXPORT_C TInt ThreadFunction( TAny* )
    32 // --------------------------------------------------------------------------
    53 // --------------------------------------------------------------------------
    33 //
    54 //
    34 TInt ThreadFunction( TAny* aStarted )
    55 TInt ThreadFunction( TAny* aStarted )
    68 			}
    89 			}
    69 		else
    90 		else
    70 			{
    91 			{
    71 			//if not a silent mode behave as in a normal DM session
    92 			//if not a silent mode behave as in a normal DM session
    72 			threadEngine->ForcedCertificateCheckL( EFalse );
    93 			threadEngine->ForcedCertificateCheckL( EFalse );
    73 			threadEngine->VerifyJobFromNotifierL();		
    94 			threadEngine->VerifyJobFromNotifierL(ETrue);		
    74 			}
    95 			}
    75 		}
    96 		}
    76 	else
    97 	else
    77 		{
    98 		{
    78 		//when sync session is not alerted behave as in a normal DM session
    99 		//when sync session is not alerted behave as in a normal DM session
    98 	    if ( threadEngine->IsActive() )
   119 	    if ( threadEngine->IsActive() )
    99 	        {
   120 	        {
   100 	        CActiveScheduler::Start();                
   121 	        CActiveScheduler::Start();                
   101 	        }	    
   122 	        }	    
   102 	    }	
   123 	    }	
   103 	
   124 	LOGSTRING("P&S is deleted");  
       
   125 	RProperty::Delete(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob);
   104 	delete scheduler;
   126 	delete scheduler;
   105 	
   127 	
   106 	if ( endStatus == KErrNone )
   128 	if ( endStatus == KErrNone )
   107 		{
   129 		{
   108 		endStatus = threadEngine->FinishedStatus();	
   130 		endStatus = threadEngine->FinishedStatus();	
   145 void CNSmlThreadEngine::ConstructL()
   167 void CNSmlThreadEngine::ConstructL()
   146 	{
   168 	{
   147 		FeatureManager::InitializeLibL();
   169 		FeatureManager::InitializeLibL();
   148 	iThreadParams.iThreadEngine = this;
   170 	iThreadParams.iThreadEngine = this;
   149 	iContentArray = new(ELeave) CArrayFixFlat<TNSmlContentSpecificSyncType>(1);
   171 	iContentArray = new(ELeave) CArrayFixFlat<TNSmlContentSpecificSyncType>(1);
   150 	// Fix for cancel not happening when cancel key is
   172 	
   151 	// pressed .
       
   152 	iSyncCancelled = EFalse;
       
   153 	if ( iThreadParams.iCSArray )
   173 	if ( iThreadParams.iCSArray )
   154 		{
   174 		{
   155 		for (TInt i = 0; i < iThreadParams.iCSArray->Count(); i++)
   175 		for (TInt i = 0; i < iThreadParams.iCSArray->Count(); i++)
   156 			{
   176 			{
   157 			TNSmlContentSpecificSyncType type;
   177 			TNSmlContentSpecificSyncType type;
   337 		}
   357 		}
   338 		
   358 		
   339 	TInt status( KErrNone );			
   359 	TInt status( KErrNone );			
   340 	if ( iThreadParams.iCurrentJob.UsageType() == ESmlDevMan )
   360 	if ( iThreadParams.iCurrentJob.UsageType() == ESmlDevMan )
   341 		{
   361 		{
   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");
       
   379 		TRAP( status, StartDMSessionL() );
   362 		TRAP( status, StartDMSessionL() );
   380 		}
   363 		}
   381 	else
   364 	else
   382 		{
   365 		{
   383 		// Scenario 1:
   366 		TRAP( status, StartDSSessionL() );	
   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             }
       
   399 		}
   367 		}
   400 	
   368 	
   401 	if ( status != KErrNone )
   369 	if ( status != KErrNone )
   402 	    {
   370 	    {
   403 	   	TRequestStatus* sStatus = &iStatus;
   371 	   	TRequestStatus* sStatus = &iStatus;
   411 // Cancel current running job
   379 // Cancel current running job
   412 // --------------------------------------------------------------------------
   380 // --------------------------------------------------------------------------
   413 //
   381 //
   414 void CNSmlThreadEngine::CancelJob()
   382 void CNSmlThreadEngine::CancelJob()
   415 	{
   383 	{
   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;
       
   421 	if ( iCancelTimeout )
   384 	if ( iCancelTimeout )
   422 	    {
   385 	    {
   423 		iCancelTimeout->SetJobCancelled( iThreadParams.iCurrentJob.UsageType() );
   386 		iCancelTimeout->SetJobCancelled( iThreadParams.iCurrentJob.UsageType() );
   424 	    }	
   387 	    }	
   425 	}
   388 	}
   466 	
   429 	
   467 	iCancelTimeout = new (ELeave) CNSmlCancelTimeOut( *iDMAgent, *iDSAgent );
   430 	iCancelTimeout = new (ELeave) CNSmlCancelTimeOut( *iDMAgent, *iDSAgent );
   468 	
   431 	
   469 	// Select correct sync method and start sync
   432 	// Select correct sync method and start sync
   470 	TNSmlSyncInitiation syncInit = (TNSmlSyncInitiation)iThreadParams.iSyncInit;
   433 	TNSmlSyncInitiation syncInit = (TNSmlSyncInitiation)iThreadParams.iSyncInit;
   471 	// Scenario 2:
   434 	
   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 
       
   480     switch ( iThreadParams.iCurrentJob.JobType() )
   435     switch ( iThreadParams.iCurrentJob.JobType() )
   481         {
   436         {
   482         case EDSJobProfile:
   437         case EDSJobProfile:
   483             iDSAgent->Synchronise( iStatus, iThreadParams.iCurrentJob.ProfileId(), KNSmlNullId, NULL, syncInit );
   438             iDSAgent->Synchronise( iStatus, iThreadParams.iCurrentJob.ProfileId(), KNSmlNullId, NULL, syncInit );
   484             break;           
   439             break;           
   511 // --------------------------------------------------------------------------
   466 // --------------------------------------------------------------------------
   512 // CNSmlThreadEngine::VerifyJobFromNotifierL()
   467 // CNSmlThreadEngine::VerifyJobFromNotifierL()
   513 // Launches notifier and waits for 
   468 // Launches notifier and waits for 
   514 // --------------------------------------------------------------------------
   469 // --------------------------------------------------------------------------
   515 //
   470 //
   516 TInt CNSmlThreadEngine::VerifyJobFromNotifierL()
   471 TInt CNSmlThreadEngine::VerifyJobFromNotifierL(TBool aServerInitiated)
   517 	{
   472     {
   518 	_DBG_FILE("CNSmlThreadEngine::VerifyJobFromNotifierL() : Begin");
   473     LOGSTRING("CNSmlThreadEngine::VerifyJobFromNotifierL()");
   519 	iNotifierObserver = new (ELeave) CNSmlNotifierObserver(iStatus, iThreadParams);
   474     LOGSTRING("CNSmlThreadEngine::VerifyJobFromNotifierL() : Begin");
   520 	SetActive();
   475     LOGSTRING2("VerifyJobFromNotifierL before iCallerStatus == iStatus in Threadengine %d", iStatus.Int());
   521 	
   476     iNotifierObserver = new (ELeave) CNSmlNotifierObserver(iStatus,
   522 	TSyncMLAppLaunchNotifParams params;
   477             iThreadParams);
   523 	params.iSessionType = ( iThreadParams.iCurrentJob.UsageType() == ESmlDataSync ) ? ESyncMLSyncSession : ESyncMLMgmtSession;
   478     SetActive();
   524 	params.iJobId = iThreadParams.iCurrentJob.JobId();
   479     LOGSTRING2("VerifyJobFromNotifierL before iCallerStatus == iStatus in Threadengine %d after setactive", iStatus.Int());
   525 	params.iProfileId = iThreadParams.iCurrentJob.ProfileId();
   480     TSyncMLAppLaunchNotifParams params;
   526     params.iUimode = iThreadParams.iCurrentJob.iUimode;	
   481     params.iSessionType = (iThreadParams.iCurrentJob.UsageType()
   527 	iNotifierObserver->ConnectToNotifierL( params );
   482             == ESmlDataSync) ? ESyncMLSyncSession : ESyncMLMgmtSession;
   528 	_DBG_FILE("CNSmlThreadEngine::VerifyJobFromNotifierL() : End");
   483     params.iJobId = iThreadParams.iCurrentJob.JobId();
       
   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");
   529     return KErrNone;
   489     return KErrNone;
   530 	}
   490 	}
   531 
   491 
   532 // --------------------------------------------------------------------------
   492 // --------------------------------------------------------------------------
   533 // CNSmlThreadEngine::DMAgentL()
   493 // CNSmlThreadEngine::DMAgentL()
   822 // --------------------------------------------------------------------------
   782 // --------------------------------------------------------------------------
   823 // CNSmlNotifierObserver::CNSmlNotifierObserver(TRequestStatus& aStatus, CNSmlThreadEngine* aEngine, CNSmlThreadParams& aParams)
   783 // CNSmlNotifierObserver::CNSmlNotifierObserver(TRequestStatus& aStatus, CNSmlThreadEngine* aEngine, CNSmlThreadParams& aParams)
   824 // Constructor
   784 // Constructor
   825 // --------------------------------------------------------------------------
   785 // --------------------------------------------------------------------------
   826 //	
   786 //	
   827 CNSmlNotifierObserver::CNSmlNotifierObserver(TRequestStatus& aStatus, CNSmlThreadParams& aParams)
   787 CNSmlNotifierObserver::CNSmlNotifierObserver(TRequestStatus& aStatus,
   828 : CActive(0), iCallerStatus(aStatus), iThreadParams(aParams)
   788         CNSmlThreadParams& aParams) :
   829 	{
   789     CActive(0), iCallerStatus(aStatus), iThreadParams(aParams)
   830 	CActiveScheduler::Add(this);
   790     {
   831 	}
   791     LOGSTRING2("iCallerStatus in RunL %d", iCallerStatus.Int());
       
   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     }
   832 
   801 
   833 // --------------------------------------------------------------------------
   802 // --------------------------------------------------------------------------
   834 // CNSmlNotifierObserver::~CNSmlNotifierObserver()
   803 // CNSmlNotifierObserver::~CNSmlNotifierObserver()
   835 // Destructor
   804 // Destructor
   836 // --------------------------------------------------------------------------
   805 // --------------------------------------------------------------------------
   837 //	
   806 //	
   838 CNSmlNotifierObserver::~CNSmlNotifierObserver()
   807 CNSmlNotifierObserver::~CNSmlNotifierObserver()
   839 	{
   808     {
   840 	
   809     LOGSTRING("~CNSmlNotifierObserver");
   841 	// StartNotifier called to avoid Notifier server panic, if 
   810     // StartNotifier called to avoid Notifier server panic, if 
   842 	// notifier does not exist anymore.
   811     // notifier does not exist anymore.
   843 	TBuf8<1> dummy;	
   812     TBuf8<1> dummy;
   844 	iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
   813 
   845 	
   814     if (!iHbSyncmlNotifierEnabled)
   846 	iNotifier.CancelNotifier( KUidNotifier );
   815         {
   847 	iNotifier.Close();
   816 //        iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
   848 	Cancel();
   817 
   849 	}
   818 //        iNotifier.CancelNotifier(KUidNotifier);
       
   819 //        iNotifier.Close();
       
   820         }
       
   821     else
       
   822         {
       
   823         if(iDmDevdialog.Handle() )
       
   824              iDmDevdialog.Close();
       
   825         }
       
   826 
       
   827     Cancel();
       
   828     }
   850 
   829 
   851 // --------------------------------------------------------------------------
   830 // --------------------------------------------------------------------------
   852 // CNSmlNotifierObserver::ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam )
   831 // CNSmlNotifierObserver::ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam )
   853 // Starts connection with notifier
   832 // Starts connection with notifier
   854 // --------------------------------------------------------------------------
   833 // --------------------------------------------------------------------------
   855 //		
   834 //		
   856 void CNSmlNotifierObserver::ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam )
   835 void CNSmlNotifierObserver::ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam )
   857 	{
   836 	{
   858 	_DBG_FILE( "CNSmlNotifierObserver::ConnectToNotifierL:Begin" );
   837 		_DBG_FILE( "CNSmlNotifierObserver::ConnectToNotifierL:Begin" );
   859 	iTimeOut = EFalse;
   838 		iTimeOut = EFalse;
   860 	
       
   861 	if ( !IsActive() )
       
   862 		{
       
   863 		SetActive();
       
   864 		}
       
   865 		
       
   866 	   
       
   867     TSyncMLAppLaunchNotifParamsPckg data( aParam );
       
   868     
   839     
   869     if ( !KNSmlWaitNotifierForEver )
   840     if ( !KNSmlWaitNotifierForEver )
   870         {
   841         {
   871         iNotifierTimeOut.LaunchNotifierTimer( this );
   842         iNotifierTimeOut.LaunchNotifierTimer( this );
   872         }
   843         }
   873         
   844 
   874     TInt err = iNotifier.Connect();
   845     if (!iHbSyncmlNotifierEnabled)
   875     if ( err == KErrNone )
   846     {
       
   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)
   876         {
   878         {
   877         iNotifier.StartNotifierAndGetResponse( iStatus, KUidNotifier, data, iResBuf );                
   879         return ETrue;
   878         }
   880         }
   879     else
   881     else
   880         {
   882         {
   881         // Stop job. Error connecting to notifier.
   883         return EFalse;
   882         TRequestStatus* sStatus = &iStatus;
       
   883 		User::RequestComplete( sStatus, err );            
       
   884         }
   884         }
   885      _DBG_FILE("CNSmlNotifierObserver::ConnectToNotifierL:End");   
   885 
   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     }
   887 
   905 
   888 // --------------------------------------------------------------------------
   906 // --------------------------------------------------------------------------
   889 // CNSmlNotifierObserver::NotifierTimeOut()
   907 // CNSmlNotifierObserver::NotifierTimeOut()
   890 // Starts notifier time out timer
   908 // Starts notifier time out timer
   891 // --------------------------------------------------------------------------
   909 // --------------------------------------------------------------------------
   892 //
   910 //
   893 void CNSmlNotifierObserver::NotifierTimeOut()
   911 void CNSmlNotifierObserver::NotifierTimeOut()
   894 	{
   912     {
   895 	iTimeOut = ETrue;
   913     LOGSTRING("CNSmlNotifierObserver NotifierTimeOut ");
   896 	
   914     iTimeOut = ETrue;
   897 	// StartNotifier called to avoid Notifier server panic, if 
   915 
   898 	// notifier does not exist anymore.
   916     // StartNotifier called to avoid Notifier server panic, if 
   899 	TBuf8<1> dummy;
   917     // notifier does not exist anymore.
   900 	iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
   918     if(!iHbSyncmlNotifierEnabled)
   901 	iNotifier.CancelNotifier( KUidNotifier );
   919         {
   902 	}
   920         TBuf8<1> dummy;
       
   921 //        iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
       
   922 //        iNotifier.CancelNotifier( KUidNotifier );
       
   923         }
       
   924     else
       
   925         {
       
   926         iProperty.Close();
       
   927         }
       
   928     }
   903 
   929 
   904 // --------------------------------------------------------------------------
   930 // --------------------------------------------------------------------------
   905 // CNSmlNotifierObserver::DoCancel()
   931 // CNSmlNotifierObserver::DoCancel()
   906 // From base class
   932 // From base class
   907 // --------------------------------------------------------------------------
   933 // --------------------------------------------------------------------------
   914 // CNSmlNotifierObserver::RunL()
   940 // CNSmlNotifierObserver::RunL()
   915 // From base class
   941 // From base class
   916 // --------------------------------------------------------------------------
   942 // --------------------------------------------------------------------------
   917 //	
   943 //	
   918 void CNSmlNotifierObserver::RunL()
   944 void CNSmlNotifierObserver::RunL()
   919 	{
   945     {
   920 	    
   946 
       
   947 
       
   948 
       
   949     LOGSTRING("CNSmlNotifierObserver RunL start");
       
   950 
   921     TInt ret = iStatus.Int();
   951     TInt ret = iStatus.Int();
   922     if ( ret == KErrCancel && iTimeOut )
   952     if ( ret == KErrCancel && iTimeOut )
   923     	{
   953     	{
   924     	
   954     	
   925     	}
   955     	}
   926     else
   956     else
   927     if ( ret == KErrNone )
   957     if ( ret == KErrNone )
   928     	{	   
   958     	{	   
   929         
   959         
   930 	  	TInt sid = iResBuf().iSecureId.iUid; // read secure id from notifier.
   960 	  	TInt sid = iResBuf(); // read secure id from notifier.
   931 	   	
   961 	   	
   932 	    // Check the response and error code. If there is a fail, dump the job.        
   962 	    // Check the response and error code. If there is a fail, dump the job.        
   933 	    // Also compare sid to creator id saved for current job to secure that listener owns the job.
   963 	    // Also compare sid to creator id saved for current job to secure that listener owns the job.
   934 	    if ( ret != KErrNone || sid != iThreadParams.iCurrentJob.CreatorId() )
   964 	    if ( ret != KErrNone || sid != iThreadParams.iCurrentJob.CreatorId() )
   935 	        {
   965 	        {