fm: Handle audio focus gain request denied

FM sound is not heard after rejecting MT call
as audio manager does not grant audio focus
access.Save the status of audio focus request whether
it has been accepted then accordingly handle audio focus
gain message from audio manager to route fm audio.

CRs-Fixed: 543262
Change-Id: I3391f82fd4ab2ffbcd4378920083c3fbfaec11a8
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index c7abf00..ad0458b 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -744,8 +744,13 @@
        if ( true == mPlaybackInProgress ) // no need to resend event
            return;
        AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
-       audioManager.requestAudioFocus(mAudioFocusListener, AudioManager.STREAM_MUSIC,
+       int granted = audioManager.requestAudioFocus(mAudioFocusListener, AudioManager.STREAM_MUSIC,
               AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
+       if(granted != AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
+          Log.d(LOGTAG, "audio focuss couldnot be granted");
+          return;
+       }
+
        Log.d(LOGTAG,"FM registering for registerMediaButtonEventReceiver");
        mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
        ComponentName fmRadio = new ComponentName(this.getPackageName(),