summaryrefslogtreecommitdiffstats
path: root/fmapp2
diff options
context:
space:
mode:
authorMingbo Zhang <mingboz@codeaurora.org>2016-02-04 17:34:26 +0800
committerArne Coucheron <arco68@gmail.com>2016-03-22 00:14:32 +0100
commit4df923ab5f5eb8f94168454850e6ad187f7f8632 (patch)
tree34728fcd5634953f8a826b75863e402dd32d57ca /fmapp2
parent1fb70c3bf4fbcc35fcbfa6ef6ef77520461e7820 (diff)
downloadandroid_hardware_qcom_fm-4df923ab5f5eb8f94168454850e6ad187f7f8632.tar.gz
android_hardware_qcom_fm-4df923ab5f5eb8f94168454850e6ad187f7f8632.tar.bz2
android_hardware_qcom_fm-4df923ab5f5eb8f94168454850e6ad187f7f8632.zip
Need to update UI in onResume though fmservice not bound
CRs-Fixed: 972557 Change-Id: I7a87f897c29b033c46e9dc3b4d9d99a0eb46e7e4
Diffstat (limited to 'fmapp2')
-rw-r--r--fmapp2/src/com/caf/fmradio/FMRadio.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index 5a0808a..ff124f7 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -531,16 +531,13 @@ public class FMRadio extends Activity
Log.d(LOGTAG, "FMRadio: onResume");
super.onResume();
- if (null == mService) {
- Log.e(LOGTAG, "FM Service is not running, returning");
- return;
- }
syncScanState();
// TODO: We should return on exception or continue?
try {
- mService.registerCallbacks(mServiceCallbacks);
+ if (mService != null)
+ mService.registerCallbacks(mServiceCallbacks);
} catch (RemoteException e) {
e.printStackTrace();
}
@@ -548,7 +545,8 @@ public class FMRadio extends Activity
if (isSleepTimerActive()) {
Log.d(LOGTAG, "isSleepTimerActive is true");
try {
- mService.cancelDelayedStop(FMRadioService.STOP_SERVICE);
+ if (mService != null)
+ mService.cancelDelayedStop(FMRadioService.STOP_SERVICE);
if(null != mSleepUpdateHandlerThread) {
mSleepUpdateHandlerThread.interrupt();
}
@@ -561,7 +559,8 @@ public class FMRadio extends Activity
if (isRecording()) {
Log.d(LOGTAG,"isRecordTimerActive is true");
try {
- mService.cancelDelayedStop(FMRadioService.STOP_RECORD);
+ if (mService != null)
+ mService.cancelDelayedStop(FMRadioService.STOP_RECORD);
} catch (Exception e) {
e.printStackTrace();
}
@@ -573,7 +572,8 @@ public class FMRadio extends Activity
// we might lose audio focus between pause and restart,
// hence request it again
try {
- mService.requestFocus();
+ if (mService != null)
+ mService.requestFocus();
} catch (Exception e) {
e.printStackTrace();
}