FM: retune last frequency when resume after call
FM Activity may not available to send down frequency again
after phone call. Then FM service need retune saved frequency.
Change-Id: I26f0921bd8878331c3dedc6e8ff96873dd5a84a6
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index 6ade23f..39ae154 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -143,6 +143,7 @@
private int mServiceStartId = -1;
private boolean mServiceInUse = false;
private static boolean mMuted = false;
+ private static int mFreq = 0;
private static boolean mResumeAfterCall = false;
private static int mAudioDevice = AudioDeviceInfo.TYPE_WIRED_HEADPHONES;
MediaRecorder mRecorder = null;
@@ -1464,6 +1465,8 @@
} catch (RemoteException e) {
e.printStackTrace();
}
+ } else if (mFreq > 0) {
+ tune(mFreq);
}
}
}
@@ -2728,6 +2731,7 @@
{
mReceiver.setStation(frequency);
bCommandSent = true;
+ mFreq = frequency;
}
return bCommandSent;
}