summaryrefslogtreecommitdiffstats
path: root/fmapp2/src/com/caf/fmradio/FMRadio.java
diff options
context:
space:
mode:
Diffstat (limited to 'fmapp2/src/com/caf/fmradio/FMRadio.java')
-rw-r--r--fmapp2/src/com/caf/fmradio/FMRadio.java30
1 files changed, 27 insertions, 3 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index 08021cc..0acbc63 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -1620,6 +1620,20 @@ public class FMRadio extends Activity
boolean bStatus = false;
if (mService != null) {
try {
+ if(mService.isSSRInProgress()) {
+ Log.e(LOGTAG, "SSR In Progress, looping");
+ while(mService.isSSRInProgress()) {
+ try
+ {
+ Thread.sleep(500);
+ } catch (InterruptedException e)
+ {
+ break;
+ }
+ }
+ Log.e(LOGTAG, "SSR done, continuing");
+ }
+
if((false == mService.isFmOn()) && isAntennaAvailable()) {
bStatus = mService.fmOn();
if(bStatus) {
@@ -1680,11 +1694,21 @@ public class FMRadio extends Activity
}
if (mService != null) {
try {
- if(bSpeakerPhoneOn) {
- mService.enableSpeaker(false);
- }
mService.fmRadioReset();
enableRadioOnOffUI(false);
+
+ Log.e(LOGTAG, "Done with reset, restarting FM");
+ /* Start Turn ON sequence again */
+ mOnOffButton.setEnabled(false);
+ mOnOffButton.setClickable(false);
+ mOnOffButton.setOnClickListener(null);
+
+ mDisableRadioHandler.removeCallbacks(mDisableRadioTask);
+ mEnableRadioHandler.removeCallbacks(mEnableRadioTask);
+ mEnableRadioHandler.postDelayed(mEnableRadioTask, 0);
+
+ cleanupTimeoutHandler();
+ Log.e(LOGTAG, "Done with restart");
}catch (RemoteException e) {
e.printStackTrace();
}