summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMingbo Zhang <mingboz@codeaurora.org>2016-03-21 10:28:18 +0800
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-04-19 20:39:51 -0700
commit220242cbb65ead86adbae29eb8e4edaf94162679 (patch)
treef156ebe5e4075dc5946e6fa05d362a85206e4003
parentc5fd4ca63281e0a46ca795e00ef9d93281d23a43 (diff)
downloadandroid_hardware_qcom_fm-220242cbb65ead86adbae29eb8e4edaf94162679.tar.gz
android_hardware_qcom_fm-220242cbb65ead86adbae29eb8e4edaf94162679.tar.bz2
android_hardware_qcom_fm-220242cbb65ead86adbae29eb8e4edaf94162679.zip
Fix null pointer exception in FMRadioService
CRs-Fixed: 992487 Change-Id: Iba131108d2b358678e4894dfedfbbf9d784c8217
-rw-r--r--fmapp2/src/com/caf/fmradio/FMRadioService.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index ff76e1d..7421d8e 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -974,7 +974,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) {
}
}
@@ -1073,7 +1074,8 @@ public class FMRadioService extends Service
mPlaybackInProgress = true;
configureAudioDataPath(true);
try {
- mCallbacks.onFmAudioPathStarted();
+ if ((mServiceInUse) && (mCallbacks != null))
+ mCallbacks.onFmAudioPathStarted();
} catch(RemoteException e) {
e.printStackTrace();
}
@@ -1084,7 +1086,8 @@ public class FMRadioService extends Service
configureAudioDataPath(false);
mPlaybackInProgress = false;
try {
- mCallbacks.onFmAudioPathStopped();
+ if ((mServiceInUse) && (mCallbacks != null))
+ mCallbacks.onFmAudioPathStopped();
} catch(RemoteException e) {
e.printStackTrace();
}