FM: ignore restore factory defaults when FM is turned Off
add fm state check before calling FM Disable.
FM Off operation to be performed only when
there is FM Session running.
CRs-Fixed: 2407943
Change-Id: Ib8612e3163d7c570c5dff8f9fcff7e9c2b7151d4
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index 4ba78b4..54baa12 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -905,7 +905,8 @@
if (data != null) {
String action = data.getAction();
if (action != null) {
- if (action.equals(Settings.RESTORE_FACTORY_DEFAULT_ACTION)) {
+ if ((action.equals(Settings.RESTORE_FACTORY_DEFAULT_ACTION))
+ && (true == isFmOn())) {
disableRadio();
RestoreDefaults();
FmSharedPreferences.setTunedFrequency(FmSharedPreferences.DEFAULT_NO_FREQUENCY);