FM: make disable slimbus sequance correct.
1.send disable slimbus command first.(0xfc0e with val 0)
2.inform audio (stopFM API will do this)
Change-Id: I259a0463e3302ae8bd3daa152cb0a7853a82f39e
Signed-off-by: himta ram <hram@codeaurora.org>
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index b9dc5a8..36c486b 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -1673,15 +1673,17 @@
Log.v(LOGTAG, "Focus Loss/TLoss - Disabling speaker");
AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_NONE);
}
- if (mReceiver != null && (mReceiver.isCherokeeChip()))
- mReceiver.EnableSlimbus(ENABLE_SLIMBUS_DATA_PORT);
+ if ((mReceiver != null) && mReceiver.isCherokeeChip() && (mPref.getBoolean("SLIMBUS_SEQ", true))) {
+ mEventReceived = false;
+ mReceiver.EnableSlimbus(DISABLE_SLIMBUS_DATA_PORT);
+ waitForFWEvent();
+ }
+ mStoppedOnFocusLoss = true;
+
if (true == mPlaybackInProgress) {
stopFM();
}
- if ((mReceiver != null) && mReceiver.isCherokeeChip() && (mPref.getBoolean("SLIMBUS_SEQ", true)))
- mReceiver.EnableSlimbus(DISABLE_SLIMBUS_DATA_PORT);
- mStoppedOnFocusLoss = true;
break;
case AudioManager.AUDIOFOCUS_LOSS:
Log.v(LOGTAG, "AudioFocus: received AUDIOFOCUS_LOSS mspeakerphone= " +
@@ -1691,14 +1693,17 @@
mSpeakerDisableHandler.removeCallbacks(mSpeakerDisableTask);
mSpeakerDisableHandler.postDelayed(mSpeakerDisableTask, 0);
}
+
+ //intentional fall through.
+ if (mReceiver.isCherokeeChip() && (mPref.getBoolean("SLIMBUS_SEQ", true))) {
+ mEventReceived = false;
+ mReceiver.EnableSlimbus(DISABLE_SLIMBUS_DATA_PORT);
+ waitForFWEvent();
+ }
if (true == mPlaybackInProgress) {
stopFM();
}
- //intentional fall through.
- if (mReceiver.isCherokeeChip() && (mPref.getBoolean("SLIMBUS_SEQ", true)))
- mReceiver.EnableSlimbus(DISABLE_SLIMBUS_DATA_PORT);
-
if (true == isFmRecordingOn())
stopRecording();