Skip to content
Snippets Groups Projects
Commit dd027a39 authored by himta ram's avatar himta ram
Browse files

FM: make correct sequence of slimbus and audio port

 -in case of fm on sequence
   1. enable slimbus.
   2. open port at audio side.
   3. enable fm receiver.

 -in case of other than fm on scenarios where fm
  receiver is already enabled and audio
  path needs to start.
   1. open port at audio side.
   2. enable slimbus.

 -in case of other than fm on scenarios where fm
  receiver is already enabled and audio
  path needs to stop.
  1. disable slimbus
  2. close port at audio side.

CRs-Fixed: 2372708

Change-Id: I8e242b7f86248ce1ffa864d1e800e75426dbf153
parent 20f89716
Branches
No related tags found
No related merge requests found
......@@ -399,9 +399,6 @@ public class FMRadioService extends Service
"or Already devcie loop back is acive, not enabling audio");
return false;
}
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")) {
......@@ -839,6 +836,9 @@ public class FMRadioService extends Service
if (isFmOn()) {
setLowPowerMode(false);
startFM();
if (mReceiver.isCherokeeChip() && (mPref.getBoolean("SLIMBUS_SEQ", true))) {
enableSlimbus(ENABLE_SLIMBUS_DATA_PORT);
}
}
}
......@@ -1606,8 +1606,13 @@ public class FMRadioService extends Service
break;
}
if(false == mPlaybackInProgress)
if(false == mPlaybackInProgress) {
startFM();
if (mReceiver.isCherokeeChip() &&
(mPref.getBoolean("SLIMBUS_SEQ", true))) {
enableSlimbus(ENABLE_SLIMBUS_DATA_PORT);
}
}
mSession.setActive(true);
break;
default:
......@@ -2377,6 +2382,9 @@ public class FMRadioService extends Service
else
{
if (mReceiver.isCherokeeChip()) {
if (mPref.getBoolean("SLIMBUS_SEQ", true)) {
enableSlimbus(ENABLE_SLIMBUS_DATA_PORT);
}
bStatus = fmTurnOnSequenceCherokee();
} else {
bStatus = fmTurnOnSequence();
......@@ -2397,10 +2405,6 @@ public class FMRadioService extends Service
if(audioManager != null)
{
Log.d(LOGTAG, "audioManager.setFmRadioOn = false \n" );
if ((mReceiver != null) && mReceiver.isCherokeeChip() &&
(mPref.getBoolean("SLIMBUS_SEQ", true))) {
enableSlimbus(DISABLE_SLIMBUS_DATA_PORT);
}
stopFM();
unMute();
// If call is active, we will use audio focus to resume fm after call ends.
......@@ -3996,6 +4000,9 @@ public class FMRadioService extends Service
audioManager.requestAudioFocus(mAudioFocusListener, AudioManager.STREAM_MUSIC,
AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
startFM();
if (mReceiver.isCherokeeChip() && (mPref.getBoolean("SLIMBUS_SEQ", true))) {
enableSlimbus(ENABLE_SLIMBUS_DATA_PORT);
}
mStoppedOnFocusLoss = false;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment