diff -r 0b192a3a05a4 -r 6a29d5ad0713 bluetoothengine/btaudioman/src/BTAccSession.cpp --- a/bluetoothengine/btaudioman/src/BTAccSession.cpp Tue Feb 02 00:20:42 2010 +0200 +++ b/bluetoothengine/btaudioman/src/BTAccSession.cpp Fri Feb 19 22:59:18 2010 +0200 @@ -27,6 +27,7 @@ #include "BTAccServer.h" #include "basrvaccman.h" #include "BTAccInfo.h" +#include "btaccpanic.h" typedef TPckgBuf TBTDevAddrPckgBuf; @@ -64,7 +65,6 @@ iNotifyProfileMsg.Complete(KErrAbort); } iProfileStatusCache.Close(); - DestructVariant(); //clear the accessory managers pointer to this session if it has one iAccMan.ClearProfileNotifySession(*this); @@ -78,7 +78,7 @@ TRACE_FUNC //use CreateL instead of NewSessionL when using Server() to ensure the //session has been created correctly and Server() returns a valid pointer - Server().ClientOpened(*this); + Server().ClientOpenedL(*this); } void CBTAccSession::ConnectCompleted(TInt aErr, TInt aProfile, const RArray* aConflicts) @@ -89,10 +89,24 @@ TRACE_INFO((_L("CBTAccSession::ConnectCompleted err %d"), aErr)) if (aConflicts) { - TBuf8 buf; + if (aErr == KErrNone) + { + //we need to error so the client knows there are conflicts which need handling + aErr = KErrGeneral; + } + + const TInt KMaxNumberOfConflicts = 2; + + TBuf8 buf; TInt count = aConflicts->Count(); + __ASSERT_DEBUG(count <= KMaxNumberOfConflicts, BTACC_PANIC(EMaxNumberOfConflictsExceeded)); + for (TInt i = 0; i < count; i++) { + if(i >= KMaxNumberOfConflicts) + { + break; //prevent descriptor overflow + } buf.Append((*aConflicts)[i].Des()); } @@ -101,10 +115,10 @@ iConnectMsg.Write(1, buf); } } - else if (!aErr) + else if (aErr == KErrNone) { TPckgBuf buf(aProfile); - iConnectMsg.Write(1, buf); + aErr = iConnectMsg.Write(1, buf); } iConnectMsg.Complete(aErr); } @@ -116,10 +130,10 @@ if (iDisconnectMsg.Handle()) { TRACE_FUNC - if (!aErr) + if (aErr == KErrNone) { TPckgBuf buf(aProfile); - iDisconnectMsg.Write(1, buf); + aErr = iDisconnectMsg.Write(1, buf); } iDisconnectMsg.Complete(aErr); } @@ -451,13 +465,6 @@ GetInfoOfConnectedAcc(aMessage); break; } - case EBTAccSrvAudioToPhone: - case EBTAccSrvAudioToAccessory: - case EBTAccSrvCancelAudioToAccessory: - { - HandleAudio4DosRequest(aMessage); - break; - } default: { PanicClient(aMessage, EBTAccBadRequest);