diff -r a082c848c9a9 -r 3cdbd92ee07b syncmlfw/common/sosserver/src/nsmlsosthread.cpp --- a/syncmlfw/common/sosserver/src/nsmlsosthread.cpp Wed Sep 15 13:08:27 2010 +0300 +++ b/syncmlfw/common/sosserver/src/nsmlsosthread.cpp Wed Oct 13 15:30:06 2010 +0300 @@ -147,9 +147,7 @@ FeatureManager::InitializeLibL(); iThreadParams.iThreadEngine = this; iContentArray = new(ELeave) CArrayFixFlat(1); - // Fix for cancel not happening when cancel key is - // pressed . - iSyncCancelled = EFalse; + if ( iThreadParams.iCSArray ) { for (TInt i = 0; i < iThreadParams.iCSArray->Count(); i++) @@ -339,63 +337,11 @@ TInt status( KErrNone ); if ( iThreadParams.iCurrentJob.UsageType() == ESmlDevMan ) { - CRepository* centrep = NULL; - TRAPD( err, centrep = CRepository::NewL(KCRUidDeviceManagementInternalKeys)); - TInt phoneLock(0); - TInt factoryProfileID(0); - if (err==KErrNone ) - { - TInt err = centrep->Get( KLAWMOPhoneLock , phoneLock ); - err = centrep->Get( KLAWMOfactoryDmProfileID , factoryProfileID ); - delete centrep; - centrep = NULL; - } - if(phoneLock != 30) - { - _DBG_FILE("CNSmlThreadEngine phonelock != 30"); - if(factoryProfileID>0) - { - - TInt profileId = iThreadParams.iCurrentJob.ProfileId(); - - if(profileId!= factoryProfileID) - { - _DBG_FILE("CNSmlThreadEngine profid doesnt match with factory"); - TRequestStatus* stat = &iStatus; - User::RequestComplete( stat, KErrNone ); - return; - } - - } - else - { - _DBG_FILE("CNSmlThreadEngine factoryprofileid<0"); - TRequestStatus* stat = &iStatus; - User::RequestComplete( stat, KErrNone ); - return; - } - } - _DBG_FILE("CNSmlThreadEngine startDMSessionL"); TRAP( status, StartDMSessionL() ); } else { - // Scenario 1: - // Fix for cancel not happening when cancel key is - // pressed . - if(!iSyncCancelled) - { - TRAP( status, StartDSSessionL() ); - } - else - { - // Sync is cancelled from the UI before the - // the job session has started. - // Fix for cancel not happening when cancel key is - // pressed . - status = KErrCancel; - iSyncCancelled = EFalse; - } + TRAP( status, StartDSSessionL() ); } if ( status != KErrNone ) @@ -413,11 +359,6 @@ // void CNSmlThreadEngine::CancelJob() { - // Fix for cancel not happening when cancel key is - // pressed . - // job has been created but it is not running and from ui - // Cancel has been called - iSyncCancelled = ETrue; if ( iCancelTimeout ) { iCancelTimeout->SetJobCancelled( iThreadParams.iCurrentJob.UsageType() ); @@ -468,15 +409,7 @@ // Select correct sync method and start sync TNSmlSyncInitiation syncInit = (TNSmlSyncInitiation)iThreadParams.iSyncInit; - // Scenario 2: - // Fix for cancel not happening when cancel key is - // pressed . - if(iSyncCancelled) - { - iSyncCancelled = EFalse; - User::Leave( KErrCancel ); - } - + switch ( iThreadParams.iCurrentJob.JobType() ) { case EDSJobProfile: