diff -r f63038272f30 -r 6a1fe72036e3 bluetoothappprofiles/avrcp/remconbeareravrcp/src/avrcpplayerinfomanager.cpp --- a/bluetoothappprofiles/avrcp/remconbeareravrcp/src/avrcpplayerinfomanager.cpp Mon Jan 18 20:28:57 2010 +0200 +++ b/bluetoothappprofiles/avrcp/remconbeareravrcp/src/avrcpplayerinfomanager.cpp Tue Jan 26 12:06:42 2010 +0200 @@ -48,6 +48,20 @@ return (aId && *aId == aItem.iId); } +enum TFirstAbsVolSupport { EFirstAbsVolSupport }; +static TBool FirstAbsVolSupport(const TFirstAbsVolSupport*, const TAvrcpMediaPlayerItem& aItem) + { + LOG_STATIC_FUNC + return aItem.iId != KNullClientId && aItem.iAbsoluteVolumeSupport; + } + +enum TFirstBrowsingSupport { EFirstBrowsingSupport }; +static TBool FirstBrowsingSupport(const TFirstBrowsingSupport*, const TAvrcpMediaPlayerItem& aItem) + { + LOG_STATIC_FUNC + return aItem.iId != KNullClientId && (aItem.iSdpFeatures & AvrcpSdp::EBrowsing); + } + CAvrcpPlayerInfoManager* CAvrcpPlayerInfoManager::NewL(MRemConBearerObserver& aObserver, MRemConCommandInterface& aCommandInterface) { LOG_STATIC_FUNC @@ -176,8 +190,6 @@ } } - - if(!err) { for(TInt i = 0; i= 0); } - TBool supported = iPlayers[index].iAbsoluteVolumeSupport; + else + { + // The abs vol support for a specific player is required, so return that. + TInt index = iPlayers.Find(aClientId, PlayerCompare); + if(index < 0) + { + LEAVEL(KErrNotFound); + } + supported = iPlayers[index].iAbsoluteVolumeSupport; + } CleanupStack::PopAndDestroy(&iLock); @@ -760,12 +794,25 @@ iLock.Wait(); CleanupSignalPushL(iLock); - TInt index = iPlayers.Find(aClientId, PlayerCompare); - if(index < 0) + TBool supported = EFalse; + // If we receive a "NULL" client ID then it means that we should + // return whether browsing is generically supported by the device. + if(aClientId == KNullClientId) { - LEAVEL(KErrNotFound); + // Try to find the first player supporting browsing, if there is one then it is supported + TInt index = iPlayers.Find(EFirstBrowsingSupport, FirstBrowsingSupport); + supported = (index >= 0); } - TBool supported = iPlayers[index].iSdpFeatures & AvrcpSdp::EBrowsing; + else + { + // The browsing support for a specific player is required, so return that. + TInt index = iPlayers.Find(aClientId, PlayerCompare); + if(index < 0) + { + LEAVEL(KErrNotFound); + } + supported = iPlayers[index].iSdpFeatures & AvrcpSdp::EBrowsing; + } CleanupStack::PopAndDestroy(&iLock);