FM: Abandon focus if FM has failed to start
Abandon focus if FM has failed to start while It had
already requested the focus before starting.
Change-Id: I1ba2bcce2336b373e68568f3340af4cfe48d58a3
CRs-fixed: 2121825
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index 6f0c3a6..f36b163 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -2358,6 +2358,8 @@
// failure of enable can be because handle
// already open which gets effected if
// we disable
+ AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
+ audioManager.abandonAudioFocus(mAudioFocusListener);
stop();
}
@@ -2447,6 +2449,7 @@
// failure of enable can be because handle
// already open which gets effected if
// we disable
+ audioManager.abandonAudioFocus(mAudioFocusListener);
stop();
}