summaryrefslogtreecommitdiffstats
path: root/fmapp2/src/com/caf/fmradio
diff options
context:
space:
mode:
Diffstat (limited to 'fmapp2/src/com/caf/fmradio')
-rw-r--r--fmapp2/src/com/caf/fmradio/FMRadio.java14
-rw-r--r--fmapp2/src/com/caf/fmradio/FMRadioService.java9
-rw-r--r--fmapp2/src/com/caf/fmradio/IFMRadioService.aidl1
3 files changed, 24 insertions, 0 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index 6f3f291..d26a0cd 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -516,9 +516,23 @@ public class FMRadio extends Activity
}
}
+ private void syncScanState() {
+ if (!mIsScaning || mService == null) {
+ return;
+ }
+ try {
+ if (!mService.isSearchInProgress()) {
+ resetSearch();
+ }
+ }catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
@Override
public void onResume() {
super.onResume();
+ syncScanState();
try {
if(mService != null) {
mService.registerCallbacks(mServiceCallbacks);
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index c7f2b01..d8c0fea 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -1977,6 +1977,10 @@ public class FMRadioService extends Service
{
return(mService.get().isA2DPConnected());
}
+ public boolean isSearchInProgress()
+ {
+ return(mService.get().isSearchInProgress());
+ }
}
private final IBinder mBinder = new ServiceStub(this);
@@ -2209,6 +2213,11 @@ public class FMRadioService extends Service
return(bStatus);
}
+ public boolean isSearchInProgress() {
+ int state = mReceiver.getFMState();
+ return state == qcom.fmradio.FmTransceiver.FMState_Srch_InProg;
+ }
+
public boolean isSSRInProgress() {
return mIsSSRInProgress;
}
diff --git a/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl b/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl
index a02c593..0b26459 100644
--- a/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl
+++ b/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl
@@ -75,5 +75,6 @@ interface IFMRadioService
boolean isSSRInProgress();
boolean isRtPlusSupported();
boolean isA2DPConnected();
+ boolean isSearchInProgress();
}