alsa_sound: fix watchdog error issue
- Issue happens when pcm_open fails after routing is done.
- Currently HAL returns zero bytes when pcm_open fails,
Return actual bytes so that audioflinger can drop the buffer.
Bug-id: 7253359
Change-Id: I5d989539b0f9252577dc81a3ba34d467758bf717
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/alsa_sound/AudioStreamOutALSA.cpp b/alsa_sound/AudioStreamOutALSA.cpp
index c9ea6b5..49c0581 100644
--- a/alsa_sound/AudioStreamOutALSA.cpp
+++ b/alsa_sound/AudioStreamOutALSA.cpp
@@ -185,7 +185,7 @@
if(mHandle->handle == NULL) {
ALOGE("write:: device open failed");
mParent->mLock.unlock();
- return 0;
+ return bytes;
}
#ifdef QCOM_USBAUDIO_ENABLED
if((mHandle->devices == AudioSystem::DEVICE_IN_ANLG_DOCK_HEADSET)||