equal
deleted
inserted
replaced
249 //CMsvServer |
249 //CMsvServer |
250 //********************************** |
250 //********************************** |
251 |
251 |
252 |
252 |
253 CMsvServer::CMsvServer(TInt aPriority, TBool aDebug) |
253 CMsvServer::CMsvServer(TInt aPriority, TBool aDebug) |
254 : CPolicyServer(aPriority, msgServerPolicy), iSessionNumber(1), iMtmOperationQueueArray(KMsvMtmOpsQueueArrayGranularity), iDebug(aDebug) |
254 : CPolicyServer(aPriority, msgServerPolicy), iSessionNumber(1), iMtmOperationQueueArray(KMsvMtmOpsQueueArrayGranularity), iDebug(aDebug), iReleasedForRestore(EFalse) |
255 // |
255 // |
256 // |
256 // |
257 // |
257 // |
258 { |
258 { |
259 } |
259 } |
2013 #endif |
2013 #endif |
2014 // The media is not available - use default |
2014 // The media is not available - use default |
2015 iStartupState = EMsvMediaUnavailable; |
2015 iStartupState = EMsvMediaUnavailable; |
2016 drive = iSystemDrive; |
2016 drive = iSystemDrive; |
2017 } |
2017 } |
2018 else if (iNewContext->Config().iUniqueID != 0 && iNewContext->Config().iUniqueID != volume.iUniqueID) |
|
2019 { |
|
2020 #ifndef _NO_SERVER_LOGGING_ |
|
2021 Log(_L("The media is incorrect %d != %d - using default"), iNewContext->Config().iUniqueID, volume.iUniqueID); |
|
2022 #endif |
|
2023 // The media is incorrect - use default |
|
2024 iStartupState = EMsvMediaIncorrect; |
|
2025 drive = iSystemDrive; |
|
2026 } |
|
2027 iNewContext->CreateIndexL(drive, aSync); |
2018 iNewContext->CreateIndexL(drive, aSync); |
2028 return; |
2019 return; |
2029 } |
2020 } |
2030 else if (error == KErrInUse) |
2021 else if (error == KErrInUse) |
2031 { |
2022 { |
2275 { |
2266 { |
2276 __ASSERT_DEBUG(iContext->IndexAdapter(), PanicServer(EMsvNoIndex)); |
2267 __ASSERT_DEBUG(iContext->IndexAdapter(), PanicServer(EMsvNoIndex)); |
2277 #ifndef _NO_SERVER_LOGGING_ |
2268 #ifndef _NO_SERVER_LOGGING_ |
2278 Log(_L("Disk %d removed"), TInt(aDrive)); |
2269 Log(_L("Disk %d removed"), TInt(aDrive)); |
2279 #endif |
2270 #endif |
2280 |
2271 if(iContext->IndexAdapter()->ErrorState() != KMsvIndexRestore) |
2281 NotifyChanged(EMsvMediaUnavailable, KMsvNullIndexEntryId, TInt(aDrive)); |
2272 { |
|
2273 NotifyChanged(EMsvMediaUnavailable, KMsvNullIndexEntryId, TInt(aDrive)); |
|
2274 } |
|
2275 else |
|
2276 { |
|
2277 iReleasedForRestore = ETrue; |
|
2278 } |
2282 iContext->IndexAdapter()->SetErrorState(KMsvMediaUnavailable); |
2279 iContext->IndexAdapter()->SetErrorState(KMsvMediaUnavailable); |
2283 iContext->IndexAdapter()->DeleteDbAdapter(); |
2280 iContext->IndexAdapter()->DeleteDbAdapter(); |
2284 |
2281 |
2285 iStartupState = EMsvMediaUnavailable; |
2282 iStartupState = EMsvMediaUnavailable; |
2286 return ETrue; |
2283 return ETrue; |
2294 __ASSERT_DEBUG(iContext->IndexAdapter(), PanicServer(EMsvNoIndex)); |
2291 __ASSERT_DEBUG(iContext->IndexAdapter(), PanicServer(EMsvNoIndex)); |
2295 |
2292 |
2296 #ifndef _NO_SERVER_LOGGING_ |
2293 #ifndef _NO_SERVER_LOGGING_ |
2297 Log(_L("Disk %d inserted"), TInt(aDrive)); |
2294 Log(_L("Disk %d inserted"), TInt(aDrive)); |
2298 #endif |
2295 #endif |
2299 |
2296 if(!iReleasedForRestore) |
2300 NotifyChanged(EMsvMediaAvailable, KMsvNullIndexEntryId, TInt(aDrive)); |
2297 { |
|
2298 NotifyChanged(EMsvMediaAvailable, KMsvNullIndexEntryId, TInt(aDrive)); |
|
2299 } |
|
2300 else |
|
2301 { |
|
2302 iReleasedForRestore = EFalse; |
|
2303 } |
2301 |
2304 |
2302 iContext->IndexAdapter()->SetErrorState(KErrNone); |
2305 iContext->IndexAdapter()->SetErrorState(KErrNone); |
2303 |
2306 |
2304 //Need to re-open the DB when media is available (EMsvMediaAvailable). |
2307 //Need to re-open the DB when media is available (EMsvMediaAvailable). |
2305 //Get current drive |
2308 //Get current drive |
3562 TInt index = CheckMtmStatus(aOperation.ServiceId(), opRunning); |
3565 TInt index = CheckMtmStatus(aOperation.ServiceId(), opRunning); |
3563 |
3566 |
3564 // if an operation is already running, queue this one |
3567 // if an operation is already running, queue this one |
3565 if (opRunning) |
3568 if (opRunning) |
3566 { |
3569 { |
|
3570 aOperation.SetCapability(hasCapability); |
3567 QueueOperationL(aOperation, aSessionId); |
3571 QueueOperationL(aOperation, aSessionId); |
3568 return; |
3572 return; |
3569 } |
3573 } |
3570 |
3574 |
3571 // create the new mtm if required |
3575 // create the new mtm if required |
3740 delete iMtmOperationQueueArray.At(aQueueIndex); |
3744 delete iMtmOperationQueueArray.At(aQueueIndex); |
3741 iMtmOperationQueueArray.Delete(aQueueIndex); |
3745 iMtmOperationQueueArray.Delete(aQueueIndex); |
3742 return; |
3746 return; |
3743 } |
3747 } |
3744 } |
3748 } |
3745 aQueue->At(0)->Start(*aQueue->iMtm, EFalse); |
3749 |
|
3750 aQueue->At(0)->Start(*aQueue->iMtm, aQueue->At(0)->Capability()); |
3746 aQueue->At(0)->SetState(EMsvOperationRunning); |
3751 aQueue->At(0)->SetState(EMsvOperationRunning); |
3747 } |
3752 } |
3748 |
3753 |
3749 |
3754 |
3750 TInt CMsvServer::FillRegisteredMtmDllArray(TUid aMtmDllTypeUid,CRegisteredMtmDllArray& aRegisteredMtmDllArray) |
3755 TInt CMsvServer::FillRegisteredMtmDllArray(TUid aMtmDllTypeUid,CRegisteredMtmDllArray& aRegisteredMtmDllArray) |