474 } // for |
473 } // for |
475 |
474 |
476 // Check if component or part of it is in the media. |
475 // Check if component or part of it is in the media. |
477 if ( isInTargetDrive ) |
476 if ( isInTargetDrive ) |
478 { |
477 { |
479 FLOG( _L("Daemon: Set component status to SCR") ); |
|
480 // Update component flag to SCR. |
|
481 if ( aChangeType == EMediaInserted ) |
|
482 { |
|
483 FLOG( _L("Daemon: Set component present = TRUE") ); |
|
484 TRAP( err, aScrServer.SetIsComponentPresentL( aComponentId, ETrue ) ); |
|
485 } |
|
486 else if ( aChangeType==EMediaRemoved ) |
|
487 { |
|
488 FLOG( _L("Daemon: Set component present = FALSE") ); |
|
489 TRAP( err, aScrServer.SetIsComponentPresentL( aComponentId, EFalse ) ); |
|
490 } |
|
491 FLOG_1( _L("Daemon: SetIsComponentPresentL TRAP err = %d"), err ); |
|
492 |
|
493 // We need to update applications status to AppArc when |
478 // We need to update applications status to AppArc when |
494 // there is some media change. AppArc needs application |
479 // there is some media change. AppArc needs application |
495 // UID (not package UID) so we need to get all app. UIDs |
480 // UID (not package UID) so we need to get all app. UIDs |
496 // from the package and set them to present or not present. |
481 // from the package and set them to present or not present. |
497 |
482 |
498 FLOG( _L("Daemon: Create application status for AppArc") ); |
483 FLOG( _L("Daemon: Create application status for AppArc") ); |
499 FLOG( _L("Daemon: Get applications UIDs from SCR") ); |
484 FLOG( _L("Daemon: Get applications UIDs from SCR") ); |
500 RArray<TUid> appUidArray; |
485 RArray<TUid> appUidArray; |
501 CleanupClosePushL( appUidArray ); |
486 CleanupClosePushL( appUidArray ); |
502 |
487 |
503 TRAP( err, aScrServer.GetAppUidsForComponentL( aComponentId, appUidArray ) ); |
488 TRAP( err, aScrServer.GetAppUidsForComponentL( aComponentId, appUidArray ) ); |
504 FLOG_1( _L("Daemon: GetAppUidsForComponentL TRAP err = %d"), err ); |
489 FLOG_1( _L("Daemon: GetAppUidsForComponentL TRAP err = %d"), err ); |
505 FLOG_1( _L("Daemon: UID array count = %d"), appUidArray.Count() ); |
490 FLOG_1( _L("Daemon: UID array count = %d"), appUidArray.Count() ); |
506 |
491 |
507 for (TInt index = 0; index < appUidArray.Count(); index++) |
492 for (TInt index = 0; index < appUidArray.Count(); index++) |
508 { |
493 { |
509 FLOG_1( _L("Daemon: Add app UID = 0x%x"), |
494 FLOG_1( _L("Daemon: Add app UID = 0x%x"), |
510 appUidArray[index].iUid ); |
495 appUidArray[index].iUid ); |
511 |
496 |
512 TApaAppUpdateInfo appInfo; |
497 TApaAppUpdateInfo appInfo; |
513 appInfo.iAppUid = appUidArray[index]; |
498 appInfo.iAppUid = appUidArray[index]; |
514 |
499 |
515 if ( aChangeType == EMediaInserted ) |
500 if ( aChangeType == EMediaInserted ) |
516 { |
501 { |
523 FLOG( _L("Daemon: Set app = EAppNotPresent") ); |
508 FLOG( _L("Daemon: Set app = EAppNotPresent") ); |
524 } |
509 } |
525 |
510 |
526 aAppInfoArray.Append( appInfo ); |
511 aAppInfoArray.Append( appInfo ); |
527 } |
512 } |
528 CleanupStack::PopAndDestroy(&appUidArray); |
513 CleanupStack::PopAndDestroy(&appUidArray); |
|
514 // Set do not work, it will leave. |
|
515 /* |
|
516 FLOG( _L("Daemon: Set component status to SCR") ); |
|
517 // Update component flag to SCR. |
|
518 if ( aChangeType == EMediaInserted ) |
|
519 { |
|
520 FLOG( _L("Daemon: Set component present = TRUE") ); |
|
521 TRAP( err, aScrServer.SetIsComponentPresentL( aComponentId, ETrue ) ); |
|
522 } |
|
523 else if ( aChangeType==EMediaRemoved ) |
|
524 { |
|
525 FLOG( _L("Daemon: Set component present = FALSE") ); |
|
526 TRAP( err, aScrServer.SetIsComponentPresentL( aComponentId, EFalse ) ); |
|
527 } |
|
528 FLOG_1( _L("Daemon: SetIsComponentPresentL TRAP err = %d"), err ); |
|
529 */ |
529 } // if isInTargetDrive |
530 } // if isInTargetDrive |
530 } // if err |
531 } // if err |
531 |
532 |
532 CleanupStack::PopAndDestroy( entry ); |
533 CleanupStack::PopAndDestroy( entry ); |
533 entry = NULL; |
534 entry = NULL; |