bluetoothengine/btnotif/src/BTNInqUI.cpp
branchRCL_3
changeset 35 95674584745d
parent 6 6a29d5ad0713
equal deleted inserted replaced
21:53b7818cd282 35:95674584745d
    40 
    40 
    41 const TInt KBTAllPurposeBufferLength = 266;
    41 const TInt KBTAllPurposeBufferLength = 266;
    42 const TInt KBTNotifNonPairedUsedDevicesMaxNumber= 5;
    42 const TInt KBTNotifNonPairedUsedDevicesMaxNumber= 5;
    43 // RSSI value range: -127dB ~ +20dB
    43 // RSSI value range: -127dB ~ +20dB
    44 const TInt KRssiRangeOffset = 127 + 1;  // Offset for getting a non-zero positive value
    44 const TInt KRssiRangeOffset = 127 + 1;  // Offset for getting a non-zero positive value
       
    45 const TInt KMinimumStrength = 1;
    45 const TInt KMediumStrength = 53;
    46 const TInt KMediumStrength = 53;
    46 const TInt KHighStrength = 82;
    47 const TInt KHighStrength = 82;
    47 const TUint32 ExcludePairedDeviceMask = 0x800000;
    48 const TUint32 ExcludePairedDeviceMask = 0x800000;
    48 const TUint32 ResetExcludePairedDeviceMask = 0xFF7FFFFF;
    49 const TUint32 ResetExcludePairedDeviceMask = 0xFF7FFFFF;
    49 _LIT(KBtnotifBmpFileName,"btnotif.mbm");
    50 _LIT(KBtnotifBmpFileName,"btnotif.mbm");
    65         iDevicesFound (EFalse),
    66         iDevicesFound (EFalse),
    66         iBroughtForwards (EFalse),
    67         iBroughtForwards (EFalse),
    67         iDesiredDeviceClass (aDesiredDevClass),
    68         iDesiredDeviceClass (aDesiredDevClass),
    68         iSystemCancel (EFalse), 
    69         iSystemCancel (EFalse), 
    69         iPageForName ( EFalse ),
    70         iPageForName ( EFalse ),
    70         iIndex (0),
    71         iCurrentlyResolvingUnnamedDeviceIndex (0),
    71         iDevSearchObserver (aObserver)
    72         iDevSearchObserver (aObserver)
    72     {
    73     {
    73 	iBTRegistryQueryState=ENoQuery;
    74 	iBTRegistryQueryState=ENoQuery;
    74 	}
    75 	}
    75 
    76 
   228     if( iLastSeenDevicesArray ) 
   229     if( iLastSeenDevicesArray ) 
   229         {  
   230         {  
   230         iLastSeenDevicesArray->ResetAndDestroy();
   231         iLastSeenDevicesArray->ResetAndDestroy();
   231         delete iLastSeenDevicesArray; 
   232         delete iLastSeenDevicesArray; 
   232         }
   233         }
       
   234 
       
   235     iLastSeenDevicesNameComplete.Close();
       
   236 
   233     if( iAdjustedUsedDeviceArray )
   237     if( iAdjustedUsedDeviceArray )
   234         {  
   238         {
   235         iAdjustedUsedDeviceArray->ResetAndDestroy();
   239         iAdjustedUsedDeviceArray->ResetAndDestroy();
   236         delete iAdjustedUsedDeviceArray; 
   240         delete iAdjustedUsedDeviceArray; 
   237         }
   241         }
   238     if( iDefaultDeviceNamesArray )
   242     if( iDefaultDeviceNamesArray )
   239         {
   243         {
   305     CreatePopupListL( R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT , R_BT_LAST_USED_DEVS_POPUP_TITLE );
   309     CreatePopupListL( R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT , R_BT_LAST_USED_DEVS_POPUP_TITLE );
   306 
   310 
   307     // Add devices into device list.
   311     // Add devices into device list.
   308     for( TInt index = 0; index < iAdjustedUsedDeviceArray->Count(); index++ )
   312     for( TInt index = 0; index < iAdjustedUsedDeviceArray->Count(); index++ )
   309     	{        
   313     	{        
   310    	    UpdateDeviceListL ( iAdjustedUsedDeviceArray->At(index) );  
   314    	    AddToDeviceListBoxL ( iAdjustedUsedDeviceArray->At(index) );  
   311         }  
   315         }  
   312 
   316 
   313     // Add "more devices" command as first item of list
   317     // Add "more devices" command as first item of list
   314     HBufC* formatString = HBufC::NewLC( KBTAllPurposeBufferLength );
   318     HBufC* formatString = HBufC::NewLC( KBTAllPurposeBufferLength );
   315     formatString->Des().Copy( TPtrC(KDeviceIconFormatTable[EDeviceIconBlank].iFormat ) );
   319     formatString->Des().Copy( TPtrC(KDeviceIconFormatTable[EDeviceIconBlank].iFormat ) );
   436         }
   440         }
   437     
   441     
   438     // Inquiry completed, show final device list 
   442     // Inquiry completed, show final device list 
   439     FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceSearchUiL Displaying final devicelist"));          
   443     FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceSearchUiL Displaying final devicelist"));          
   440     CreatePopupListL( R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, R_BT_FOUND_DEVS_POPUP_TITLE );
   444     CreatePopupListL( R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, R_BT_FOUND_DEVS_POPUP_TITLE );
   441    
   445 
   442     //cancel iPeriodicTimer after the final list is shown
   446     //cancel iPeriodicTimer after the final list is shown
   443     iPeriodicTimer->Cancel();
   447     iPeriodicTimer->Cancel();
   444     User::ResetInactivityTime();
   448     User::ResetInactivityTime();
   445     // Set highlight on top of same device as it was in previous popuplist
   449     // Set highlight on top of same device as it was in previous popuplist
   446     if( iHighLightedItemIndex >= 0 )
   450     if( iHighLightedItemIndex >= 0 )
   538 // ----------------------------------------------------------
   542 // ----------------------------------------------------------
   539 // CBTInqUI::DeviceAvailableL
   543 // CBTInqUI::DeviceAvailableL
   540 // Bluetooth device has been received.
   544 // Bluetooth device has been received.
   541 // ----------------------------------------------------------
   545 // ----------------------------------------------------------
   542 //
   546 //
   543 void CBTInqUI::DeviceAvailableL( const TNameRecord& aNameRecord, const TDesC& aDevName )
   547 void CBTInqUI::DeviceAvailableL( const TNameRecord& aNameRecord, const TDesC& aDevName, TBool aIsNameComplete )
   544     {
   548     {
   545     FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceAvailableL()"));
   549     FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceAvailableL()"));
   546 
   550 
   547     if( !iDevicesFound )
   551     if( !iDevicesFound )
   548         {
   552         {
   565     if( sa.ResultFlags() & TInquirySockAddr::ERssiValid )
   569     if( sa.ResultFlags() & TInquirySockAddr::ERssiValid )
   566         {
   570         {
   567         rssi = sa.Rssi() + KRssiRangeOffset;
   571         rssi = sa.Rssi() + KRssiRangeOffset;
   568         }
   572         }
   569 
   573 
   570     BtNotifNameUtils::SetDeviceNameL(aDevName, *newDevice);
   574     TBTDeviceName name(aDevName);
   571 
   575     if (!aIsNameComplete)
   572     // Update device popup list with newDevice
   576         {
   573     UpdateDeviceListL( newDevice, rssi );
   577         // Append a little "..." to partial names.
       
   578         _LIT(KToBeContd, "...");
       
   579         if (name.MaxLength() - name.Length() >= KToBeContd().Length())
       
   580             {
       
   581             name.Append(KToBeContd);
       
   582             }
       
   583         }
       
   584     BtNotifNameUtils::SetDeviceNameL(name, *newDevice);
   574 
   585 
   575     // Append newDevice in the bottom of the "last seen" device array.
   586     // Append newDevice in the bottom of the "last seen" device array.
   576     iLastSeenDevicesArray->AppendL(newDevice);
   587     iLastSeenDevicesArray->AppendL(newDevice);
       
   588     iLastSeenDevicesNameComplete.AppendL(aIsNameComplete);
   577     CleanupStack::Pop(); // new device is under iLastSeenDevicesArray control now
   589     CleanupStack::Pop(); // new device is under iLastSeenDevicesArray control now
   578 
   590 
       
   591     __ASSERT_DEBUG(iLastSeenDevicesArray->Count() == iLastSeenDevicesNameComplete.Count(),
       
   592                    User::Panic(_L("BTNotifInqUI - device array and name resolution status array out of sync"), KErrCorrupt));
       
   593 
       
   594     // Update device popup list with newDevice
       
   595     AddToDeviceListBoxL( newDevice, rssi );
       
   596 
       
   597     __ASSERT_DEBUG(iLastSeenDevicesArray->Count() == iDeviceListRows->Count(),
       
   598                    User::Panic(_L("BTNotifInqUI - device array and UI list out of sync"), KErrCorrupt));
       
   599 
   579     FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceAvailableL() completed"));
   600     FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceAvailableL() completed"));
   580     }
   601     }
       
   602 
       
   603 void CBTInqUI::DeviceNameUpdatedL(const TNameRecord& aNameRecord, TInt aLastSeenIndex)
       
   604     {
       
   605     FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::DeviceUpdatedL() Name found: %S"), &(aNameRecord.iName) ));
       
   606 
       
   607     TInquirySockAddr& sa = TInquirySockAddr::Cast( iEntry().iAddr );
       
   608 
       
   609     TInt rssi = 0;
       
   610     if( sa.ResultFlags() & TInquirySockAddr::ERssiValid )
       
   611         {
       
   612         rssi = sa.Rssi() + KRssiRangeOffset;
       
   613         }
       
   614 
       
   615     BtNotifNameUtils::SetDeviceNameL(aNameRecord.iName, *iLastSeenDevicesArray->At(aLastSeenIndex));
       
   616     DeviceUpdatedL(rssi, aLastSeenIndex);
       
   617 
       
   618     FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceUpdatedL() completed"));
       
   619     }
       
   620 
       
   621 void CBTInqUI::PageTimeoutOnDeviceWithPartialNameL(TInt aLastSeenIndex)
       
   622     {
       
   623     FLOG(_L("[BTNOTIF]\t CBTInqUI::PageTimeoutOnDeviceWithPartialNameL()"));
       
   624     DeviceUpdatedL(KMinimumStrength, aLastSeenIndex);
       
   625     FLOG(_L("[BTNOTIF]\t CBTInqUI::PageTimeoutOnDeviceWithPartialNameL() completed"));
       
   626     }
       
   627 
       
   628 
       
   629 void CBTInqUI::DeviceUpdatedL(TInt aSignalStrength, TInt aLastSeenIndex)
       
   630     {
       
   631     FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceUpdatedL()"));
       
   632 
       
   633     HBufC* formatString = HBufC::NewLC( KBTAllPurposeBufferLength );
       
   634     FormatListBoxEntryL(*iLastSeenDevicesArray->At(aLastSeenIndex), aSignalStrength, formatString->Des());
       
   635 
       
   636     // The assumption here is that iLastSeenDevicesArray is always accurately reflected
       
   637     // in iDeviceListRows so device indexes match.
       
   638     __ASSERT_DEBUG(iLastSeenDevicesArray->Count() == iDeviceListRows->Count(),
       
   639                    User::Panic(_L("BTNotifInqUI - device array and UI dev list out of sync not created"), KErrCorrupt));
       
   640 
       
   641     iDeviceListRows->Delete(aLastSeenIndex);
       
   642     iDeviceListRows->InsertL(aLastSeenIndex, *formatString);
       
   643     CleanupStack::PopAndDestroy();  // formatString
       
   644 
       
   645     __ASSERT_DEBUG(iDeviceListBox,
       
   646                    User::Panic(_L("BTNotifInqUI - UI list non-existant on name update"), KErrCorrupt));
       
   647     iDeviceListBox->HandleItemAdditionL();
       
   648 
       
   649     FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceUpdatedL()"));
       
   650     }
       
   651 
       
   652 void CBTInqUI::FormatListBoxEntryL(CBTDevice& aDevice, const TInt aSignalStrength, TPtr aFormatString)
       
   653     {
       
   654     FLOG(_L("[BTNOTIF]\t CBTInqUI::FormatListBoxEntryL()"));
       
   655 
       
   656     TInt iconIndex (EDeviceIconDefault);
       
   657     TInt defNameIndex (EBTDeviceNameIndexDefault);
       
   658 
       
   659     // Check whether the device is already in registry.
       
   660     TInt index = LookupFromDevicesArray(iPairedDevicesArray, &aDevice );
       
   661     if( index >= 0 )
       
   662         {
       
   663         // Update device's link key and friendly name 
       
   664         // with those found from registry.
       
   665         aDevice.UpdateL( *( iPairedDevicesArray->At( index ) ) );
       
   666         }
       
   667 
       
   668     for (TInt i = 0; i < KDeviceRowLayoutTableSize; i++)
       
   669         {
       
   670         if ( ( aDevice.DeviceClass().MajorDeviceClass() == KDeviceRowLayoutTable[i].iMajorDevClass ) &&
       
   671             ( (aDevice.DeviceClass().MinorDeviceClass() == KDeviceRowLayoutTable[i].iMinorDevClass ) ||
       
   672                     KDeviceRowLayoutTable[i].iMinorDevClass == 0 ) )
       
   673             {
       
   674             iconIndex = KDeviceRowLayoutTable[i].iIconIndex;
       
   675             defNameIndex = KDeviceRowLayoutTable[i].iDefaultNameIndex;
       
   676             break;
       
   677             }
       
   678         }
       
   679     
       
   680     if ( !aDevice.IsValidFriendlyName() && !aDevice.IsValidDeviceName() )
       
   681         {
       
   682         BtNotifNameUtils::SetDeviceNameL(iDefaultDeviceNamesArray->MdcaPoint(defNameIndex), aDevice);
       
   683         }
       
   684 
       
   685     //Convert device name to Unocode for display
       
   686     if ( aDevice.IsValidFriendlyName() )
       
   687         {
       
   688         aFormatString.Copy( aDevice.FriendlyName() );
       
   689         }
       
   690     else 
       
   691         {
       
   692         aFormatString.Copy( BTDeviceNameConverter::ToUnicodeL(aDevice.DeviceName()));
       
   693         }
       
   694 
       
   695     TPtrC iconFormat (KDeviceIconFormatTable[iconIndex].iFormat);
       
   696     
       
   697     aFormatString.Insert( 0, iconFormat );
       
   698 
       
   699     if( aSignalStrength > 0)
       
   700         {
       
   701         if( aSignalStrength <= KMediumStrength )
       
   702             {
       
   703             aFormatString.Append( TPtrC(KDeviceIconFormatTable[EDeviceIconRssiLow].iFormat ) );
       
   704             }
       
   705         else if( aSignalStrength <= KHighStrength )
       
   706             {
       
   707             aFormatString.Append( TPtrC(KDeviceIconFormatTable[EDeviceIconRssiMed].iFormat ) );
       
   708             }
       
   709         else
       
   710             {
       
   711             aFormatString.Append( TPtrC(KDeviceIconFormatTable[EDeviceIconRssiGood].iFormat ) );
       
   712             }
       
   713         }
       
   714     
       
   715     // If the device is paired, add paired icon to format list
       
   716     // Paired device using JustWork file transfering mode is not shown as paired here. 
       
   717     if( index >= 0 && IsUserAwarePaired ( aDevice.AsNamelessDevice() ) )
       
   718         {
       
   719         aFormatString.Append( TPtrC(KDeviceIconFormatTable[EDeviceIconPaired].iFormat ) );
       
   720         }
       
   721     else
       
   722         {
       
   723         // if device is blocked, add blocked icon to format list
       
   724         
       
   725         TInt indexB = LookupFromDevicesArray(iLastUsedDevicesArray, &aDevice );
       
   726         
       
   727         if ( indexB>=0 && iLastUsedDevicesArray->At( indexB )->GlobalSecurity().Banned())
       
   728             {
       
   729             aFormatString.Append( TPtrC(KDeviceIconFormatTable[EDeviceIconBlocked].iFormat ) );
       
   730             }
       
   731         }
       
   732     FLOG(_L("[BTNOTIF]\t CBTInqUI::FormatListBoxEntryL() completed"));
       
   733     }
       
   734 
   581 
   735 
   582 // ----------------------------------------------------------
   736 // ----------------------------------------------------------
   583 // CBTInqUI::InquiryComplete
   737 // CBTInqUI::InquiryComplete
   584 // Inquiry has been completed.
   738 // Inquiry has been completed.
   585 // ----------------------------------------------------------
   739 // ----------------------------------------------------------
   755 
   909 
   756 // ----------------------------------------------------------
   910 // ----------------------------------------------------------
   757 // CBTInqUI::UpdateDeviceListL
   911 // CBTInqUI::UpdateDeviceListL
   758 // ----------------------------------------------------------
   912 // ----------------------------------------------------------
   759 //
   913 //
   760 void CBTInqUI::UpdateDeviceListL( CBTDevice* aDevice, const TInt aSignalStrength )
   914 void CBTInqUI::AddToDeviceListBoxL( CBTDevice* aDevice, const TInt aSignalStrength )
   761     {
   915     {
   762     FLOG(_L("[BTNOTIF]\t CBTInqUI::UpdateDeviceListL()")); 
   916     FLOG(_L("[BTNOTIF]\t CBTInqUI::AddToDeviceListBoxL()")); 
   763     
       
   764     TInt iconIndex (EDeviceIconDefault);
       
   765     TInt defNameIndex (EBTDeviceNameIndexDefault);
       
   766     
   917     
   767     HBufC* formatString = HBufC::NewLC( KBTAllPurposeBufferLength );
   918     HBufC* formatString = HBufC::NewLC( KBTAllPurposeBufferLength );
   768 
   919     FormatListBoxEntryL(*aDevice, aSignalStrength, formatString->Des());
   769     // Check whether the device is already in registry.
       
   770     TInt index = LookupFromDevicesArray(iPairedDevicesArray, aDevice );
       
   771 
       
   772     if( index >= 0 )
       
   773         {
       
   774         // Update device's link key and friendly name 
       
   775         // with those found from registry.
       
   776         aDevice->UpdateL( *( iPairedDevicesArray->At( index ) ) );
       
   777         }
       
   778 
       
   779 	for (TInt i = 0; i < KDeviceRowLayoutTableSize; i++)
       
   780 	    {
       
   781 	    if ( ( aDevice->DeviceClass().MajorDeviceClass() == KDeviceRowLayoutTable[i].iMajorDevClass ) &&
       
   782 	        ( (aDevice->DeviceClass().MinorDeviceClass() == KDeviceRowLayoutTable[i].iMinorDevClass ) ||
       
   783 	                KDeviceRowLayoutTable[i].iMinorDevClass == 0 ) )
       
   784             {
       
   785             iconIndex = KDeviceRowLayoutTable[i].iIconIndex;
       
   786             defNameIndex = KDeviceRowLayoutTable[i].iDefaultNameIndex;
       
   787             break;
       
   788             }
       
   789 	    }
       
   790     
       
   791 	if ( !aDevice->IsValidFriendlyName() && !aDevice->IsValidDeviceName() )
       
   792 		{
       
   793         BtNotifNameUtils::SetDeviceNameL(iDefaultDeviceNamesArray->MdcaPoint(defNameIndex), *aDevice);
       
   794 		}
       
   795 
       
   796 	//Convert device name to Unocode for display
       
   797 	if ( aDevice->IsValidFriendlyName() )
       
   798 		{
       
   799         formatString->Des().Copy( aDevice->FriendlyName() );
       
   800 		}
       
   801 	else 
       
   802 		{
       
   803 		formatString->Des().Copy( BTDeviceNameConverter::ToUnicodeL(aDevice->DeviceName()));
       
   804 		}
       
   805 
       
   806 	TPtrC iconFormat (KDeviceIconFormatTable[iconIndex].iFormat);
       
   807 	
       
   808     formatString->Des().Insert( 0, iconFormat );
       
   809 
       
   810     if( aSignalStrength > 0)
       
   811         {
       
   812         if( aSignalStrength <= KMediumStrength )
       
   813             {
       
   814             formatString->Des().Append( TPtrC(KDeviceIconFormatTable[EDeviceIconRssiLow].iFormat ) );
       
   815             }
       
   816         else if( aSignalStrength <= KHighStrength )
       
   817             {
       
   818             formatString->Des().Append( TPtrC(KDeviceIconFormatTable[EDeviceIconRssiMed].iFormat ) );
       
   819             }
       
   820         else
       
   821             {
       
   822             formatString->Des().Append( TPtrC(KDeviceIconFormatTable[EDeviceIconRssiGood].iFormat ) );
       
   823             }
       
   824         }
       
   825     
       
   826     // If the device is paired, add paired icon to format list
       
   827     // Paired device using JustWork file transfering mode is not shown as paired here. 
       
   828     if( index >= 0 && IsUserAwarePaired ( aDevice->AsNamelessDevice() ) )
       
   829         {
       
   830         formatString->Des().Append( TPtrC(KDeviceIconFormatTable[EDeviceIconPaired].iFormat ) );
       
   831         }
       
   832     else
       
   833     	{
       
   834     	// if device is blocked, add blocked icon to format list
       
   835     	
       
   836     	TInt indexB = LookupFromDevicesArray(iLastUsedDevicesArray, aDevice );
       
   837     	
       
   838     	if ( indexB>=0 && iLastUsedDevicesArray->At( indexB )->GlobalSecurity().Banned())
       
   839     		{
       
   840         	formatString->Des().Append( TPtrC(KDeviceIconFormatTable[EDeviceIconBlocked].iFormat ) );
       
   841     		}
       
   842     	}
       
   843 
   920 
   844     // Add device format string into device items
   921     // Add device format string into device items
   845     //
   922     //
   846     TInt deviceCount = iDeviceListRows->Count();
   923     TInt deviceCount = iDeviceListRows->Count();
   847 	iDeviceListRows->InsertL( deviceCount, *formatString );      
   924 	iDeviceListRows->InsertL( deviceCount, *formatString );      
   848     CleanupStack::PopAndDestroy();  // formatString
   925     CleanupStack::PopAndDestroy();  // formatString
   849 	
   926 
   850     TInt currentItemIndex = 0;
   927     TInt currentItemIndex = 0;
   851 	if(deviceCount != 0 && iDeviceListBox)
   928 	if(deviceCount != 0 && iDeviceListBox)
   852 		{
   929 		{
   853 	 	// Store temporarily the highlighted device and destroy list box
   930 	 	// Store temporarily the highlighted device and destroy list box
   854 	    //
   931 	    //
   858     if( iDeviceListBox )
   935     if( iDeviceListBox )
   859         {
   936         {
   860         iDeviceListBox->HandleItemAdditionL();
   937         iDeviceListBox->HandleItemAdditionL();
   861         
   938         
   862 		if(deviceCount != 0 )	
   939 		if(deviceCount != 0 )	
   863 			{        
   940 			{
   864 			//set highligh back to user selected one.       
   941 			//set highligh back to user selected one.       
   865 			iDeviceListBox->SetCurrentItemIndex(currentItemIndex); 
   942 			iDeviceListBox->SetCurrentItemIndex(currentItemIndex); 
   866 			}
   943 			}
   867 
   944 
   868 		// Adjust top item index in order to "scroll up" the list. 
   945 		// Adjust top item index in order to "scroll up" the list. 
   873 		deviceCount = iDeviceListRows->Count();
   950 		deviceCount = iDeviceListRows->Count();
   874 		
   951 		
   875 		if( (currentItemIndex != topIndex  && deviceCount > 5 ) && (currentItemIndex+1 < deviceCount ) )
   952 		if( (currentItemIndex != topIndex  && deviceCount > 5 ) && (currentItemIndex+1 < deviceCount ) )
   876 			{
   953 			{
   877 			iDeviceListBox->SetTopItemIndex( topIndex+1 ); //scroll up
   954 			iDeviceListBox->SetTopItemIndex( topIndex+1 ); //scroll up
   878 			}	     
   955 			}
   879         }
   956         }
   880 		
   957 
   881     FLOG(_L("[BTNOTIF]\t CBTInqUI::UpdateDeviceListL() completed"));
   958     FLOG(_L("[BTNOTIF]\t CBTInqUI::AddToDeviceListBoxL() completed"));
   882     }
   959     }
   883 
   960 
   884 // ----------------------------------------------------------
   961 // ----------------------------------------------------------
   885 // CBTInqUI::LookupFromDevicesArrayL
   962 // CBTInqUI::LookupFromDevicesArrayL
   886 // Check if the BT device is paired devices array
   963 // Check if the BT device is paired devices array
  1020 	            
  1097 	            
  1021 			//if this paired device is not on the sorted list(it is older then all the devices on the list),
  1098 			//if this paired device is not on the sorted list(it is older then all the devices on the list),
  1022 			//append it to the end of the list.
  1099 			//append it to the end of the list.
  1023 	        if (j == sSize) 
  1100 	        if (j == sSize) 
  1024 	            {
  1101 	            {
  1025 							if ( iExcludePairedDevices )
  1102 				if ( iExcludePairedDevices )
  1026 								 {                
  1103 				    {                
  1027 			            // Add device to list if device is not paired and iExcludePairedDevices is not set. 
  1104                     // Add device to list if device is not paired and iExcludePairedDevices is not set. 
  1028 			            if ( !IsUserAwarePaired( iPairedDevicesArray->At(i)->AsNamelessDevice() ) )
  1105                     if ( !IsUserAwarePaired( iPairedDevicesArray->At(i)->AsNamelessDevice() ) )
  1029 			                {                                      
  1106                         {                                      
  1030 			                aDeviceArray->AppendL(iPairedDevicesArray->At(i)->CopyL());
  1107                         aDeviceArray->AppendL(iPairedDevicesArray->At(i)->CopyL());
  1031 			                }			           
  1108                         }			           
  1032 	               }
  1109 	               }
  1033 	            else
  1110 	            else
  1034 	            	{
  1111 	            	{
  1035 	            	aDeviceArray->AppendL(iPairedDevicesArray->At(i)->CopyL());
  1112 	            	aDeviceArray->AppendL(iPairedDevicesArray->At(i)->CopyL());
  1036 	            	}
  1113 	            	}
  1336         (void) static_cast<CAknNotifierAppServerAppUi*>(eikAppUi)->SuppressAppSwitching(ETrue); 
  1413         (void) static_cast<CAknNotifierAppServerAppUi*>(eikAppUi)->SuppressAppSwitching(ETrue); 
  1337         }
  1414         }
  1338     FTRACE( FPrint( _L( "CBTInqUI::AllowDialerAndAppKeyPress : %d" ), aAllow ) );
  1415     FTRACE( FPrint( _L( "CBTInqUI::AllowDialerAndAppKeyPress : %d" ), aAllow ) );
  1339     }
  1416     }
  1340 
  1417 
       
  1418 TBool CBTInqUI::HaveDevsWithPartialName(TInt& aFirstFoundIndex )
       
  1419     {
       
  1420     FLOG(_L("[BTNOTIF]\t CBTInqUI::HaveDevsWithPartialName()."));
       
  1421     for (TInt i = 0; i < iLastSeenDevicesNameComplete.Count(); i++)
       
  1422         {
       
  1423         if (!iLastSeenDevicesNameComplete[i])
       
  1424             {
       
  1425             FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::HaveDevsWithPartialName() index %d is partial."), i));
       
  1426 
       
  1427             aFirstFoundIndex = i;
       
  1428             return ETrue;
       
  1429             }
       
  1430         }
       
  1431     return EFalse;
       
  1432     }
       
  1433 
  1341 // End of File
  1434 // End of File