42 static const TUint KOpaqueDataLength(64); |
42 static const TUint KOpaqueDataLength(64); |
43 |
43 |
44 /** |
44 /** |
45 CMTPDataProviderController panics |
45 CMTPDataProviderController panics |
46 */ |
46 */ |
47 _LIT(KMTPPanicCategory, "CMTPDataProviderController"); |
47 //_LIT(KMTPPanicCategory, "CMTPDataProviderController"); |
48 enum TMTPPanicReasons |
48 enum TMTPPanicReasons |
49 { |
49 { |
50 EMTPPanicStorageEnumeration = 0, |
50 EMTPPanicStorageEnumeration = 0, |
51 EMTPPanicFrameworkEnumeration = 1, |
51 EMTPPanicFrameworkEnumeration = 1, |
52 EMTPPanicDataProviderStorageEnumeration = 2, |
52 EMTPPanicDataProviderStorageEnumeration = 2, |
53 EMTPPanicDataProviderEnumeration = 3 |
53 EMTPPanicDataProviderEnumeration = 3 |
54 }; |
54 }; |
55 |
55 |
56 LOCAL_C void Panic(TInt aReason) |
56 //LOCAL_C void Panic(TInt aReason) |
57 { |
57 // { |
58 User::Panic(KMTPPanicCategory, aReason); |
58 // User::Panic(KMTPPanicCategory, aReason); |
59 } |
59 // } |
60 |
60 |
61 /** |
61 /** |
62 CMTPDataProviderController factory method. |
62 CMTPDataProviderController factory method. |
63 @return A pointer to a new CMTPDataProviderController instance. Ownership IS |
63 @return A pointer to a new CMTPDataProviderController instance. Ownership IS |
64 transfered. |
64 transfered. |
344 @param aIndex The data provider index. |
344 @param aIndex The data provider index. |
345 @return The data provider reference. |
345 @return The data provider reference. |
346 */ |
346 */ |
347 EXPORT_C CMTPDataProvider& CMTPDataProviderController::DataProviderByIndexL(TUint aIndex) |
347 EXPORT_C CMTPDataProvider& CMTPDataProviderController::DataProviderByIndexL(TUint aIndex) |
348 { |
348 { |
349 __ASSERT_DEBUG((aIndex < iDataProviders.Count()), User::Invariant()); |
349 if(aIndex >= iDataProviders.Count()) |
|
350 { |
|
351 User::Leave(KErrOverflow); |
|
352 } |
350 return *(iDataProviders[aIndex]); |
353 return *(iDataProviders[aIndex]); |
351 } |
354 } |
352 |
355 |
353 /** |
356 /** |
354 * Determine whether a data provider with the specified data provider id has been loaded |
357 * Determine whether a data provider with the specified data provider id has been loaded |
711 break; |
714 break; |
712 } |
715 } |
713 OstTraceFunctionExit0( CMTPDATAPROVIDERCONTROLLER_RUNL_EXIT ); |
716 OstTraceFunctionExit0( CMTPDATAPROVIDERCONTROLLER_RUNL_EXIT ); |
714 } |
717 } |
715 |
718 |
716 |
719 #ifdef OST_TRACE_COMPILER_IN_USE |
717 TInt CMTPDataProviderController::RunError(TInt aError) |
720 TInt CMTPDataProviderController::RunError(TInt aError) |
|
721 #else |
|
722 TInt CMTPDataProviderController::RunError(TInt /*aError*/) |
|
723 #endif |
718 { |
724 { |
719 OstTraceFunctionEntry0( CMTPDATAPROVIDERCONTROLLER_RUNERROR_ENTRY ); |
725 OstTraceFunctionEntry0( CMTPDATAPROVIDERCONTROLLER_RUNERROR_ENTRY ); |
720 OstTrace1(TRACE_NORMAL, CMTPDATAPROVIDERCONTROLLER_RUNERROR, "Error = %d", aError); |
726 OstTraceExt2(TRACE_NORMAL, CMTPDATAPROVIDERCONTROLLER_RUNERROR, "Error = %d, EnumerationState = %d", aError, iEnumerationState); |
721 |
727 |
722 // If a RunL error happens, there's no point in trying to continue. |
728 // If a RunL error happens, there's no point in trying to continue. |
723 switch (iEnumerationState) |
729 switch (iEnumerationState) |
724 { |
730 { |
725 case EEnumerationStarting: |
731 case EEnumerationStarting: |
|
732 // fall-through intended here |
726 case EEnumeratingFrameworkStorages: |
733 case EEnumeratingFrameworkStorages: |
727 Panic(EMTPPanicStorageEnumeration); |
734 // fall-through intended here |
728 break; |
|
729 |
|
730 case EEnumeratingFrameworkObjects: |
735 case EEnumeratingFrameworkObjects: |
731 Panic(EMTPPanicFrameworkEnumeration); |
736 // fall-through intended here |
732 break; |
|
733 |
|
734 case EEnumeratingDataProviderStorages: |
737 case EEnumeratingDataProviderStorages: |
735 Panic(EMTPPanicDataProviderStorageEnumeration); |
738 // fall-through intended here |
736 break; |
|
737 |
|
738 case EEnumeratingDataProviderObjects: |
739 case EEnumeratingDataProviderObjects: |
739 Panic(EMTPPanicDataProviderEnumeration); |
740 //handle the panic during the backup-resotre creation |
|
741 User::Exit( KErrNone ); |
740 break; |
742 break; |
741 |
743 |
742 case EUnenumerated: |
744 case EUnenumerated: |
743 case EEnumeratingPhaseOneDone: |
745 case EEnumeratingPhaseOneDone: |
744 default: |
746 default: |
1039 TBool success(EFalse); |
1041 TBool success(EFalse); |
1040 TBool supported(ETrue); |
1042 TBool supported(ETrue); |
1041 TUint aUid(0); |
1043 TUint aUid(0); |
1042 if ( Uid(aResourceFilename,aUid) != KErrNone ) |
1044 if ( Uid(aResourceFilename,aUid) != KErrNone ) |
1043 { |
1045 { |
|
1046 CleanupStack::PopAndDestroy(config); |
1044 OstTraceFunctionExit0( CMTPDATAPROVIDERCONTROLLER_LOADDATAPROVIDERL_EXIT ); |
1047 OstTraceFunctionExit0( CMTPDATAPROVIDERCONTROLLER_LOADDATAPROVIDERL_EXIT ); |
1045 return success; |
1048 return success; |
1046 } |
1049 } |
1047 TUint uid(aUid); |
1050 TUint uid(aUid); |
1048 if ((uid != KMTPImplementationUidDeviceDp) && (uid != KMTPImplementationUidProxyDp) && (uid != KMTPImplementationUidFileDp)) |
1051 if ((uid != KMTPImplementationUidDeviceDp) && (uid != KMTPImplementationUidProxyDp) && (uid != KMTPImplementationUidFileDp)) |