From 454dd9e1aca4bbe8c341cc23da11c7ff906cab6f Mon Sep 17 00:00:00 2001 From: Satish Kodishala Date: Thu, 20 Nov 2014 15:34:46 +0530 Subject: FM: Auto turn ON FM after WCNSS SSR After WCNSS SSR, auto turn ON FM from FM app. CRs-fixed: 749400 Change-Id: I9dfa0d9bae621658fdaea2f4ff87f290f748f9b1 --- fmapp2/src/com/caf/fmradio/FMRadio.java | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'fmapp2/src/com/caf/fmradio/FMRadio.java') 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(); } -- cgit v1.2.3