menucontentsrv/srvsrc/mcsdrmhandler.cpp
branchRCL_3
changeset 122 6cadd6867c17
parent 118 8baec10861af
child 130 67f2ed48ad91
equal deleted inserted replaced
118:8baec10861af 122:6cadd6867c17
    85 // -----------------------------------------------------------------------------
    85 // -----------------------------------------------------------------------------
    86 //
    86 //
    87 void CMcsDrmHandler::ConstructL()
    87 void CMcsDrmHandler::ConstructL()
    88     {
    88     {
    89     iScanner = CMcsDrmScanner::NewL( *this, iSrvEng, iUtils );
    89     iScanner = CMcsDrmScanner::NewL( *this, iSrvEng, iUtils );
    90 	iInstallNotifier = CMcsInstallNotifier::NewL(
    90   iInstallNotifier = CMcsInstallNotifier::NewL(
    91 	        *this, CMcsInstallNotifier::EJavaInstallNotification );
    91           *this, CMcsInstallNotifier::EJavaInstallNotification );
    92 
    92 
    93     }
    93     }
    94 
    94 
    95 // -----------------------------------------------------------------------------
    95 // -----------------------------------------------------------------------------
    96 // -----------------------------------------------------------------------------
    96 // -----------------------------------------------------------------------------
   126 // -----------------------------------------------------------------------------
   126 // -----------------------------------------------------------------------------
   127 //
   127 //
   128 void CMcsDrmHandler::HandleDrmEvent( TUid aUid )
   128 void CMcsDrmHandler::HandleDrmEvent( TUid aUid )
   129     {
   129     {
   130     TRAP_IGNORE(
   130     TRAP_IGNORE(
   131     		iSrvEng.Engine().AppendNotifyL( AppFolderIdL( aUid ),
   131         iSrvEng.Engine().AppendNotifyL( AppFolderIdL( aUid ),
   132     				RMenuNotifier::EItemAttributeChanged );
   132             RMenuNotifier::EItemAttributeChanged );
   133     		iScanner->RemoveObserverAndScanL( aUid );
   133         iScanner->RemoveObserverAndScanL( aUid );
   134 				);
   134         );
   135     }
   135     }
   136 
   136 
   137 // -----------------------------------------------------------------------------
   137 // -----------------------------------------------------------------------------
   138 // -----------------------------------------------------------------------------
   138 // -----------------------------------------------------------------------------
   139 //
   139 //
   145 
   145 
   146 // -----------------------------------------------------------------------------
   146 // -----------------------------------------------------------------------------
   147 // -----------------------------------------------------------------------------
   147 // -----------------------------------------------------------------------------
   148 //
   148 //
   149 void CMcsDrmHandler::AddRemoveObserversL(
   149 void CMcsDrmHandler::AddRemoveObserversL(
   150 	const RArray<TUid>& aDrmProtectedArray )
   150         const RArray<TUid>& aDrmProtectedArray )
   151     {
   151     {
   152     iObserversManager.RemoveMissingObservers( aDrmProtectedArray );
   152     iObserversManager.RemoveMissingObservers( aDrmProtectedArray );
   153     iObserversManager.CreateObserversL( aDrmProtectedArray, *this );
   153     iObserversManager.CreateObserversL( aDrmProtectedArray, *this );
   154     }
   154     }
   155 
   155 
   167 // ---------------------------------------------------------
   167 // ---------------------------------------------------------
   168 //
   168 //
   169 // ---------------------------------------------------------
   169 // ---------------------------------------------------------
   170 //
   170 //
   171 void CMcsDrmHandler::HandleInstallNotifyL( TUid aPackageUid,
   171 void CMcsDrmHandler::HandleInstallNotifyL( TUid aPackageUid,
   172 		CMcsInstallNotifier::TNotificationType aNotificationType )
   172     CMcsInstallNotifier::TNotificationType /*aNotificationType*/ )
   173 	{
   173     {
   174     if( aPackageUid != TUid::Null() )
   174     if( aPackageUid != TUid::Null() )
   175         {
   175         {
   176         if ( ( iScanner->DrmExpiredAppArray()).Find( aPackageUid )
   176         if( ( iScanner->DrmExpiredAppArray() ).Find( aPackageUid )
   177                 != KErrNotFound )
   177                 != KErrNotFound )
   178             {
   178             {
   179             HandleDrmEvent( aPackageUid );
   179             HandleDrmEvent( aPackageUid );
   180             }
   180             }
   181         else
   181         else
   182             {
   182             {
   183             iObserversManager.RefreshObserverL(
   183             iObserversManager.RefreshObserverL(
   184                     iScanner->DrmProtectedAppArray(), aPackageUid, *this );
   184                     iScanner->DrmProtectedAppArray(), aPackageUid, *this );
   185             }
   185             }
   186 		}
   186         }
   187 	else
   187     else
   188 	    {
   188         {
   189 	    for ( TInt i = 0; i< iScanner->DrmProtectedAppArray().Count(); i++ )
   189         for( TInt i = 0; i < iScanner->DrmProtectedAppArray().Count(); i++ )
   190 	        {
   190             {
   191             iObserversManager.RefreshObserverL(
   191             iObserversManager.RefreshObserverL(
   192                     iScanner->DrmProtectedAppArray(),
   192                     iScanner->DrmProtectedAppArray(),
   193                     iScanner->DrmProtectedAppArray()[i],
   193                     iScanner->DrmProtectedAppArray()[i], *this );
   194                     *this );
   194             }
   195 	        }
   195         for( TInt i = 0; i < iScanner->DrmExpiredAppArray().Count(); i++ )
   196 	    for ( TInt i = 0; i< iScanner->DrmExpiredAppArray().Count(); i++ )
   196             {
   197 	        {
   197             HandleDrmEvent( iScanner->DrmExpiredAppArray()[i] );
   198 	        HandleDrmEvent( iScanner->DrmExpiredAppArray()[i] );
   198             }
   199 	        }
   199         }
   200 	    }
       
   201     }
   200     }
   202 
   201 
   203 
   202 
   204 //  End of File
   203 //  End of File