diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2014-11-26 18:30:31 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-11-26 18:30:31 -0800 |
commit | 55e2fbfa99151ef2bebe7dcefd2ce1ed8ebda3b3 (patch) | |
tree | 1b59443d79340f0bf10407fd7d1680ecdd945bab | |
parent | b3eeee2f4612855ab7ec223547f55513d6fab6df (diff) | |
parent | 3f4530670ff55610de448f5b5d72cd0461b2d789 (diff) | |
download | android_hardware_qcom_fm-55e2fbfa99151ef2bebe7dcefd2ce1ed8ebda3b3.tar.gz android_hardware_qcom_fm-55e2fbfa99151ef2bebe7dcefd2ce1ed8ebda3b3.tar.bz2 android_hardware_qcom_fm-55e2fbfa99151ef2bebe7dcefd2ce1ed8ebda3b3.zip |
Merge "FM: Fix the issue with MO call and Mute concurrency"
-rw-r--r-- | fmapp2/src/com/caf/fmradio/FMRadioService.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java index db88c37..9154c26 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadioService.java +++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java @@ -177,6 +177,8 @@ public class FMRadioService extends Service static final int RECORD_START = 1; static final int RECORD_STOP = 0; private Thread mRecordServiceCheckThread = null; + private boolean mUnMuteOnFocusLoss = false; + private boolean mSpeakerOnFocusLoss = false; public FMRadioService() { } @@ -832,6 +834,8 @@ public class FMRadioService extends Service } sendRecordServiceIntent(RECORD_START); mPlaybackInProgress = true; + mUnMuteOnFocusLoss = false; + mSpeakerOnFocusLoss = false; } private void stopFM(){ @@ -1057,7 +1061,14 @@ public class FMRadioService extends Service if((TelephonyManager.CALL_STATE_OFFHOOK == state)|| (TelephonyManager.CALL_STATE_RINGING == state)) { - boolean bTempSpeaker = mSpeakerPhoneOn; //need to restore SpeakerPhone + boolean bTempSpeaker = (mSpeakerPhoneOn | mSpeakerOnFocusLoss) ; //need to restore SpeakerPhone + if (mUnMuteOnFocusLoss) { + if (audioManager != null) { + Log.d(LOGTAG, "Mute"); + mMuted = true; + audioManager.setStreamMute(AudioManager.STREAM_MUSIC,true); + } + } boolean bTempMute = mMuted;// need to restore Mute status int bTempCall = mCallStatus;//need to restore call status if (isFmOn() && fmOff()) { @@ -1185,10 +1196,13 @@ public class FMRadioService extends Service if (mSpeakerPhoneOn) { mSpeakerDisableHandler.removeCallbacks(mSpeakerDisableTask); mSpeakerDisableHandler.postDelayed(mSpeakerDisableTask, 0); + mSpeakerOnFocusLoss = true; } if (true == mPlaybackInProgress) { - if(mMuted) + if(mMuted) { unMute(); + mUnMuteOnFocusLoss = true; + } stopFM(); } if (mSpeakerPhoneOn) { |