Fm: add null check for Receiver before issuing command
this case happens where call is active and fm is stopped,
soon after this if onAudioFocusChange dispatch to fm, then
while handling focus change we should issue command only
if Receiver is available.
CRs-Fixed: 2479379
Change-Id: I0d950dfc27a87c588c0fe0367c914cab5c06555d
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index 980a709..8d261eb 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -2171,10 +2171,13 @@
private boolean enableSlimbus(int flag) {
Log.d(LOGTAG, "enableSlimbus");
boolean bStatus = false;
- // Send command to enable FM core
- mEventReceived = false;
- mReceiver.EnableSlimbus(flag);
- bStatus = waitForFWEvent();
+ if (mReceiver != null)
+ {
+ // Send command to enable/disable FM core
+ mEventReceived = false;
+ mReceiver.EnableSlimbus(flag);
+ bStatus = waitForFWEvent();
+ }
return bStatus;
}