From dc2b08fd2a0b54c1bebbd7ec1043892555a1fb61 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 13 Nov 2009 02:57:12 -0800 Subject: [PATCH] Fix issue 2245963: incoming call rings in ringtone-volume level through a wired headset is while listening to music. When the ringtone is not looped (non factory ringtone), a new AudioTrack is started every time the ringtone is repeated. The second time the track is started, the condition that triggers volume limitation is not true any more as music has been stopped for more than SONIFICATION_HEADSET_MUSIC_DELAY seconds and ringtone volume is not limited. The fix consists in checking the condition (music playing or stopped for less than SONIFICATION_HEADSET_MUSIC_DELAY) when entering ringtone mode and latch it until we exit ringtone mode.