mmsharing/mmshengine/src/musengtelephoneutils.cpp
branchRCL_3
changeset 21 33a5d2bbf6fc
parent 20 2d2c7d1515f7
child 22 73a1feb507fb
equal deleted inserted replaced
20:2d2c7d1515f7 21:33a5d2bbf6fc
    95 //
    95 //
    96 TBool CMusEngTelephoneUtils::AudioRoutingCanBeChanged() const
    96 TBool CMusEngTelephoneUtils::AudioRoutingCanBeChanged() const
    97     {
    97     {
    98     MUS_LOG( "mus: [ENGINE]  -> CMusEngTelephoneUtils::AudioRoutingCanBeChanged" )
    98     MUS_LOG( "mus: [ENGINE]  -> CMusEngTelephoneUtils::AudioRoutingCanBeChanged" )
    99     
    99     
   100     TBool retValue = ( iTelephonyAudioRouting->Output() !=
   100     TBool retValue = ( 
   101                        CTelephonyAudioRouting::EWiredAudioAccessory &&
       
   102                        iTelephonyAudioRouting->Output() !=
   101                        iTelephonyAudioRouting->Output() !=
   103                        CTelephonyAudioRouting::ETTY );
   102                        CTelephonyAudioRouting::ETTY );
   104     
   103     
   105     MUS_LOG1( "mus: [ENGINE]  <- CMusEngTelephoneUtils::AudioRoutingCanBeChanged: %d",
   104     MUS_LOG1( "mus: [ENGINE]  <- CMusEngTelephoneUtils::AudioRoutingCanBeChanged: %d",
   106               retValue )
   105               retValue )
   111 
   110 
   112 // -----------------------------------------------------------------------------
   111 // -----------------------------------------------------------------------------
   113 //
   112 //
   114 // -----------------------------------------------------------------------------
   113 // -----------------------------------------------------------------------------
   115 //
   114 //
   116 TBool CMusEngTelephoneUtils::AudioOutputIsBT() const
   115 TBool CMusEngTelephoneUtils::IsAudioRoutingHeadset() const
   117     {
   116     {
   118     MUS_LOG( "mus: [ENGINE]  -> CMusEngTelephoneUtils::AudioOutputIsBT" )
   117     MUS_LOG( "mus: [ENGINE]  -> CMusEngTelephoneUtils::IsAudioRoutingHeadset" )
   119 	    
   118 	    
   120     TBool retValue = ( iTelephonyAudioRouting->Output() ==
   119     TBool retValue = ( iTelephonyAudioRouting->Output() ==
   121                        CTelephonyAudioRouting::EBTAudioAccessory );
   120                        CTelephonyAudioRouting::EBTAudioAccessory ||
       
   121                        iTelephonyAudioRouting->Output() ==
       
   122                        CTelephonyAudioRouting::EWiredAudioAccessory );
   122 	    
   123 	    
   123     MUS_LOG1( "mus: [ENGINE]  <- CMusEngTelephoneUtils::AudioOutputIsBT: %d",
   124     MUS_LOG1( "mus: [ENGINE]  <- CMusEngTelephoneUtils::IsAudioRoutingHeadset: %d",
   124                retValue )
   125                retValue )
   125 	              
   126 	              
   126     return retValue;
   127     return retValue;
   127     }
   128     }
   128 
   129 
       
   130 // -----------------------------------------------------------------------------
       
   131 //
       
   132 // -----------------------------------------------------------------------------
       
   133 //
       
   134 TBool CMusEngTelephoneUtils::IsAudioRoutingLoudSpeaker() const
       
   135     {
       
   136     MUS_LOG( "mus: [ENGINE]  -> CMusEngTelephoneUtils::IsAudioRoutingLoudSpeaker" )
       
   137     TBool retValue = EFalse;
       
   138     
       
   139     CTelephonyAudioRouting::TAudioOutput currentMode =
       
   140                                             iTelephonyAudioRouting->Output();
       
   141     MUS_LOG1( "mus: [ENGINE] iAudioOutputAtStartup: %d", iAudioOutputAtStartup );
       
   142     MUS_LOG1( "mus: [ENGINE] currentMode: %d", currentMode );
       
   143     
       
   144     if( currentMode != iAudioOutputAtStartup && 
       
   145         currentMode == CTelephonyAudioRouting::ELoudspeaker )
       
   146     	{
       
   147     
       
   148          retValue = ETrue;
       
   149     
       
   150     	}
       
   151     	
       
   152     MUS_LOG1( "mus: [ENGINE]  <- CMusEngTelephoneUtils::IsAudioRoutingLoudSpeaker: %d",
       
   153                retValue )
       
   154 	              
       
   155     return retValue;
       
   156     }
   129 
   157 
   130 // -----------------------------------------------------------------------------
   158 // -----------------------------------------------------------------------------
   131 //
   159 //
   132 // -----------------------------------------------------------------------------
   160 // -----------------------------------------------------------------------------
   133 //
   161 //
   139     if ( aEnable )
   167     if ( aEnable )
   140         {
   168         {
   141         if ( iTelephonyAudioRouting->Output() == 
   169         if ( iTelephonyAudioRouting->Output() == 
   142              CTelephonyAudioRouting::EHandset || 
   170              CTelephonyAudioRouting::EHandset || 
   143              iTelephonyAudioRouting->Output() == 
   171              iTelephonyAudioRouting->Output() == 
   144              CTelephonyAudioRouting::EBTAudioAccessory )  
   172              CTelephonyAudioRouting::EBTAudioAccessory|| 
       
   173              iTelephonyAudioRouting->Output() == 
       
   174              CTelephonyAudioRouting::EWiredAudioAccessory )  
   145             {
   175             {
   146             // Disable note shown by audiorouting api as it causes
   176             // Disable note shown by audiorouting api as it causes
   147             // application going to background for a while. Instead, display
   177             // application going to background for a while. Instead, display
   148             // note by ourselves once setting output completes. This mechanism
   178             // note by ourselves once setting output completes. This mechanism
   149             // is needed only for loudspeaker enabling as going to background
   179             // is needed only for loudspeaker enabling as going to background