alsa_sound: Remove pcm stream close for flushing buffers
- Currently pcm stream is closed to flush buffers while switching
between speaker+headset combo device and headset device.
- Fix this problem by removing unnecessary pcm stream close.
Bug-id: 7051374
Change-Id: Id2faaeadd2a8e009f67e85beee42bbfe47b959f4
diff --git a/alsa_sound/AudioHardwareALSA.cpp b/alsa_sound/AudioHardwareALSA.cpp
index f33ef9f..6a88074 100644
--- a/alsa_sound/AudioHardwareALSA.cpp
+++ b/alsa_sound/AudioHardwareALSA.cpp
@@ -612,29 +612,9 @@
break;
}
}
- } else
+ } else
#endif
- if((((mCurDevice & AudioSystem::DEVICE_OUT_WIRED_HEADSET) ||
- (mCurDevice & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE)) &&
- (mCurDevice & AudioSystem::DEVICE_OUT_SPEAKER) &&
- ((device & AudioSystem::DEVICE_OUT_WIRED_HEADSET) ||
- (device & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE))) ||
- (((device & AudioSystem::DEVICE_OUT_WIRED_HEADSET) ||
- (device & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE)) &&
- (device & AudioSystem::DEVICE_OUT_SPEAKER) &&
- ((mCurDevice & AudioSystem::DEVICE_OUT_WIRED_HEADSET) ||
- (mCurDevice & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE)))) {
- for(ALSAHandleList::iterator it = mDeviceList.begin();
- it != mDeviceList.end(); ++it) {
- if((!strncmp(it->useCase, SND_USE_CASE_VERB_HIFI,
- strlen(SND_USE_CASE_VERB_HIFI))) ||
- (!strncmp(it->useCase, SND_USE_CASE_MOD_PLAY_MUSIC,
- strlen(SND_USE_CASE_MOD_PLAY_MUSIC)))) {
- mALSADevice->route(&(*it),(uint32_t)device, newMode);
- break;
- }
- }
- } else {
+ {
ALSAHandleList::iterator it = mDeviceList.end();
it--;
mALSADevice->route(&(*it), (uint32_t)device, newMode);
@@ -1059,7 +1039,7 @@
ALOGD("Starting recording in openoutputstream, musbRecordingState: %d", musbRecordingState);
startUsbRecordingIfNotStarted();
musbRecordingState |= USBRECBIT_VOIPCALL;
- }else
+ } else
#endif
{
mALSADevice->route(&(*it),mCurDevice, AudioSystem::MODE_IN_COMMUNICATION);