bluetoothengine/btaudioman/src/basrvaccman.cpp
branchRCL_3
changeset 61 269724087bed
parent 56 9386f31cc85b
equal deleted inserted replaced
56:9386f31cc85b 61:269724087bed
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  Implementation of an accessory management.
    14 * Description:  Implementation of an accessory management.
    15 *  Version     : %version:  14.1.11 %
    15 *  Version     : %version:  14.1.12 %
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
   617         });
   617         });
   618 
   618 
   619     TInt idx = FindAcc(aAddr);
   619     TInt idx = FindAcc(aAddr);
   620     if (idx >= 0)
   620     if (idx >= 0)
   621         {
   621         {
   622         // Check if another audio link opened already
   622         TInt audiolinks = AudioLinkStatus();        
   623         TInt audiolinks = AudioLinkStatus();
   623         if ( audiolinks && audiolinks != aProfile) 
   624         
   624             {
   625         if ( ( audiolinks && audiolinks != aProfile) || 
   625             TRACE_INFO((_L(" [global audio link check] existing audio link %x. Audio should be rejected!"),
   626             ( iAudioRequests.Count() && 
       
   627               iAudioRequests[0].iOngoing && 
       
   628               iAudioRequests[0].iAddr == aAddr) )
       
   629             {
       
   630             // another audio type is opened while we have an audio link or pending audio request.
       
   631             if (iAudioRequests.Count())
       
   632                 {
       
   633                 TRACE_INFO((_L(" [audio link check] existing audio link %x, audio request pending ? %d. Audio should be rejected!"),
       
   634                         audiolinks, iAudioRequests[0].iOngoing))
       
   635                 }
       
   636             else
       
   637                 {
       
   638                 TRACE_INFO((_L(" [audio link check] existing audio link %x. Audio should be rejected!"),
       
   639                         audiolinks))
   626                         audiolinks))
   640                 }
       
   641             RejectAudioLink(aAddr, (aProfile == EStereo) ? EAccStereoAudio : EAccMonoAudio);
   627             RejectAudioLink(aAddr, (aProfile == EStereo) ? EAccStereoAudio : EAccMonoAudio);
       
   628             }
       
   629         else if ( iAudioRequests.Count() && 
       
   630                 iAudioRequests[0].iReqType == EOpenReqFromAudioPolicy &&
       
   631                 iAudioRequests[0].iAudioType == ((aProfile == EStereo) ? EAccStereoAudio : EAccMonoAudio) &&
       
   632                 iAudioRequests[0].iOngoing && 
       
   633                 iAudioRequests[0].iAddr == aAddr)
       
   634             {
       
   635             TRACE_INFO((_L(" [device-specific audio request check] audio request pending ? %d. Audio request should be cancelled!"),
       
   636                     iAudioRequests[0].iOngoing))
       
   637             iAccs[idx]->CancelOpenAudio();
   642             }
   638             }
   643         else
   639         else
   644             {
   640             {
   645             iAccs[idx]->AccOpenedAudio(aProfile);
   641             iAccs[idx]->AccOpenedAudio(aProfile);
   646             }
   642             }