FM: Fix the issue with sleep timer thread
Sleep timer is not updating after coming out from the sleep.
Interrupt the Sleep timer while onPause instead of onStop.
Change-Id: I320b16dedb4b35f7dc55b1e37fd5079f7478ac62
CRs-Fixed: 791109
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());