Fix bug 2721016
The AudioPolicyManager for MSM8K overrides the stream volume computation
even if the volume index is set to minimum, which prevents the system
from ever muting a stream in the car dock.
The change consists in comparing the new volume index against the
minimum authorized index for that stream and if they are equal,
not override the platform's volume computation.

Change-Id: Id3990a3d771d2adb40df56d1b4ee2ddfb37c428d
diff --git a/libaudio-qsd8k/AudioPolicyManager.cpp b/libaudio-qsd8k/AudioPolicyManager.cpp
index 82289bf..51d6a93 100644
--- a/libaudio-qsd8k/AudioPolicyManager.cpp
+++ b/libaudio-qsd8k/AudioPolicyManager.cpp
@@ -235,6 +235,13 @@
 
 float AudioPolicyManager::computeVolume(int stream, int index, audio_io_handle_t output, uint32_t device)
 {
+    // if requested volume index is the minimum possible value, we must honor this value as this
+    // means the stream is muted. This overrides condition-specific modifications to the volume
+    // computed in the generic APM
+    if (index == mStreams[stream].mIndexMin) {
+        return AudioPolicyManagerBase::computeVolume(stream, index, output, device);
+    }
+
     // force volume on A2DP output to maximum if playing through car dock speakers
     // as volume is applied on the car dock and controlled via car dock keys.
 #ifdef WITH_A2DP