accessoryservices/accessoryserver/src/Server/AccSrvConnectionController.cpp
branchRCL_3
changeset 10 66ecddbca914
parent 9 21e939dd208a
child 12 4a5c47a50617
equal deleted inserted replaced
9:21e939dd208a 10:66ecddbca914
   759 
   759 
   760     TAccPolGenericIDArray genericIDArray;
   760     TAccPolGenericIDArray genericIDArray;
   761     TAccPolAccessoryMode accMode;
   761     TAccPolAccessoryMode accMode;
   762 
   762 
   763     iServerModel->CurrentConnectionStatusL( genericIDArray );
   763     iServerModel->CurrentConnectionStatusL( genericIDArray );
   764 
   764     
   765     if( (EFalse == aAudioOutputStatus) && (KErrUnknown != aDbId) ) 
   765     TUint count;
   766         { 
   766     TBool isHDMIConnected = EFalse;
   767         TInt index( TAccPolGenericIDArrayAccessor::FindWithUniqueIDL( 
   767     
   768                 genericIDArray, aDbId) ); 
   768     count = genericIDArray.Count();
   769 				if(KErrNotFound != index)
   769     if((1 < count) && (EFalse == aAudioOutputStatus) && (KErrUnknown != aDbId))
   770 					{
   770         {
   771         	TAccPolGenericIDArrayAccessor::RemoveIndexFromGenericIDArray(genericIDArray, index); 
   771         for(TInt i( 0 ); i < count; ++i)
   772         	}
   772             {
   773         }
   773             if(genericIDArray.GetGenericIDL(i).PhysicalConnectionCaps() & KPCHDMI)
   774 
   774                 {
   775     accMode = iPolicy->ResolveAccessoryModeL( genericIDArray, 
   775                 isHDMIConnected = ETrue;
   776                                               aDbId, 
   776                 break;
   777                                               aAudioOutputStatus, 
   777                 }        
   778                                               iServerModel->AccessoryMode(), 
   778             }
   779                                               iServerModel->UniqueID() );
   779         }
       
   780     
       
   781     if(isHDMIConnected)
       
   782         {
       
   783         accMode = iServerModel->AccessoryMode();
       
   784         }    
       
   785     else
       
   786         {
       
   787         accMode = iPolicy->ResolveAccessoryModeL( genericIDArray, 
       
   788                                                   aDbId, 
       
   789                                                   aAudioOutputStatus, 
       
   790                                                   iServerModel->AccessoryMode(), 
       
   791                                                   iServerModel->UniqueID() );
       
   792         }
       
   793 
       
   794 
       
   795     
   780 
   796 
   781     if( iServerModel->SetAccessoryMode( accMode, aDbId ) ) //Store accessory mode
   797     if( iServerModel->SetAccessoryMode( accMode, aDbId ) ) //Store accessory mode
   782         {
   798         {
   783         if( iModeHandler->IsActive() || iConnectionStatusHandler->IsActive() )
   799         if( iModeHandler->IsActive() || iConnectionStatusHandler->IsActive() )
   784             {
   800             {