summaryrefslogtreecommitdiffstats
path: root/fmapp2/src/com/caf/fmradio/FMRadioService.java
diff options
context:
space:
mode:
Diffstat (limited to 'fmapp2/src/com/caf/fmradio/FMRadioService.java')
-rw-r--r--fmapp2/src/com/caf/fmradio/FMRadioService.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index 8faa313..df5522d 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -402,6 +402,20 @@ public class FMRadioService extends Service
if (mReceiver.isCherokeeChip() && (mPref.getBoolean("SLIMBUS_SEQ", true))) {
enableSlimbus(ENABLE_SLIMBUS_DATA_PORT);
}
+ String status = audioManager.getParameters("fm_status");
+ Log.d(LOGTAG," FM hardwareLoopback Status = " + status);
+ if (status.contains("1")) {
+ /* This case usually happens, when FM is force killed through settings app
+ * and we don't get chance to disable Hardware LoopBack.
+ * Hardware LoopBack will be running,disable it first and enable again
+ * using routing set param to audio */
+ Log.d(LOGTAG," FM HardwareLoopBack Active, disable it first and enable again");
+ mAudioDeviceType =
+ AudioDeviceInfo.TYPE_WIRED_HEADPHONES | AudioSystem.DEVICE_OUT_FM;
+ String keyValPairs = new String("fm_routing="+mAudioDeviceType);
+ Log.d(LOGTAG, "keyValPairs = "+keyValPairs);
+ audioManager.setParameters(keyValPairs);
+ }
mIsFMDeviceLoopbackActive = true;
/*or with DEVICE_OUT_FM to support backward compatiblity*/
mAudioDeviceType = mAudioDevice | AudioSystem.DEVICE_OUT_FM;