diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java index ceaa022de44d49b1326952c29cbfbd822e038f46..a178548c6a7e5ec16c2e56bbdaedf34b50cdb34b 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadioService.java +++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java @@ -742,8 +742,10 @@ public class FMRadioService extends Service Log.d(LOGTAG, "Music Service command : "+cmd+ " received"); if (cmd != null && cmd.equals("pause")) { if (isFmOn()) { - fmOperationsOff(); - mStoppedOnFocusLoss = true; + AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); + audioManager.abandonAudioFocus(mAudioFocusListener); + mDelayedStopHandler.obtainMessage(FOCUSCHANGE, AudioManager.AUDIOFOCUS_LOSS, 0).sendToTarget(); + if (isOrderedBroadcast()) { abortBroadcast(); }