Merge "FM: Fix the issue with sleep timer thread" into private_master
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index 99a71f4..1e80801 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -443,9 +443,6 @@
    @Override
    public void onStop() {
       Log.d(LOGTAG, "FMRadio: onStop");
-      if(isSleepTimerActive()) {
-         mSleepUpdateHandlerThread.interrupt();
-      }
       if(isRecording()) {
           try {
               if (null != mRecordUpdateHandlerThread) {
@@ -484,6 +481,10 @@
    protected void onPause() {
       Log.d(LOGTAG, "FMRadio: onPause");
       super.onPause();
+      if (isSleepTimerActive()) {
+          Log.d(LOGTAG, "FMRadio: Sleep Timer active");
+          mSleepUpdateHandlerThread.interrupt();
+      }
       mRadioTextScroller.stopScroll();
       mERadioTextScroller.stopScroll();
       FmSharedPreferences.setTunedFrequency(mTunedStation.getFrequency());