diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2019-01-12 01:48:05 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-01-12 01:48:05 -0800 |
commit | 08a9d182ce8f6e5ecca1d6b852fb16c1326d8375 (patch) | |
tree | ba3097e7bbfdedfdff52117bd0b9d24989741833 | |
parent | c65cc46a7baacb2b75c0acd8b017ee354db79052 (diff) | |
parent | 046d5c37ae18857c726145b1cd3545a69f8dd033 (diff) | |
download | android_hardware_qcom_fm-08a9d182ce8f6e5ecca1d6b852fb16c1326d8375.tar.gz android_hardware_qcom_fm-08a9d182ce8f6e5ecca1d6b852fb16c1326d8375.tar.bz2 android_hardware_qcom_fm-08a9d182ce8f6e5ecca1d6b852fb16c1326d8375.zip |
Merge "FM: Ignore VOLUME_CHANGED_ACTION intent when fm is turned off."
-rw-r--r-- | fmapp2/src/com/caf/fmradio/FMRadioService.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java index df5522d..2273f3c 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadioService.java +++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java @@ -143,7 +143,7 @@ public class FMRadioService extends Service private boolean mServiceInUse = false; private static boolean mMuted = false; private static boolean mResumeAfterCall = false; - private static int mAudioDevice = 0; + private static int mAudioDevice = AudioDeviceInfo.TYPE_WIRED_HEADPHONES; MediaRecorder mRecorder = null; MediaRecorder mA2dp = null; private boolean mFMOn = false; @@ -598,6 +598,10 @@ public class FMRadioService extends Service stopRecording(); } } else if( action.equals(AudioManager.VOLUME_CHANGED_ACTION)) { + if(!isFmOn()) { + Log.d(LOGTAG, "FM is Turned off ,not applying the changed volume"); + return; + } int streamType = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1); if (streamType == AudioManager.STREAM_MUSIC) { |