diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java index 9afd671a63453e230c7b9ed7a8299057b03f3d50..a4fce5d75a4086f71355c47856fa5d848705ea78 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadioService.java +++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java @@ -967,7 +967,8 @@ public class FMRadioService extends Service if (isFmOn() && getResources() .getBoolean(R.bool.def_headset_next_enabled)) { try { - mCallbacks.onSeekNextStation(); + if ((mServiceInUse) && (mCallbacks != null)) + mCallbacks.onSeekNextStation(); }catch (RemoteException e) { } } @@ -1066,7 +1067,8 @@ public class FMRadioService extends Service mPlaybackInProgress = true; configureAudioDataPath(true); try { - mCallbacks.onFmAudioPathStarted(); + if ((mServiceInUse) && (mCallbacks != null)) + mCallbacks.onFmAudioPathStarted(); } catch(RemoteException e) { e.printStackTrace(); } @@ -1077,7 +1079,8 @@ public class FMRadioService extends Service configureAudioDataPath(false); mPlaybackInProgress = false; try { - mCallbacks.onFmAudioPathStopped(); + if ((mServiceInUse) && (mCallbacks != null)) + mCallbacks.onFmAudioPathStopped(); } catch(RemoteException e) { e.printStackTrace(); }