mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderenumerator.cpp
changeset 25 d881023c13eb
parent 0 a2952bb97e68
child 27 cbb1bfb7ebfb
equal deleted inserted replaced
21:a05c44bc3c61 25:d881023c13eb
    32 #include "mmmtpdputility.h"
    32 #include "mmmtpdputility.h"
    33 #include "cmmmtpdpmetadataaccesswrapper.h"
    33 #include "cmmmtpdpmetadataaccesswrapper.h"
    34 #include "cmmmtpdpmetadatampxaccess.h"
    34 #include "cmmmtpdpmetadatampxaccess.h"
    35 
    35 
    36 
    36 
    37 /** Number of objects to insert into the object manager in one go*/
       
    38 const TInt KMTPDriveGranularity = 5;
    37 const TInt KMTPDriveGranularity = 5;
       
    38 const TInt KAbstractMediaDpArrayGranularity = 2;
    39 
    39 
    40 _LIT( KPlaylistFilePath, "Playlists\\" );
    40 _LIT( KPlaylistFilePath, "Playlists\\" );
       
    41 
       
    42 #if defined(_DEBUG) || defined(MMMTPDP_PERFLOG)
       
    43 _LIT( KMpxGetAllAbstractMedia, "MpxGetAllAbstractMedia" );
       
    44 _LIT( KMpxQueryAbstractMediaReference, "MpxQueryAbstractMediaReference" );
       
    45 _LIT( KObjectManagerObjectUid, "ObjectManagerObjectUid" );
       
    46 _LIT( KObjectManagerInsert, "ObjectManagerInsert" );
       
    47 _LIT( KObjectManagerHandle, "ObjectManagerHandle" );
       
    48 _LIT( KReferenceManagerSetReference, "ReferenceManagerSetReference" );
       
    49 #endif
    41 
    50 
    42 // -----------------------------------------------------------------------------
    51 // -----------------------------------------------------------------------------
    43 // CAbstractMediaMtpDataProviderEnumerator::NewL
    52 // CAbstractMediaMtpDataProviderEnumerator::NewL
    44 // Two phase constructor
    53 // Two phase constructor
    45 // -----------------------------------------------------------------------------
    54 // -----------------------------------------------------------------------------
    67     CActive( EPriorityLow ),
    76     CActive( EPriorityLow ),
    68     iFramework( aFramework ),
    77     iFramework( aFramework ),
    69     iObjectMgr( aFramework.ObjectMgr() ),
    78     iObjectMgr( aFramework.ObjectMgr() ),
    70     iDataProviderId( aFramework.DataProviderId() ),
    79     iDataProviderId( aFramework.DataProviderId() ),
    71     iDataProvider( aDataProvider ),
    80     iDataProvider( aDataProvider ),
    72     iStorages( 2 ),
    81     iStorages( KAbstractMediaDpArrayGranularity ),
    73     iAbstractMedias( NULL ),
    82     iAbstractMedias( NULL ),
    74     iCount( 0 ),
    83     iCount( 0 ),
    75     iCurrentIndex( 0 )
    84     iCurrentIndex( 0 ),
       
    85     iEnumState ( EEnumPlaylist )
    76     {
    86     {
    77     PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::CAbstractMediaMtpDataProviderEnumerator, iDataProviderId = %d" ), iDataProviderId );
    87     PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::CAbstractMediaMtpDataProviderEnumerator, iDataProviderId = %d" ), iDataProviderId );
    78     }
    88     }
    79 
    89 
    80 // -----------------------------------------------------------------------------
    90 // -----------------------------------------------------------------------------
   103     Cancel();
   113     Cancel();
   104     iStorages.Close();
   114     iStorages.Close();
   105 
   115 
   106     delete iAbstractMedias;
   116     delete iAbstractMedias;
   107     iAbstractMedias = NULL;
   117     iAbstractMedias = NULL;
       
   118 
   108 #if defined(_DEBUG) || defined(MMMTPDP_PERFLOG)
   119 #if defined(_DEBUG) || defined(MMMTPDP_PERFLOG)
   109     delete iPerfLog;
   120     delete iPerfLog;
   110 #endif // _DEBUG
   121 #endif // _DEBUG
   111     PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::~CAbstractMediaMtpDataProviderEnumerator" ) );
   122     PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::~CAbstractMediaMtpDataProviderEnumerator" ) );
   112     }
   123     }
   168             }
   179             }
   169         }
   180         }
   170 
   181 
   171     // keep in mind for notification when enumeration complete
   182     // keep in mind for notification when enumeration complete
   172     iStorageId = aStorageId;
   183     iStorageId = aStorageId;
   173 
   184     iEnumState = EEnumPlaylist;
   174     if ( iStorages.Count() > 0 )
   185     if ( iStorages.Count() > 0 )
   175         {
   186         {
   176         ScanStorageL( iStorages[0] );
   187         InitStorageL();
   177         }
   188         }
   178     else
   189     ScanNextL();
   179         {
       
   180         iStorages.Reset();
       
   181         SignalCompleteL( iDataProvider );
       
   182         }
       
   183 
   190 
   184     PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::StartL" ) );
   191     PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::StartL" ) );
   185     }
   192     }
   186 
   193 
   187 // -----------------------------------------------------------------------------
   194 // -----------------------------------------------------------------------------
   188 // CAbstractMediaMtpDataProviderEnumerator::ScanStorageL
   195 // CAbstractMediaMtpDataProviderEnumerator::InitStorageL
   189 // Find out all AbstractMedia file according to storage id
   196 // Initialize iAbstractMedia, iCount and iCurrentIndex according to iStorages and iEnumState
   190 // -----------------------------------------------------------------------------
   197 // -----------------------------------------------------------------------------
   191 //
   198 //
   192 void CAbstractMediaMtpDataProviderEnumerator::ScanStorageL( TUint32 aStorageId )
   199 void CAbstractMediaMtpDataProviderEnumerator::InitStorageL()
   193     {
   200     {
   194     PRINT1( _L( "MM MTP => CAbstractMediaMtpDataProviderEnumerator::ScanStorageL aStorageId = 0x%x" ), aStorageId );
   201     __ASSERT_DEBUG(iStorages.Count() > 0 && iEnumState < EEnumCount, User::Invariant() );
       
   202     PRINT2( _L( "MM MTP => CAbstractMediaMtpDataProviderEnumerator::InitStorageL storageId = 0x%x, state=%d" ), iStorages[0], iEnumState );
   195     const CMTPStorageMetaData& storage(
   203     const CMTPStorageMetaData& storage(
   196         iFramework.StorageMgr().StorageL( aStorageId ) );
   204         iFramework.StorageMgr().StorageL( iStorages[0] ) );
   197 
   205 
   198     __ASSERT_DEBUG( ( storage.Uint( CMTPStorageMetaData::EStorageSystemType ) ==
   206     __ASSERT_DEBUG( ( storage.Uint( CMTPStorageMetaData::EStorageSystemType ) ==
   199         CMTPStorageMetaData::ESystemTypeDefaultFileSystem ), User::Invariant() );
   207         CMTPStorageMetaData::ESystemTypeDefaultFileSystem ), User::Invariant() );
   200 
   208 
   201     TFileName root( storage.DesC( CMTPStorageMetaData::EStorageSuid ) );
   209     TFileName root( storage.DesC( CMTPStorageMetaData::EStorageSuid ) );
   202     PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::ScanStorageL StorageSuid = %S" ), &root );
   210     PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::InitStorageL StorageSuid = %S" ), &root );
   203 
   211 
   204     // created by windows media player, or else return responsecode is Access denied
   212     if ( iEnumState == EEnumPlaylist )
   205     // Create abstract media directory if it does not exist
   213         {
   206     HBufC* tempBuf = HBufC::NewLC( KMaxFileName );  // + tempBuf
   214         // created by windows media player, or else return responsecode is Access denied
   207     TPtr folder = tempBuf->Des();
   215         // Create playlist directory if it does not exist
   208     folder.Zero();
   216         // NOTE: Only playlist need to create directory here, for the dummy files
   209     folder.Append( root );
   217         HBufC* tempBuf = HBufC::NewLC( KMaxFileName );  // + tempBuf
   210     folder.Append( KPlaylistFilePath );
   218         TPtr folder = tempBuf->Des();
   211     TBool ret = BaflUtils::FileExists( iFramework.Fs(), folder );
   219         folder.Zero();
   212     PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::ScanStorageL ret = %d, folder = %S" ), ret, &folder );
   220         folder.Append( root );
   213     if( !ret )
   221         folder.Append( KPlaylistFilePath );
   214         {
   222         TBool ret = BaflUtils::FileExists( iFramework.Fs(), folder );
   215         TInt err = iFramework.Fs().MkDirAll( folder );
   223         PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::InitStorageL ret = %d, folder = %S" ), ret, &folder );
   216         PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::ScanStorageL Creating folder (%S) returned error %d" ), tempBuf, err );
   224         if( !ret )
   217 
   225             {
   218         // add this new folder to framework metadata DB
   226             TInt err = iFramework.Fs().MkDirAll( folder );
   219         CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC( 0, // Dev Dp hard code
   227             PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::InitStorageL Creating folder (%S) returned error %d" ), tempBuf, err );
   220                 EMTPFormatCodeAssociation,
   228 
   221                 aStorageId,
   229             // add this new folder to framework metadata DB
   222                 folder );  // + object
   230             CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC( 0, // Dev Dp hard code
   223         object->SetUint( CMTPObjectMetaData::EParentHandle, KMTPHandleNoParent );
   231                     EMTPFormatCodeAssociation,
   224         object->SetUint( CMTPObjectMetaData::EFormatSubCode, EMTPAssociationTypeGenericFolder );
   232                     iStorages[0],
   225         PERFLOGSTART( KObjectManagerInsert );
   233                     folder );  // + object
   226         iObjectMgr.InsertObjectL( *object );
   234             object->SetUint( CMTPObjectMetaData::EParentHandle, KMTPHandleNoParent );
   227         PERFLOGSTOP( KObjectManagerInsert );
   235             object->SetUint( CMTPObjectMetaData::EFormatSubCode, EMTPAssociationTypeGenericFolder );
   228         CleanupStack::PopAndDestroy( object ); // - object
   236             PERFLOGSTART( KObjectManagerInsert );
   229         }
   237             iObjectMgr.InsertObjectL( *object );
   230     CleanupStack::PopAndDestroy( tempBuf ); // - tempBuf
   238             PERFLOGSTOP( KObjectManagerInsert );
       
   239             CleanupStack::PopAndDestroy( object ); // - object
       
   240             }
       
   241         CleanupStack::PopAndDestroy( tempBuf ); // - tempBuf
       
   242         }
   231 
   243 
   232     // find all abstract medias stored in MPX
   244     // find all abstract medias stored in MPX
   233     delete iAbstractMedias;
   245     delete iAbstractMedias;
   234     iAbstractMedias = NULL;
   246     iAbstractMedias = NULL;
   235     PERFLOGSTART( KMpxGetAllPlaylist );
   247     TMPXGeneralCategory category = ( iEnumState == EEnumPlaylist ) ? EMPXPlaylist : EMPXAbstractAlbum;
   236     TRAPD( err, iDataProvider.GetWrapperL().GetAllPlaylistL( root, &iAbstractMedias ) );
   248     PERFLOGSTART( KMpxGetAllAbstractMedia );
   237     PERFLOGSTOP( KMpxGetAllPlaylist );
   249     TRAPD( err, iDataProvider.GetWrapperL().GetAllAbstractMediaL( root, &iAbstractMedias, category  ) );
       
   250     PERFLOGSTOP( KMpxGetAllAbstractMedia );
   238 
   251 
   239     if ( iAbstractMedias != NULL && err == KErrNone )
   252     if ( iAbstractMedias != NULL && err == KErrNone )
   240         {
   253         {
   241         iCount = iAbstractMedias->Count();
   254         iCount = iAbstractMedias->Count();
   242         iCurrentIndex = 0;
       
   243 
       
   244         TRequestStatus* status = &iStatus;
       
   245         User::RequestComplete( status, iStatus.Int() );
       
   246         SetActive();
       
   247         }
   255         }
   248     else
   256     else
   249         {
   257         {
   250         iCount = 0;
   258         iCount = 0;
   251         iCurrentIndex = 0;
   259         }
   252         ScanNextL();
   260     iCurrentIndex = 0;
   253         }
   261 
   254 
   262     PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::InitStorageL" ) );
   255     PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::ScanStorageL" ) );
   263     }
   256     }
   264 
   257 
   265 // -----------------------------------------------------------------------------
   258 // -----------------------------------------------------------------------------
   266 // CAbstractMediaMtpDataProviderEnumerator::ScanNextL
   259 // CAbstractMediaMtpDataProviderEnumerator::ScanNextStorageL
   267 // Proceed to next abstract media item
   260 //
       
   261 // -----------------------------------------------------------------------------
   268 // -----------------------------------------------------------------------------
   262 //
   269 //
   263 void CAbstractMediaMtpDataProviderEnumerator::ScanNextL()
   270 void CAbstractMediaMtpDataProviderEnumerator::ScanNextL()
   264     {
   271     {
   265     PRINT1( _L( "MM MTP = > CAbstractMediaMtpDataProviderEnumerator::ScanNextStorageL iStorages.Count = %d" ), iStorages.Count() );
   272     while (iStorages.Count() > 0)
   266     if ( iCurrentIndex < iCount )
   273         {
   267         {
   274         while ( iEnumState < EEnumCount )
   268         TRequestStatus* status = &iStatus;
   275             {
   269         User::RequestComplete( status, iStatus.Int() );
   276             if ( iCurrentIndex < iCount )
   270         SetActive();
   277                 {
   271 
   278                 TRequestStatus* status = &iStatus;
   272         PRINT2( _L( "MM MTP <> Current storage is still being scanned, current index = %d, total AbstractMedia count = %d" ),
   279                 User::RequestComplete( status, iStatus.Int() );
   273             iCurrentIndex,
   280                 SetActive();
   274             iCount );
   281                 PRINT2( _L( "MM MTP <> Current storage is still being scanned, current index = %d, total AbstractMedia count = %d" ),
   275         }
   282                     iCurrentIndex,
   276     // If there are one or more unscanned storages left
   283                     iCount );
   277     // (the currently scanned one is still on the list)
   284                 return;
   278     else if ( iStorages.Count() > 1 )
   285                 }
   279         {
   286             ++iEnumState;
       
   287             if (iEnumState == EEnumCount)
       
   288                 {
       
   289                 break;
       
   290                 }
       
   291             InitStorageL();
       
   292             }
   280         iStorages.Remove( 0 );
   293         iStorages.Remove( 0 );
   281         ScanStorageL( iStorages[0] );
   294         if (iStorages.Count() == 0)
   282         }
   295             {
   283     else
   296             break;
   284         {
   297             }
   285         // We are done
   298         iEnumState = EEnumPlaylist;
   286         PRINT( _L( "MM MTP <> Objects enumeration completed 2" ) );
   299         InitStorageL();
   287         iStorages.Reset();
   300         }
   288         SignalCompleteL( iDataProvider );
   301     // We are done
   289         }
   302     PRINT( _L( "MM MTP <> Objects enumeration completed" ) );
       
   303     delete iAbstractMedias;
       
   304     iAbstractMedias = NULL;
       
   305     iStorages.Reset();
       
   306     SignalCompleteL( iDataProvider );
   290     }
   307     }
   291 
   308 
   292 // -----------------------------------------------------------------------------
   309 // -----------------------------------------------------------------------------
   293 // CAbstractMediaMtpDataProviderEnumerator::RunL
   310 // CAbstractMediaMtpDataProviderEnumerator::RunL
   294 // NOTE: preserve for performance improvement
   311 // NOTE: preserve for performance improvement
   295 // -----------------------------------------------------------------------------
   312 // -----------------------------------------------------------------------------
   296 //
   313 //
   297 void CAbstractMediaMtpDataProviderEnumerator::RunL()
   314 void CAbstractMediaMtpDataProviderEnumerator::RunL()
   298     {
   315     {
   299     TBuf<KMaxFileName> playlist;
   316     PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderEnumerator::RunL" ) );
   300 
   317 
   301     // insert all playlists into handle db of framework
   318     // insert all abstract medias into handle db of framework
   302     CMPXMedia* media = ( *iAbstractMedias )[iCurrentIndex];
   319     CMPXMedia* media = ( *iAbstractMedias )[iCurrentIndex];
   303     PERFLOGSTART( KMpxGetPlaylistName );
   320     
   304     iDataProvider.GetWrapperL().GetPlaylistNameL( media, playlist );
   321     // Increase the index first in case of leave
   305     PERFLOGSTOP( KMpxGetPlaylistName );
       
   306     AddEntryL( playlist );
       
   307 
       
   308     // find all reference of each playlist and create dummy files for each playlist
       
   309     CDesCArray* references = new ( ELeave ) CDesCArrayFlat( KMTPDriveGranularity );
       
   310     CleanupStack::PushL( references ); // + references
       
   311 
       
   312     PERFLOGSTART( KMpxQueryPlaylistReference );
       
   313     iDataProvider.GetWrapperL().GetAllReferenceL( media, *references );
       
   314     PERFLOGSTOP( KMpxQueryPlaylistReference );
       
   315 
       
   316     // insert references into reference db
       
   317     AddReferencesL( playlist, *references );
       
   318 
       
   319     CleanupStack::PopAndDestroy( references ); // - references
       
   320     iCurrentIndex++;
   322     iCurrentIndex++;
       
   323     TMPXGeneralCategory category = ( iEnumState == EEnumPlaylist ) ? EMPXPlaylist : EMPXAbstractAlbum;
       
   324     HBufC* abstractMedia = iDataProvider.GetWrapperL().GetAbstractMediaNameL( media, category );
       
   325     CleanupStack::PushL( abstractMedia ); // + abstractMedia
       
   326     TBool ret = ETrue;
       
   327     if ( iEnumState == EEnumAbstractAlbum )
       
   328         {
       
   329         //The abstract album may be removed, check it first
       
   330         ret = BaflUtils::FileExists( iFramework.Fs(), *abstractMedia );
       
   331         PRINT2( _L( "MM MTP <> BaflUtils::FileExists( RFs,%S ) ret = %d" ), abstractMedia, ret );
       
   332         }
       
   333 
       
   334     if ( ret )
       
   335         {
       
   336         PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::RunL abstractMedia=%S" ), abstractMedia );
       
   337         AddEntryL( *abstractMedia );
       
   338 
       
   339         // find all reference of each abstract media
       
   340         CDesCArray* references = new ( ELeave ) CDesCArrayFlat( KMTPDriveGranularity );
       
   341         CleanupStack::PushL( references ); // + references
       
   342     
       
   343         PERFLOGSTART( KMpxQueryAbstractMediaReference );
       
   344         iDataProvider.GetWrapperL().GetAllReferenceL( media, *references );
       
   345         PERFLOGSTOP( KMpxQueryAbstractMediaReference );
       
   346     
       
   347         // insert references into reference db
       
   348         AddReferencesL( *abstractMedia, *references );
       
   349     
       
   350         CleanupStack::PopAndDestroy( references ); // - references
       
   351         }     
       
   352     CleanupStack::PopAndDestroy( abstractMedia ); // - abstractMedia
   321 
   353 
   322     ScanNextL();
   354     ScanNextL();
   323     }
   355     }
   324 
   356 
   325 // -----------------------------------------------------------------------------
   357 // -----------------------------------------------------------------------------
   341 // NOTE: preserve for performance improvement
   373 // NOTE: preserve for performance improvement
   342 // -----------------------------------------------------------------------------
   374 // -----------------------------------------------------------------------------
   343 //
   375 //
   344 void CAbstractMediaMtpDataProviderEnumerator::DoCancel()
   376 void CAbstractMediaMtpDataProviderEnumerator::DoCancel()
   345     {
   377     {
   346 
   378     // Do nothing
   347     }
   379     }
   348 
   380 
   349 // -----------------------------------------------------------------------------
   381 // -----------------------------------------------------------------------------
   350 // CAbstractMediaMtpDataProviderEnumerator::SignalCompleteL
   382 // CAbstractMediaMtpDataProviderEnumerator::SignalCompleteL
   351 // Called when the enumeration is completed
   383 // Called when the enumeration is completed
   376 
   408 
   377     TParsePtrC parser( aSuid );
   409     TParsePtrC parser( aSuid );
   378     PERFLOGSTART( KObjectManagerObjectUid );
   410     PERFLOGSTART( KObjectManagerObjectUid );
   379     TUint32 parentHandle = iFramework.ObjectMgr().HandleL( parser.DriveAndPath() );
   411     TUint32 parentHandle = iFramework.ObjectMgr().HandleL( parser.DriveAndPath() );
   380     PERFLOGSTOP( KObjectManagerObjectUid );
   412     PERFLOGSTOP( KObjectManagerObjectUid );
       
   413 
   381     object->SetUint( CMTPObjectMetaData::EParentHandle, parentHandle );
   414     object->SetUint( CMTPObjectMetaData::EParentHandle, parentHandle );
   382 
   415 
   383     PERFLOGSTART(KObjectManagerInsert);
   416     PERFLOGSTART( KObjectManagerInsert );
   384     iObjectMgr.InsertObjectL( *object );
   417     iObjectMgr.InsertObjectL( *object );
   385     PERFLOGSTOP(KObjectManagerInsert);
   418     PERFLOGSTOP( KObjectManagerInsert );
   386 
   419 
   387     CleanupStack::PopAndDestroy( object );// - object
   420     CleanupStack::PopAndDestroy( object );// - object
   388 
   421 
   389     iDataProvider.GetWrapperL().CreateDummyFile( aSuid );
   422     //Only remember the playlist file for clean up
   390 
   423     if( iEnumState == EEnumPlaylist )
   391     // remember the abstract media file for clean up
   424         {
   392     iDataProvider.GetWrapperL().AddDummyFileL( aSuid );
   425         iDataProvider.GetWrapperL().CreateDummyFile( aSuid );
       
   426 
       
   427         // remember the abstract media file for clean up
       
   428         iDataProvider.GetWrapperL().AddDummyFileL( aSuid );
       
   429         }
   393 
   430 
   394     PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::AddEntryL" ) );
   431     PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::AddEntryL" ) );
   395     }
   432     }
   396 
   433 
   397 // -----------------------------------------------------------------------------
   434 // -----------------------------------------------------------------------------
   411 
   448 
   412     TInt removeCount = 0;
   449     TInt removeCount = 0;
   413     for ( TInt i = 0; i < count; i++ )
   450     for ( TInt i = 0; i < count; i++ )
   414         {
   451         {
   415         TInt index = i - removeCount;
   452         TInt index = i - removeCount;
   416         PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::AddReferencesL ref[%d]'s name = %S" ), index, &( aReferences[index] ) );
   453         TPtrC temp( aReferences[index] );
       
   454         PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::AddReferencesL ref[%d]'s name = %S" ), index, &temp );
   417         PERFLOGSTART( KObjectManagerHandle );
   455         PERFLOGSTART( KObjectManagerHandle );
   418         TUint32 handle = iFramework.ObjectMgr().HandleL( aReferences[index] );
   456         TUint32 handle = iFramework.ObjectMgr().HandleL( temp );
   419         PERFLOGSTOP( KObjectManagerHandle );
   457         PERFLOGSTOP( KObjectManagerHandle );
   420         if ( handle == KMTPHandleNone ) // object doesn't exist
   458         if ( handle == KMTPHandleNone ) // object doesn't exist
   421             {
   459             {
   422             TPtrC temp( aReferences[index] );
       
   423             PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::AddReferencesL, [%S] doesn't existed in handle db, remove this from reference array" ), &temp );
   460             PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::AddReferencesL, [%S] doesn't existed in handle db, remove this from reference array" ), &temp );
   424 
   461 
   425             // if handle is invalid, remove from reference array
   462             // if handle is invalid, remove from reference array
   426             aReferences.Delete( index, 1 );
   463             aReferences.Delete( index, 1 );
   427             removeCount++;
   464             removeCount++;