diff options
author | Rupesh Tatiya <rtatiya@codeaurora.org> | 2016-01-27 18:59:15 +0530 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2016-03-22 00:14:26 +0100 |
commit | 8f2d9e0c5e283e2736606ffb6536ef0be5303930 (patch) | |
tree | 37f80de0dc045d2a6d0f75f488962b7051a0b344 | |
parent | e48b2e68c31fc90c4ea5725e261f9b5756707249 (diff) | |
download | android_hardware_qcom_fm-8f2d9e0c5e283e2736606ffb6536ef0be5303930.tar.gz android_hardware_qcom_fm-8f2d9e0c5e283e2736606ffb6536ef0be5303930.tar.bz2 android_hardware_qcom_fm-8f2d9e0c5e283e2736606ffb6536ef0be5303930.zip |
Check for audio focus before enabling audio path
In scenarios where FM has lost audio focus and FM service is running, we
end up enabling FM audio path when A2DP is disconnected. This results in
more than one audio source being played simultaneously. Enable FM audio
path only when FM has audio focus.
CRs-Fixed: 967753
Change-Id: I8d5f28cb9ce3545908362e83e787fcc43394a0ac
-rw-r--r-- | fmapp2/src/com/caf/fmradio/FMRadioService.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java index 4fa919d..4e144d4 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadioService.java +++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java @@ -513,7 +513,13 @@ public class FMRadioService extends Service " mA2dpConnected:" + mA2dpConnected + " isRecordSinking" + isRecordSinking() + " mIsFMDeviceLoopbackActive:" + mIsFMDeviceLoopbackActive); + if (enable) { + if (mStoppedOnFocusLoss == true) { + Log.d(LOGTAG, "FM does not have audio focus, not enabling " + + "audio path"); + return; + } // stop existing playback path before starting new one if (mA2dpConnected && mIsFMDeviceLoopbackActive) { // on BT but earlier device loopback is active |