menucontentsrv/srvsrc/menusrvappscanner.cpp
branchRCL_3
changeset 122 6cadd6867c17
parent 118 8baec10861af
child 130 67f2ed48ad91
equal deleted inserted replaced
118:8baec10861af 122:6cadd6867c17
    95     if( iCenRepNotifyHandlerCPHiddenFolders )
    95     if( iCenRepNotifyHandlerCPHiddenFolders )
    96         {
    96         {
    97         iCenRepNotifyHandlerCPHiddenFolders->StopListening();
    97         iCenRepNotifyHandlerCPHiddenFolders->StopListening();
    98         }
    98         }
    99     delete iCenRepNotifyHandlerCPHiddenFolders;
    99     delete iCenRepNotifyHandlerCPHiddenFolders;
   100   	delete iCenRepSession;
   100     delete iCenRepSession;
   101   	delete iFreeSpaceObserver;
   101     delete iFreeSpaceObserver;
   102     iInstalledPackages.Close();
   102     iInstalledPackages.Close();
   103     }
   103     }
   104 
   104 
   105 // ---------------------------------------------------------
   105 // ---------------------------------------------------------
   106 // CMenuSrvAppScanner::CMenuSrvAppScanner
   106 // CMenuSrvAppScanner::CMenuSrvAppScanner
   124     User::LeaveIfError( iFs.Connect() );
   124     User::LeaveIfError( iFs.Connect() );
   125     TFileName path;
   125     TFileName path;
   126     User::LeaveIfError( iFs.PrivatePath( path ) );
   126     User::LeaveIfError( iFs.PrivatePath( path ) );
   127     TUint attribute;
   127     TUint attribute;
   128     if( iFs.Att( path, attribute) == KErrNotFound )
   128     if( iFs.Att( path, attribute) == KErrNotFound )
   129     	{
   129       {
   130         TInt mdRes = iFs.MkDirAll( path );
   130         TInt mdRes = iFs.MkDirAll( path );
   131         if ( mdRes != KErrNone )
   131         if ( mdRes != KErrNone )
   132         	{
   132           {
   133         	User::Leave( mdRes );
   133           User::Leave( mdRes );
   134         	}
   134           }
   135     	}
   135       }
   136 
   136 
   137     iMmcHistory = new (ELeave) CMenuSrvMmcHistory();
   137     iMmcHistory = new (ELeave) CMenuSrvMmcHistory();
   138     iMmcHistory->LoadL( iFs, KMenuMmcHistoryFname() );
   138     iMmcHistory->LoadL( iFs, KMenuMmcHistoryFname() );
   139     // The notifier has its own session to apparc, instead of taking
   139     // The notifier has its own session to apparc, instead of taking
   140     // it as argument... :(
   140     // it as argument... :(
   141     iNotifier = CApaAppListNotifier::NewL( this, CActive::EPriorityStandard );
   141     iNotifier = CApaAppListNotifier::NewL( this, CActive::EPriorityStandard );
   142 
   142 
   143    	iCenRepSession = CRepository::NewL( KCRUidMenu );
   143      iCenRepSession = CRepository::NewL( KCRUidMenu );
   144 
   144 
   145 	iCenRepNotifyHandlerHiddenApps = CCenRepNotifyHandler::NewL(
   145   iCenRepNotifyHandlerHiddenApps = CCenRepNotifyHandler::NewL(
   146 	    *this, *iCenRepSession,
   146       *this, *iCenRepSession,
   147 		CCenRepNotifyHandler::EStringKey, KMenuHideApplication );
   147     CCenRepNotifyHandler::EStringKey, KMenuHideApplication );
   148 	iCenRepNotifyHandlerCPHiddenApps = CCenRepNotifyHandler::NewL(
   148   iCenRepNotifyHandlerCPHiddenApps = CCenRepNotifyHandler::NewL(
   149 	    *this, *iCenRepSession,
   149       *this, *iCenRepSession,
   150 		CCenRepNotifyHandler::EStringKey, KMenuHideCPApplication );
   150     CCenRepNotifyHandler::EStringKey, KMenuHideCPApplication );
   151 
   151 
   152 	iCenRepNotifyHandlerCPHiddenFolders = CCenRepNotifyHandler::NewL(
   152   iCenRepNotifyHandlerCPHiddenFolders = CCenRepNotifyHandler::NewL(
   153 	    *this, *iCenRepSession,
   153       *this, *iCenRepSession,
   154 		CCenRepNotifyHandler::EStringKey, KMenuHideCPFolder );
   154     CCenRepNotifyHandler::EStringKey, KMenuHideCPFolder );
   155 
   155 
   156 	iCenRepNotifyHandlerHiddenApps->StartListeningL();
   156   iCenRepNotifyHandlerHiddenApps->StartListeningL();
   157 	iCenRepNotifyHandlerCPHiddenApps->StartListeningL();
   157   iCenRepNotifyHandlerCPHiddenApps->StartListeningL();
   158 	iCenRepNotifyHandlerCPHiddenFolders->StartListeningL();
   158   iCenRepNotifyHandlerCPHiddenFolders->StartListeningL();
   159 
   159 
   160 	iMcsSatNotifier = CMcsSatNotifier::NewL(
   160   iMcsSatNotifier = CMcsSatNotifier::NewL(
   161 	                this, KCRUidMenu, KMenuShowSatUI );
   161                   this, KCRUidMenu, KMenuShowSatUI );
   162 
   162 
   163 	iFreeSpaceObserver = CMcsFreeSpaceObserver::NewL( *this );
   163   iFreeSpaceObserver = CMcsFreeSpaceObserver::NewL( *this );
   164 
   164 
   165 	iSisInstallNotifier = CMcsInstallNotifier::NewL(
   165   iSisInstallNotifier = CMcsInstallNotifier::NewL(
   166             *this, CMcsInstallNotifier::ESisInstallNotification );
   166             *this, CMcsInstallNotifier::ESisInstallNotification );
   167 	iJavaInstallNotifier = CMcsInstallNotifier::NewL(
   167   iJavaInstallNotifier = CMcsInstallNotifier::NewL(
   168             *this, CMcsInstallNotifier::EJavaInstallNotification );
   168             *this, CMcsInstallNotifier::EJavaInstallNotification );
   169 
   169 
   170 	ScheduleScan();
   170   ScheduleScan();
   171     //iOpStatus = ETrue;
   171     //iOpStatus = ETrue;
   172     }
   172     }
   173 
   173 
   174 // ---------------------------------------------------------
   174 // ---------------------------------------------------------
   175 // CMenuSrvAppScanner::RunL
   175 // CMenuSrvAppScanner::RunL
   266     iEng.GetItemsL( appItems, aFolder, &uidAppFilter, ETrue );
   266     iEng.GetItemsL( appItems, aFolder, &uidAppFilter, ETrue );
   267 
   267 
   268     for( TInt i=0; i < appItems.Count(); i++ )
   268     for( TInt i=0; i < appItems.Count(); i++ )
   269         {
   269         {
   270         if( appItems[i].Type() != KMenuTypeLink() )
   270         if( appItems[i].Type() != KMenuTypeLink() )
   271         	{
   271           {
   272             const TMenuItem& item = appItems[i];
   272             const TMenuItem& item = appItems[i];
   273 
   273 
   274             TBool itemHidden = (0 != ( item.Flags() & TMenuItem::EHidden ) );
   274             TBool itemHidden = (0 != ( item.Flags() & TMenuItem::EHidden ) );
   275             TBool itemMissing = ( 0 != ( item.Flags() & TMenuItem::EMissing ) );
   275             TBool itemMissing = ( 0 != ( item.Flags() & TMenuItem::EMissing ) );
   276             if ( !itemHidden && !itemMissing )
   276             if ( !itemHidden && !itemMissing )
   277                 {
   277                 {
   278                 hideItem = ETrue;
   278                 hideItem = ETrue;
   279                 }
   279                 }
   280         	}
   280           }
   281         }
   281         }
   282     SetHiddenFlagL( aId, aWasHidden, hideItem );
   282     SetHiddenFlagL( aId, aWasHidden, hideItem );
   283 
   283 
   284     CleanupStack::PopAndDestroy( &appItems );
   284     CleanupStack::PopAndDestroy( &appItems );
   285     }
   285     }
   314     TBool exists = EFalse;
   314     TBool exists = EFalse;
   315     TBool itemMissing = EFalse;
   315     TBool itemMissing = EFalse;
   316     for (TInt i=0; i < appItems.Count(); i++)
   316     for (TInt i=0; i < appItems.Count(); i++)
   317         {
   317         {
   318         if(appItems[i].Id() != aId)
   318         if(appItems[i].Id() != aId)
   319         	{
   319           {
   320             exists = ETrue;
   320             exists = ETrue;
   321             const TMenuItem& item = appItems[i];
   321             const TMenuItem& item = appItems[i];
   322 
   322 
   323             TBool itemHidden = (0 != (item.Flags() & TMenuItem::EHidden));
   323             TBool itemHidden = (0 != (item.Flags() & TMenuItem::EHidden));
   324             itemMissing = (0 != (item.Flags() & TMenuItem::EMissing));
   324             itemMissing = (0 != (item.Flags() & TMenuItem::EMissing));
   325             if ( !itemHidden && !itemMissing )
   325             if ( !itemHidden && !itemMissing )
   326                 {
   326                 {
   327                 showItem = ETrue;
   327                 showItem = ETrue;
   328                 }
   328                 }
   329         	}
   329           }
   330         }
   330         }
   331 
   331 
   332     UpdateLinkL( aId, exists, showItem, itemMissing );
   332     UpdateLinkL( aId, exists, showItem, itemMissing );
   333 
   333 
   334     CleanupStack::PopAndDestroy( &appItems );
   334     CleanupStack::PopAndDestroy( &appItems );
   523 // ---------------------------------------------------------
   523 // ---------------------------------------------------------
   524 //
   524 //
   525 // ---------------------------------------------------------
   525 // ---------------------------------------------------------
   526 //
   526 //
   527 void CMenuSrvAppScanner::HandleInstallNotifyL( TUid aUid,
   527 void CMenuSrvAppScanner::HandleInstallNotifyL( TUid aUid,
   528 		CMcsInstallNotifier::TNotificationType aNotificationType )
   528     CMcsInstallNotifier::TNotificationType aNotificationType )
   529     {
   529     {
   530     iInstalledPackages.AppendL( aUid );
   530     iInstalledPackages.AppendL( aUid );
   531     // when installing java, appscanner first gets notification from appArc,
   531     // when installing java, appscanner first gets notification from appArc,
   532     // and then it is notified with instal notifier(RProperty)
   532     // and then it is notified with instal notifier(RProperty)
   533     // so we need another scan for java apps
   533     // so we need another scan for java apps
   534     if( aNotificationType == CMcsInstallNotifier::EJavaInstallNotification )
   534     if( aNotificationType == CMcsInstallNotifier::EJavaInstallNotification )
   535     	{
   535       {
   536 		ScheduleScan();
   536     ScheduleScan();
   537     	}
   537       }
   538     }
   538     }
   539 
   539 
   540 // ---------------------------------------------------------
   540 // ---------------------------------------------------------
   541 // CMenuSrvAppScanner::RunMenuEngOperationL
   541 // CMenuSrvAppScanner::RunMenuEngOperationL
   542 // ---------------------------------------------------------
   542 // ---------------------------------------------------------
   553 // ---------------------------------------------------------
   553 // ---------------------------------------------------------
   554 // CMenuSrvAppScanner::UpdateApplicationItemL
   554 // CMenuSrvAppScanner::UpdateApplicationItemL
   555 // ---------------------------------------------------------
   555 // ---------------------------------------------------------
   556 //
   556 //
   557 void CMenuSrvAppScanner::UpdateApplicationItemL(
   557 void CMenuSrvAppScanner::UpdateApplicationItemL(
   558 		RArray<TMenuItem>& aMcsItems, const CMenuSrvAppAttributes& aApaItem,
   558     RArray<TMenuItem>& aMcsItems, const CMenuSrvAppAttributes& aApaItem,
   559 		TUint aMmcId, TBool isLegacy)
   559     TUint aMmcId, TBool isLegacy)
   560     {
   560     {
   561     RArray<TMenuItem> mcsUidItems;
   561     RArray<TMenuItem> mcsUidItems;
   562     CleanupClosePushL( mcsUidItems );
   562     CleanupClosePushL( mcsUidItems );
   563     TUid appUid = aApaItem.GetUid();
   563     TUid appUid = aApaItem.GetUid();
   564     GetMcsAppItemsL( isLegacy, appUid.iUid, mcsUidItems );
   564     GetMcsAppItemsL( isLegacy, appUid.iUid, mcsUidItems );
   566 
   566 
   567     // This app is not in the menu, add it now.
   567     // This app is not in the menu, add it now.
   568     // We don't add hidden items, there are too many of them!
   568     // We don't add hidden items, there are too many of them!
   569     // do not display Menu app
   569     // do not display Menu app
   570     if ( !mcsUidItems.Count()
   570     if ( !mcsUidItems.Count()
   571     		&& !isApaItemHidden
   571         && !isApaItemHidden
   572     		&& appUid !=  KMmUid3  )
   572         && appUid !=  KMmUid3  )
   573         {
   573         {
   574         if( appUid == KSatUid )
   574         if( appUid == KSatUid )
   575             {
   575             {
   576             if( CMcsSatHandler::CheckVisibility() )
   576             if( CMcsSatHandler::CheckVisibility() )
   577              	{
   577                {
   578               	AddAppItemL( aApaItem, aMmcId );
   578                 AddAppItemL( aApaItem, aMmcId );
   579                	}
   579                  }
   580             }
   580             }
   581         else
   581         else
   582           	{
   582             {
   583           	AddAppItemL( aApaItem, aMmcId );
   583             AddAppItemL( aApaItem, aMmcId );
   584             GetMcsAppItemsL( isLegacy, appUid.iUid, mcsUidItems );
   584             GetMcsAppItemsL( isLegacy, appUid.iUid, mcsUidItems );
   585             RemoveFromInstalledPackages( appUid );
   585             RemoveFromInstalledPackages( appUid );
   586            	}
   586              }
   587         }//if
   587         }//if
   588 
   588 
   589     // if there are any items with legacy UID format
   589     // if there are any items with legacy UID format
   590     // update them to new uid format
   590     // update them to new uid format
   591     else if ( mcsUidItems.Count() && isLegacy )
   591     else if ( mcsUidItems.Count() && isLegacy )
   592         {
   592         {
   593         //for every item with matching UID
   593         //for every item with matching UID
   594         for (TInt j=0; j < mcsUidItems.Count(); j++)
   594         for (TInt j=0; j < mcsUidItems.Count(); j++)
   595      		{
   595          {
   596             TBuf<KUidChars> uidString;
   596             TBuf<KUidChars> uidString;
   597             MenuSrvUtil::UidToStringL( appUid.iUid, uidString, EFalse, EHex );
   597             MenuSrvUtil::UidToStringL( appUid.iUid, uidString, EFalse, EHex );
   598             ModifiableObjectL( appUid, mcsUidItems[j].Id() ).SetAttributeL(
   598             ModifiableObjectL( appUid, mcsUidItems[j].Id() ).SetAttributeL(
   599                     KMenuAttrUid(), uidString, EFalse );
   599                     KMenuAttrUid(), uidString, EFalse );
   600        		}//for
   600            }//for
   601         }//else if
   601         }//else if
   602     // "hidden", "missing" and "lock_delete"  flags update
   602     // "hidden", "missing" and "lock_delete"  flags update
   603     for ( TInt j = 0; j < mcsUidItems.Count(); j++ )
   603     for ( TInt j = 0; j < mcsUidItems.Count(); j++ )
   604         {
   604         {
   605         const TMenuItem& item = mcsUidItems[j];
   605         const TMenuItem& item = mcsUidItems[j];
   606 
   606 
   607         //we need to handle first run of appscanner,
   607         //we need to handle first run of appscanner,
   608         //there might be some incorrect data in content xml file
   608         //there might be some incorrect data in content xml file
   609         //if this will have impact on performance we may run this methods only at start up
   609         //if this will have impact on performance we may run this methods only at start up
   610        	HandleMmcAttrUpdateL( item, aApaItem, aMmcId );
   610          HandleMmcAttrUpdateL( item, aApaItem, aMmcId );
   611 		HandleNativeAttrUpdateL( item, aApaItem );
   611     HandleNativeAttrUpdateL( item, aApaItem );
   612 
   612 
   613         // "hidden" flag handling.
   613         // "hidden" flag handling.
   614         HandleHiddenFlagUpdateL( item, aApaItem );
   614         HandleHiddenFlagUpdateL( item, aApaItem );
   615 
   615 
   616         // "missing" flag handling
   616         // "missing" flag handling
   620         HandleLockDeleteFlagUpdateL( item, aApaItem );
   620         HandleLockDeleteFlagUpdateL( item, aApaItem );
   621         // if item was just added to MCS  it is not present in aMcsItems
   621         // if item was just added to MCS  it is not present in aMcsItems
   622         // so we cannot remove it
   622         // so we cannot remove it
   623         TInt index = aMcsItems.Find( item, TIdentityRelation<TMenuItem>( IdMatch ) );
   623         TInt index = aMcsItems.Find( item, TIdentityRelation<TMenuItem>( IdMatch ) );
   624         if ( index != KErrNotFound )
   624         if ( index != KErrNotFound )
   625         	{
   625           {
   626         	aMcsItems.Remove( index );
   626           aMcsItems.Remove( index );
   627         	}
   627           }
   628         }//for
   628         }//for
   629     CleanupStack::PopAndDestroy( &mcsUidItems );
   629     CleanupStack::PopAndDestroy( &mcsUidItems );
   630     }
   630     }
   631 
   631 
   632 // ---------------------------------------------------------
   632 // ---------------------------------------------------------
   633 // CMenuSrvAppScanner::HandleHiddenFlagUpdateL
   633 // CMenuSrvAppScanner::HandleHiddenFlagUpdateL
   634 // ---------------------------------------------------------
   634 // ---------------------------------------------------------
   635 //
   635 //
   636 void CMenuSrvAppScanner::HandleHiddenFlagUpdateL( const TMenuItem & aItem,
   636 void CMenuSrvAppScanner::HandleHiddenFlagUpdateL( const TMenuItem & aItem,
   637         const CMenuSrvAppAttributes& aApaItem )
   637         const CMenuSrvAppAttributes& aApaItem )
   638 	{
   638   {
   639 	TBool itemHidden = ( 0 != ( aItem.Flags() & TMenuItem::EHidden ) );
   639   TBool itemHidden = ( 0 != ( aItem.Flags() & TMenuItem::EHidden ) );
   640 	if( aApaItem.GetUid() == KSatUid )
   640   if( aApaItem.GetUid() == KSatUid )
   641 		{
   641     {
   642 		if( itemHidden == CMcsSatHandler::CheckVisibility() )
   642     if( itemHidden == CMcsSatHandler::CheckVisibility() )
   643 			{
   643       {
   644 			ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
   644       ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
   645 			        RMenuNotifier::EItemsAddedRemoved ).SetFlags(
   645               RMenuNotifier::EItemsAddedRemoved ).SetFlags(
   646 			                TMenuItem::EHidden,
   646                       TMenuItem::EHidden,
   647 			                !CMcsSatHandler::CheckVisibility() );
   647                       !CMcsSatHandler::CheckVisibility() );
   648 			}
   648       }
   649 		}
   649     }
   650 	else if( itemHidden != aApaItem.IsHidden() )
   650   else if( itemHidden != aApaItem.IsHidden() )
   651 		{
   651     {
   652 		ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
   652     ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
   653 		        RMenuNotifier::EItemsAddedRemoved ).SetFlags(
   653             RMenuNotifier::EItemsAddedRemoved ).SetFlags(
   654 		                TMenuItem::EHidden, aApaItem.IsHidden() );
   654                     TMenuItem::EHidden, aApaItem.IsHidden() );
   655 		}
   655     }
   656 	}
   656   }
   657 
   657 
   658 // ---------------------------------------------------------
   658 // ---------------------------------------------------------
   659 // CMenuSrvAppScanner::HandleNativeAttrUpdateL
   659 // CMenuSrvAppScanner::HandleNativeAttrUpdateL
   660 // ---------------------------------------------------------
   660 // ---------------------------------------------------------
   661 //
   661 //
   662 void CMenuSrvAppScanner::HandleNativeAttrUpdateL(
   662 void CMenuSrvAppScanner::HandleNativeAttrUpdateL(
   663 		const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem )
   663     const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem )
   664 	{
   664   {
   665     //we need this to delete uninstalled java app item
   665     //we need this to delete uninstalled java app item
   666     if( aApaItem.GetAppType() != iEng.ObjectL( aItem.Id() ).GetAppType() )
   666     if( aApaItem.GetAppType() != iEng.ObjectL( aItem.Id() ).GetAppType() )
   667     	{
   667       {
   668     	ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
   668       ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
   669     			RMenuNotifier::EItemsNone ).SetAppType( aApaItem.GetAppType() );
   669           RMenuNotifier::EItemsNone ).SetAppType( aApaItem.GetAppType() );
   670     	}
   670       }
   671 	}
   671   }
   672 
   672 
   673 
   673 
   674 // ---------------------------------------------------------
   674 // ---------------------------------------------------------
   675 // CMenuSrvAppScanner::HandleMmcAttrUpdateL
   675 // CMenuSrvAppScanner::HandleMmcAttrUpdateL
   676 // ---------------------------------------------------------
   676 // ---------------------------------------------------------
   677 //
   677 //
   678 void CMenuSrvAppScanner::HandleMmcAttrUpdateL(
   678 void CMenuSrvAppScanner::HandleMmcAttrUpdateL(
   679 		const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem, TUint aMmcId )
   679     const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem, TUint aMmcId )
   680 	{
   680   {
   681     TPtrC val;
   681     TPtrC val;
   682     TBool dummy;
   682     TBool dummy;
   683     TBool attributeExists = iEng.ObjectL( aItem.Id() ).FindAttribute(
   683     TBool attributeExists = iEng.ObjectL( aItem.Id() ).FindAttribute(
   684             KMenuAttrMmcId(), val, dummy );
   684             KMenuAttrMmcId(), val, dummy );
   685     if( IsInMmc( aApaItem ) )
   685     if( IsInMmc( aApaItem ) )
   686     	{
   686       {
   687     	//app is instaled on mmc - KMenuAttrMmcId attribute update
   687       //app is instaled on mmc - KMenuAttrMmcId attribute update
   688     	TBuf<KUidChars> uidString;
   688       TBuf<KUidChars> uidString;
   689         uidString.Format( KHexFormat, aMmcId );
   689         uidString.Format( KHexFormat, aMmcId );
   690         if( uidString.Compare( val ) )
   690         if( uidString.Compare( val ) )
   691             {
   691             {
   692             ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetAttributeL(
   692             ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetAttributeL(
   693                             KMenuAttrMmcId, uidString, EFalse );
   693                             KMenuAttrMmcId, uidString, EFalse );
   694             }
   694             }
   695     	}
   695       }
   696     else if( IsInMassStorage( aApaItem )
   696     else if( IsInMassStorage( aApaItem )
   697     		&& aApaItem.GetAppType() == CMenuEngObject::EWidgetApp )
   697         && aApaItem.GetAppType() == CMenuEngObject::EWidgetApp )
   698     	{
   698       {
   699     	//its java app installed on mass storage, we need to leave it in xml
   699       //its java app installed on mass storage, we need to leave it in xml
   700     	//in case of connecting usb in mass storage mode
   700       //in case of connecting usb in mass storage mode
   701         if( KMenuMassStorage().Compare( val ) )
   701         if( KMenuMassStorage().Compare( val ) )
   702             {
   702             {
   703             ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetAttributeL(
   703             ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetAttributeL(
   704                     KMenuAttrMmcId, KMenuMassStorage, EFalse );
   704                     KMenuAttrMmcId, KMenuMassStorage, EFalse );
   705             }
   705             }
   706     	}
   706       }
   707     else if( attributeExists )
   707     else if( attributeExists )
   708     	{
   708       {
   709     	//its installed on c: drive - remove attribute
   709       //its installed on c: drive - remove attribute
   710         ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).RemoveAttribute(
   710         ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).RemoveAttribute(
   711                 KMenuAttrMmcId );
   711                 KMenuAttrMmcId );
   712     	}
   712       }
   713 	}
   713   }
   714 // ---------------------------------------------------------
   714 // ---------------------------------------------------------
   715 // CMenuSrvAppScanner::UpdateApplicationItemsL
   715 // CMenuSrvAppScanner::UpdateApplicationItemsL
   716 // ---------------------------------------------------------
   716 // ---------------------------------------------------------
   717 //
   717 //
   718 void CMenuSrvAppScanner::UpdateApplicationItemsL()
   718 void CMenuSrvAppScanner::UpdateApplicationItemsL()
   742 // ---------------------------------------------------------
   742 // ---------------------------------------------------------
   743 // CMenuSrvAppScanner::HandleLockDeleteFlagUpdateL
   743 // CMenuSrvAppScanner::HandleLockDeleteFlagUpdateL
   744 // ---------------------------------------------------------
   744 // ---------------------------------------------------------
   745 //
   745 //
   746 void CMenuSrvAppScanner::HandleLockDeleteFlagUpdateL(
   746 void CMenuSrvAppScanner::HandleLockDeleteFlagUpdateL(
   747 		const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem )
   747     const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem )
   748 	{
   748   {
   749 	TBool isHidden = ( ( iEng.ObjectL( aItem.Id() )
   749   TBool isHidden = ( ( iEng.ObjectL( aItem.Id() )
   750 							.Flags() & TMenuItem::EHidden ) != 0 );
   750               .Flags() & TMenuItem::EHidden ) != 0 );
   751 	if ( !isHidden && IsInRomL( aApaItem ) )
   751   if ( !isHidden && IsInRomL( aApaItem ) )
   752 		{
   752     {
   753 		if ( ( aItem.Flags() & TMenuItem::ELockDelete ) == 0 )
   753     if ( ( aItem.Flags() & TMenuItem::ELockDelete ) == 0 )
   754 			{
   754       {
   755             ModifiableObjectL( aApaItem.GetUid(), aItem.Id()).SetFlags(
   755             ModifiableObjectL( aApaItem.GetUid(), aItem.Id()).SetFlags(
   756                     TMenuItem::ELockDelete, ETrue );
   756                     TMenuItem::ELockDelete, ETrue );
   757 			}
   757       }
   758 		}
   758     }
   759 	else
   759   else
   760 		{
   760     {
   761 		if ( ( aItem.Flags() & TMenuItem::ELockDelete ) != 0 )
   761     if ( ( aItem.Flags() & TMenuItem::ELockDelete ) != 0 )
   762 			{
   762       {
   763             ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetFlags(
   763             ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetFlags(
   764                     TMenuItem::ELockDelete, EFalse );
   764                     TMenuItem::ELockDelete, EFalse );
   765 			}
   765       }
   766 		}
   766     }
   767 	}
   767   }
   768 
   768 
   769 // ---------------------------------------------------------
   769 // ---------------------------------------------------------
   770 // CMenuSrvAppScanner::HandleMissingFlagUpdateL
   770 // CMenuSrvAppScanner::HandleMissingFlagUpdateL
   771 // ---------------------------------------------------------
   771 // ---------------------------------------------------------
   772 //
   772 //
   773 void CMenuSrvAppScanner::HandleMissingFlagUpdateL(
   773 void CMenuSrvAppScanner::HandleMissingFlagUpdateL(
   774         const TMenuItem& aItem,  const CMenuSrvAppAttributes& aApaItem  )
   774         const TMenuItem& aItem,  const CMenuSrvAppAttributes& aApaItem  )
   775 	{
   775   {
   776 	if ( aItem.Flags() & TMenuItem::EMissing )
   776   if ( aItem.Flags() & TMenuItem::EMissing )
   777         {
   777         {
   778         CLOG_WRITE_FORMAT8( "Unsetting flag EMissing on %d", item.Id() );
   778         CLOG_WRITE_FORMAT8( "Unsetting flag EMissing on %d", item.Id() );
   779         //application found so we unset "missing" flag
   779         //application found so we unset "missing" flag
   780         ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
   780         ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
   781                 RMenuNotifier::EItemsAddedRemoved ).SetFlags(
   781                 RMenuNotifier::EItemsAddedRemoved ).SetFlags(
   782                         TMenuItem::EMissing, EFalse );
   782                         TMenuItem::EMissing, EFalse );
   783         }
   783         }
   784 	}
   784   }
   785 
   785 
   786 // ---------------------------------------------------------
   786 // ---------------------------------------------------------
   787 // CMenuSrvAppScanner::GetCrItemsL
   787 // CMenuSrvAppScanner::GetCrItemsL
   788 // ---------------------------------------------------------
   788 // ---------------------------------------------------------
   789 //
   789 //
   790 void CMenuSrvAppScanner::GetCrItemsL( RPointerArray<CMenuSrvAppAttributes>& aArray )
   790 void CMenuSrvAppScanner::GetCrItemsL( RPointerArray<CMenuSrvAppAttributes>& aArray )
   791     {
   791     {
   792  	TBuf<KCenRepBufferSize> buf;
   792    TBuf<KCenRepBufferSize> buf;
   793 	iCenRepSession->Get( KMenuHideCPApplication, buf );
   793   iCenRepSession->Get( KMenuHideCPApplication, buf );
   794 	ParseUidsL( buf, aArray );// parses UIDs from buf and appends them to array
   794   ParseUidsL( buf, aArray );// parses UIDs from buf and appends them to array
   795 	iCenRepSession->Get( KMenuHideApplication, buf );
   795   iCenRepSession->Get( KMenuHideApplication, buf );
   796 	ParseUidsL( buf, aArray );// parses UIDs from buf and appends them to array
   796   ParseUidsL( buf, aArray );// parses UIDs from buf and appends them to array
   797     }
   797     }
   798 
   798 
   799 // ---------------------------------------------------------
   799 // ---------------------------------------------------------
   800 // CMenuSrvAppScanner::ParseUidsL
   800 // CMenuSrvAppScanner::ParseUidsL
   801 // ---------------------------------------------------------
   801 // ---------------------------------------------------------
   809     TBool notEmpty = EFalse;
   809     TBool notEmpty = EFalse;
   810     while ( !input.Eos() )
   810     while ( !input.Eos() )
   811         {
   811         {
   812         if( input.Peek() == ',')
   812         if( input.Peek() == ',')
   813             {
   813             {
   814             SetHidden(input.MarkedToken( startMark ), aArray);
   814             SetHiddenL(input.MarkedToken( startMark ), aArray);
   815             input.Inc();
   815             input.Inc();
   816             input.Mark( startMark );
   816             input.Mark( startMark );
   817             }
   817             }
   818         input.Inc();
   818         input.Inc();
   819         notEmpty = ETrue;
   819         notEmpty = ETrue;
   820         }
   820         }
   821 	if ( notEmpty )
   821     if ( notEmpty )
   822 		{
   822         {
   823 		SetHidden(input.MarkedToken( startMark ), aArray);
   823         SetHiddenL( input.MarkedToken( startMark ), aArray );
   824 		}
   824         }
   825 
       
   826 
       
   827     }
   825     }
   828 
   826 
   829 // ---------------------------------------------------------
   827 // ---------------------------------------------------------
   830 // CMenuSrvAppScanner::SetHidden
   828 // CMenuSrvAppScanner::SetHidden
   831 // ---------------------------------------------------------
   829 // ---------------------------------------------------------
   832 //
   830 //
   833 void CMenuSrvAppScanner::SetHidden(
   831 void CMenuSrvAppScanner::SetHiddenL(
   834         const TDesC& aHiddenAppUid, RPointerArray<CMenuSrvAppAttributes>& aArray )
   832         const TDesC& aHiddenAppUid, RPointerArray<CMenuSrvAppAttributes>& aArray )
   835     {
   833     {
   836     TLex appUidDescriptor(aHiddenAppUid);
   834     TLex appUidDescriptor(aHiddenAppUid);
   837     TUint hiddenAppUid( 0 );
   835     TUint hiddenAppUid( 0 );
   838     appUidDescriptor.Val( hiddenAppUid, EHex );
   836     appUidDescriptor.Val( hiddenAppUid, EHex );
   950 // ---------------------------------------------------------
   948 // ---------------------------------------------------------
   951 // CMenuSrvAppScanner::ScheduleScan
   949 // CMenuSrvAppScanner::ScheduleScan
   952 // ---------------------------------------------------------
   950 // ---------------------------------------------------------
   953 //
   951 //
   954 void CMenuSrvAppScanner::ScheduleScan()
   952 void CMenuSrvAppScanner::ScheduleScan()
   955 	{
   953   {
   956 	if ( !IsActive() && !iOpStatus )
   954   if ( !IsActive() && !iOpStatus )
   957 		{
   955     {
   958 		iOpStatus = ETrue;
   956     iOpStatus = ETrue;
   959 		TRequestStatus* ownStatus = &iStatus;
   957     TRequestStatus* ownStatus = &iStatus;
   960 		*ownStatus = KRequestPending;
   958     *ownStatus = KRequestPending;
   961 		SetActive();
   959     SetActive();
   962 		User::RequestComplete( ownStatus, KErrNone );
   960     User::RequestComplete( ownStatus, KErrNone );
   963 		}
   961     }
   964 	}
   962   }
   965 
   963 
   966 // ---------------------------------------------------------
   964 // ---------------------------------------------------------
   967 // CMenuSrvAppScanner::CreateInstallFolderL
   965 // CMenuSrvAppScanner::CreateInstallFolderL
   968 // ---------------------------------------------------------
   966 // ---------------------------------------------------------
   969 //
   967 //
   970 TInt CMenuSrvAppScanner::CreateInstallFolderL( const CMenuSrvAppAttributes& aApaItem )
   968 TInt CMenuSrvAppScanner::CreateInstallFolderL( const CMenuSrvAppAttributes& aApaItem )
   971 	{
   969   {
   972     // Find a folder for this app.
   970     // Find a folder for this app.
   973     TInt folder(0);
   971     TInt folder(0);
   974     if ( aApaItem.GetGroupName().Length() )
   972     if ( aApaItem.GetGroupName().Length() )
   975         {
   973         {
   976         // appgroup_name is defined for this app. Find or create folder.
   974         // appgroup_name is defined for this app. Find or create folder.
   985         {
   983         {
   986         // Last resort: it goes to the root.
   984         // Last resort: it goes to the root.
   987         iEng.RootFolderL( folder );
   985         iEng.RootFolderL( folder );
   988         }
   986         }
   989     return folder;
   987     return folder;
   990 	}
   988   }
   991 
   989 
   992 // ---------------------------------------------------------
   990 // ---------------------------------------------------------
   993 // CMenuSrvAppScanner::AddAppItemL
   991 // CMenuSrvAppScanner::AddAppItemL
   994 // ---------------------------------------------------------
   992 // ---------------------------------------------------------
   995 //
   993 //
  1011         // This app is on the MMC, set the "mmc_id" attribute.
  1009         // This app is on the MMC, set the "mmc_id" attribute.
  1012         uidString.Format( KHexFormat, aCurrentMmcId );
  1010         uidString.Format( KHexFormat, aCurrentMmcId );
  1013         object->SetAttributeL( KMenuAttrMmcId, uidString, EFalse );
  1011         object->SetAttributeL( KMenuAttrMmcId, uidString, EFalse );
  1014         }
  1012         }
  1015     if( aApaItem.GetAppType() == CMenuEngObject::EWidgetApp )
  1013     if( aApaItem.GetAppType() == CMenuEngObject::EWidgetApp )
  1016     	{
  1014       {
  1017     	//we need this to delete uninstalled java or wrt widget app item
  1015       //we need this to delete uninstalled java or wrt widget app item
  1018     	if ( !IsInMmc( aApaItem )
  1016       if ( !IsInMmc( aApaItem )
  1019     			&& IsInMassStorage( aApaItem ) )
  1017           && IsInMassStorage( aApaItem ) )
  1020     		{
  1018         {
  1021     		object->SetAttributeL( KMenuAttrMmcId, KMenuMassStorage, EFalse );
  1019         object->SetAttributeL( KMenuAttrMmcId, KMenuMassStorage, EFalse );
  1022     		}
  1020         }
  1023     	}
  1021       }
  1024     object->SetAppType( aApaItem.GetAppType() );
  1022     object->SetAppType( aApaItem.GetAppType() );
  1025     EnsureFolderWritableL( folder );
  1023     EnsureFolderWritableL( folder );
  1026     iEng.AddL( *object, folder, 0 );
  1024     iEng.AddL( *object, folder, 0 );
  1027     CleanupStack::Pop( object );
  1025     CleanupStack::Pop( object );
  1028     }
  1026     }
  1041     const CMenuEngObject& rootObject = iEng.ObjectL( defaultFolderId );
  1039     const CMenuEngObject& rootObject = iEng.ObjectL( defaultFolderId );
  1042     TPtrC groupName;
  1040     TPtrC groupName;
  1043     TBool localized;
  1041     TBool localized;
  1044 
  1042 
  1045     if ( rootObject.FindAttribute( KMenuAttrAppGroupName, groupName, localized ) &&
  1043     if ( rootObject.FindAttribute( KMenuAttrAppGroupName, groupName, localized ) &&
  1046     	groupName.Compare( aAppGroupName )==0 )
  1044       groupName.Compare( aAppGroupName )==0 )
  1047         {
  1045         {
  1048         folder = defaultFolderId;
  1046         folder = defaultFolderId;
  1049         }
  1047         }
  1050     else
  1048     else
  1051     	{
  1049       {
  1052         TMenuSrvTypeAttrFilter filter;
  1050         TMenuSrvTypeAttrFilter filter;
  1053         filter.SetType( KMenuTypeFolder() );
  1051         filter.SetType( KMenuTypeFolder() );
  1054         filter.SetAttr( KMenuAttrAppGroupName(), aAppGroupName );
  1052         filter.SetAttr( KMenuAttrAppGroupName(), aAppGroupName );
  1055         RArray<TMenuItem> items;
  1053         RArray<TMenuItem> items;
  1056         CleanupClosePushL( items );
  1054         CleanupClosePushL( items );
  1059         if ( items.Count() )
  1057         if ( items.Count() )
  1060             {
  1058             {
  1061             folder = items[0].Id();
  1059             folder = items[0].Id();
  1062             }
  1060             }
  1063         CleanupStack::PopAndDestroy( &items );
  1061         CleanupStack::PopAndDestroy( &items );
  1064     	}
  1062       }
  1065     if ( !folder )
  1063     if ( !folder )
  1066         {
  1064         {
  1067         // No such folder, create it now.
  1065         // No such folder, create it now.
  1068         CMenuEngObject* object = iEng.NewObjectL( KMenuTypeFolder() );
  1066         CMenuEngObject* object = iEng.NewObjectL( KMenuTypeFolder() );
  1069         CleanupStack::PushL( object );
  1067         CleanupStack::PushL( object );
  1149             }
  1147             }
  1150         }
  1148         }
  1151     else if( iEng.ObjectL( aItem.Id() ).GetAppType()
  1149     else if( iEng.ObjectL( aItem.Id() ).GetAppType()
  1152                 != CMenuEngObject::EWidgetApp
  1150                 != CMenuEngObject::EWidgetApp
  1153             || iEng.ObjectL( aItem.Id() ).FindAttribute(
  1151             || iEng.ObjectL( aItem.Id() ).FindAttribute(
  1154             		KMenuAttrPredefined(), val, dummy ) )
  1152                 KMenuAttrPredefined(), val, dummy ) )
  1155         {
  1153         {
  1156         flags = TMenuItem::EHidden;
  1154         flags = TMenuItem::EHidden;
  1157         }
  1155         }
  1158     return flags;
  1156     return flags;
  1159     }
  1157     }
  1183 // ---------------------------------------------------------
  1181 // ---------------------------------------------------------
  1184 // CMenuSrvAppScanner::SetObjectFlagsL
  1182 // CMenuSrvAppScanner::SetObjectFlagsL
  1185 // ---------------------------------------------------------
  1183 // ---------------------------------------------------------
  1186 //
  1184 //
  1187 void CMenuSrvAppScanner::SetObjectFlagsL( TBool aFlagValue, const TMenuItem& aItem,
  1185 void CMenuSrvAppScanner::SetObjectFlagsL( TBool aFlagValue, const TMenuItem& aItem,
  1188 		const TMenuItem::TFlags& aFlag, const RMenuNotifier::TEvent& aEvent  )
  1186     const TMenuItem::TFlags& aFlag, const RMenuNotifier::TEvent& aEvent  )
  1189 	{
  1187   {
  1190 	TBool itemFlagPresent = (0 != (aItem.Flags() & aFlag));
  1188   TBool itemFlagPresent = (0 != (aItem.Flags() & aFlag));
  1191 	if( aFlagValue != itemFlagPresent )
  1189   if( aFlagValue != itemFlagPresent )
  1192 		{
  1190     {
  1193         iEng.ModifiableObjectL( aItem.Id(), aEvent ).
  1191         iEng.ModifiableObjectL( aItem.Id(), aEvent ).
  1194                  SetFlags( aFlag, aFlagValue );
  1192                  SetFlags( aFlag, aFlagValue );
  1195 		}
  1193     }
  1196 	}
  1194   }
  1197 
  1195 
  1198 // ---------------------------------------------------------
  1196 // ---------------------------------------------------------
  1199 // CMenuSrvAppScanner::UpdateMmcHistoryL
  1197 // CMenuSrvAppScanner::UpdateMmcHistoryL
  1200 // ---------------------------------------------------------
  1198 // ---------------------------------------------------------
  1201 //
  1199 //
  1202 TUint CMenuSrvAppScanner::UpdateMmcHistoryL()
  1200 TUint CMenuSrvAppScanner::UpdateMmcHistoryL()
  1203     {
  1201     {
  1204     TUint mmcId = CurrentMmcId();
  1202     TUint mmcId = CurrentMmcId();
  1205     if( mmcId )
  1203     if( mmcId )
  1206     	{
  1204       {
  1207     	iMmcHistory->InsertL( mmcId );
  1205       iMmcHistory->InsertL( mmcId );
  1208     	iMmcHistory->SaveL( iFs, KMenuMmcHistoryFname() );
  1206       iMmcHistory->SaveL( iFs, KMenuMmcHistoryFname() );
  1209     	}
  1207       }
  1210     return mmcId;
  1208     return mmcId;
  1211     }
  1209     }
  1212 
  1210 
  1213 // ---------------------------------------------------------
  1211 // ---------------------------------------------------------
  1214 // CMenuSrvAppScanner::CurrentMmcId
  1212 // CMenuSrvAppScanner::CurrentMmcId
  1219     // Get mmc id. Errors are ignored.
  1217     // Get mmc id. Errors are ignored.
  1220     TUint mmcId = 0;
  1218     TUint mmcId = 0;
  1221     TInt mmcDrive;
  1219     TInt mmcDrive;
  1222     TInt err;
  1220     TInt err;
  1223     err = DriveInfo::GetDefaultDrive(
  1221     err = DriveInfo::GetDefaultDrive(
  1224     	    DriveInfo::EDefaultRemovableMassStorage, mmcDrive );
  1222           DriveInfo::EDefaultRemovableMassStorage, mmcDrive );
  1225     if ( !err )
  1223     if ( !err )
  1226         {
  1224         {
  1227         TVolumeInfo volumeInfo;
  1225         TVolumeInfo volumeInfo;
  1228         err = iFs.Volume( volumeInfo, mmcDrive );
  1226         err = iFs.Volume( volumeInfo, mmcDrive );
  1229         if( !err )
  1227         if( !err )
  1237 // ---------------------------------------------------------
  1235 // ---------------------------------------------------------
  1238 // CMenuSrvAppScanner::IsFileInDrive
  1236 // CMenuSrvAppScanner::IsFileInDrive
  1239 // ---------------------------------------------------------
  1237 // ---------------------------------------------------------
  1240 //
  1238 //
  1241 TBool CMenuSrvAppScanner::IsFileInDrive(
  1239 TBool CMenuSrvAppScanner::IsFileInDrive(
  1242 			const TDesC& aFileName,
  1240       const TDesC& aFileName,
  1243 			const DriveInfo::TDefaultDrives& aDefaultDrive ) const
  1241       const DriveInfo::TDefaultDrives& aDefaultDrive ) const
  1244     {
  1242     {
  1245     if ( aFileName.Length() )
  1243     if ( aFileName.Length() )
  1246         {
  1244         {
  1247         TInt mmcDrive;
  1245         TInt mmcDrive;
  1248         TInt err = DriveInfo::GetDefaultDrive(
  1246         TInt err = DriveInfo::GetDefaultDrive(
  1249 						aDefaultDrive, mmcDrive );
  1247             aDefaultDrive, mmcDrive );
  1250         if ( !err )
  1248         if ( !err )
  1251             {
  1249             {
  1252             TInt fileDrive;
  1250             TInt fileDrive;
  1253             err = RFs::CharToDrive( aFileName[0], fileDrive );
  1251             err = RFs::CharToDrive( aFileName[0], fileDrive );
  1254             if ( !err && fileDrive == mmcDrive )
  1252             if ( !err && fileDrive == mmcDrive )
  1264 // CMenuSrvAppScanner::IsAppInDrive
  1262 // CMenuSrvAppScanner::IsAppInDrive
  1265 // ---------------------------------------------------------
  1263 // ---------------------------------------------------------
  1266 //
  1264 //
  1267 TBool CMenuSrvAppScanner::IsAppInDrive(
  1265 TBool CMenuSrvAppScanner::IsAppInDrive(
  1268         const CMenuSrvAppAttributes& aApaItem,
  1266         const CMenuSrvAppAttributes& aApaItem,
  1269 		const DriveInfo::TDefaultDrives& aDefaultDrive ) const
  1267     const DriveInfo::TDefaultDrives& aDefaultDrive ) const
  1270     {
  1268     {
  1271     TBool ret( EFalse );
  1269     TBool ret( EFalse );
  1272     if ( IsFileInDrive( aApaItem.GetFullName(), aDefaultDrive ) )
  1270     if ( IsFileInDrive( aApaItem.GetFullName(), aDefaultDrive ) )
  1273     	{
  1271       {
  1274     	ret = ETrue;
  1272       ret = ETrue;
  1275     	}
  1273       }
  1276     return ret;
  1274     return ret;
  1277     }
  1275     }
  1278 
  1276 
  1279 // ---------------------------------------------------------
  1277 // ---------------------------------------------------------
  1280 // CMenuSrvAppScanner::IsInMmc
  1278 // CMenuSrvAppScanner::IsInMmc
  1306 // ---------------------------------------------------------
  1304 // ---------------------------------------------------------
  1307 // CMenuSrvAppScanner::IsDriveInUse
  1305 // CMenuSrvAppScanner::IsDriveInUse
  1308 // ---------------------------------------------------------
  1306 // ---------------------------------------------------------
  1309 //
  1307 //
  1310 TBool CMenuSrvAppScanner::IsDriveInUse(
  1308 TBool CMenuSrvAppScanner::IsDriveInUse(
  1311 		const DriveInfo::TDefaultDrives& aDefaultDrive )
  1309     const DriveInfo::TDefaultDrives& aDefaultDrive )
  1312     {
  1310     {
  1313     TBool inUse( EFalse );
  1311     TBool inUse( EFalse );
  1314     TInt drive;
  1312     TInt drive;
  1315 
  1313 
  1316     TInt err = DriveInfo::GetDefaultDrive( aDefaultDrive, drive );
  1314     TInt err = DriveInfo::GetDefaultDrive( aDefaultDrive, drive );
  1317     if( err == KErrNone )
  1315     if( err == KErrNone )
  1318 		{
  1316     {
  1319 		TUint status;
  1317     TUint status;
  1320 		err =  DriveInfo::GetDriveStatus(  iFs, drive, status );
  1318     err =  DriveInfo::GetDriveStatus(  iFs, drive, status );
  1321 		if( err == KErrNone
  1319     if( err == KErrNone
  1322 				&& ( status & DriveInfo::EDriveInUse ) )
  1320         && ( status & DriveInfo::EDriveInUse ) )
  1323 			{
  1321       {
  1324 			inUse = ETrue;
  1322       inUse = ETrue;
  1325 			}
  1323       }
  1326 		}
  1324     }
  1327 
  1325 
  1328 	return inUse;
  1326   return inUse;
  1329     }
  1327     }
  1330 
  1328 
  1331 //  End of File
  1329 //  End of File