diff -r eede1356aa52 -r 0ba996a9b75d bluetoothengine/btsac/btrcc/src/btrccVolumeLevelControllerBase.cpp --- a/bluetoothengine/btsac/btrcc/src/btrccVolumeLevelControllerBase.cpp Thu Jul 15 18:50:18 2010 +0300 +++ b/bluetoothengine/btsac/btrcc/src/btrccVolumeLevelControllerBase.cpp Thu Aug 19 10:05:41 2010 +0300 @@ -122,23 +122,21 @@ } // ----------------------------------------------------------------------------- -// CBTRCCVolumeLevelControllerBase::GetLocalMaxVolume +// CBTRCCVolumeLevelControllerBase::GetLocalMaxVolumeL // ----------------------------------------------------------------------------- // -TInt CBTRCCVolumeLevelControllerBase::GetLocalMaxVolume() +TInt CBTRCCVolumeLevelControllerBase::GetLocalMaxVolumeL() { TRACE_FUNC - if(iLocalMaxVolume == 0) + // fetch max volume from adaptation and cache it. + CMMFDevSound* devSound = CMMFDevSound::NewL(); + iLocalMaxVolume = devSound->MaxVolume(); + TRACE_INFO((_L("Maximum volume is %d"), iLocalMaxVolume)) + delete devSound; // This is not needed for anything else. + if( iLocalMaxVolume <= 0 ) { - // fetch max volume from adaptation and cache it. - CMMFDevSound* devSound = NULL; - TRAPD( err, devSound = CMMFDevSound::NewL() ); - if(!err) - { - iLocalMaxVolume = devSound->MaxVolume(); - TRACE_INFO((_L("Maximum volume is %d"), iLocalMaxVolume)) - delete devSound; // This is not needed for anything else. - } + TRACE_INFO((_L("Error, Maximum volume value is invalid"))) + User::Leave(KErrNotSupported); } return iLocalMaxVolume; }