From b8dba8904e8a007e055a8d5cca6de36e9ae183c9 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Wed, 28 Oct 2009 17:24:53 -0700 Subject: [PATCH] Fix bug 2210203 where Music volume is reduced after reducing in-call volume. This is the combination of two issues: - on QSD8K, the voice volume affects all streams, even when not in call. This is fixed by setting the voice volume to unity gain whenever exiting a call. - another related issue was that when entering a call with no audio playing, the in-call volume would be at its max. This is due to the audio driver resetting the gain to unity when creating a new output. AudioPolicyManager::setPhoneState() would sometimes fail to force the reset of the audio volumes when entering a call, causing the driver to use the unity gain, not the in-call volume set by the user. This is fixed by testing whether is call is starting or ending independently from the logic to determine the new ouput device.