@ -905,28 +905,29 @@ static int select_devices(struct audio_device *adev,
}
active_out = ( struct stream_out * ) usecase - > stream ;
if ( usecase - > type = = VOICE_CALL ) {
out_snd_device = get_output_snd_device ( adev , active_out - > devices ) ;
prepare_voice_session ( adev - > voice . session , active_out - > devices ) ;
in_snd_device = get_input_snd_device ( adev , active_out - > devices ) ;
usecase - > devices = active_out - > devices ;
} else {
/*
* If the voice call is active , use the sound devices of voice call usecase
* so that it would not result any device switch . All the usecases will
* be switched to new device when select_devices ( ) is called for voice call
* usecase .
*/
if ( adev - > voice . in_call ) {
if ( usecase - > type ! = VOICE_CALL & & adev - > voice . in_call ) {
vc_usecase = get_usecase_from_id ( adev , USECASE_VOICE_CALL ) ;
if ( usecase = = NULL ) {
if ( vc_ usecase = = NULL ) {
ALOGE ( " %s: Could not find the voice call usecase " , __func__ ) ;
} else {
in_snd_device = vc_usecase - > in_snd_device ;
out_snd_device = vc_usecase - > out_snd_device ;
}
}
if ( usecase - > type = = PCM_PLAYBACK ) {
if ( usecase - > type = = VOICE_CALL ) {
usecase - > devices = active_out - > devices ;
prepare_voice_session ( adev - > voice . session , active_out - > devices ) ;
out_snd_device = get_output_snd_device ( adev , active_out - > devices ) ;
in_snd_device = get_input_snd_device ( adev , active_out - > devices ) ;
} else if ( usecase - > type = = PCM_PLAYBACK ) {
usecase - > devices = active_out - > devices ;
in_snd_device = SND_DEVICE_NONE ;
if ( out_snd_device = = SND_DEVICE_NONE ) {
@ -949,7 +950,6 @@ static int select_devices(struct audio_device *adev,
}
}
}
}
if ( out_snd_device = = usecase - > out_snd_device & &
in_snd_device = = usecase - > in_snd_device ) {