fm: stop recording on transient audio focus loss
When another media session starts, we receive the
AUDIOFOCUS_LOSS_TRANSIENT. We need to stop fm and fm recording as
another media session starts.
Change-Id: Iab1ffb1f75b9704c77c408f335ec959ec11e767e
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index 80f800c..82c029c 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -1574,10 +1574,12 @@
return;
}
switch (msg.arg1) {
- case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
- Log.v(LOGTAG, "AudioFocus: received AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK");
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
Log.v(LOGTAG, "AudioFocus: received AUDIOFOCUS_LOSS_TRANSIENT");
+ if (true == isFmRecordingOn())
+ stopRecording();
+ case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
+ Log.v(LOGTAG, "AudioFocus: received AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK");
if (true == mPlaybackInProgress) {
stopFM();
mStoppedOnFocusLoss = true;