diff options
author | Benson Huang <benson.huang@mediatek.com> | 2015-01-28 14:35:47 +0800 |
---|---|---|
committer | Nicholas Sauer <nicksauer@google.com> | 2015-01-28 23:10:22 +0000 |
commit | 44c2adb10bb88f0cecad35787789d0b212a6dda3 (patch) | |
tree | bdcb4aa98d7dace68c3f86cee04d120592d3277a /src/com/android/fmradio/FmService.java | |
parent | 31fe68d90c5c218aca1969d61052db24d8f2362c (diff) | |
download | android_packages_apps_FMRadio-44c2adb10bb88f0cecad35787789d0b212a6dda3.tar.gz android_packages_apps_FMRadio-44c2adb10bb88f0cecad35787789d0b212a6dda3.tar.bz2 android_packages_apps_FMRadio-44c2adb10bb88f0cecad35787789d0b212a6dda3.zip |
[FM] There is no sound output after resuming playing when FM is over BT
Launch FM radio and play -> Stop FM -> Turn on BT and connect with BT
earphone with A2DP -> Open FM and resume playing, there is no sound
output after step 4.
Bug 19171819
from: https://partner-android-review.googlesource.com/#/c/199683/
Change-Id: I01d3975387840d9356c6f80d1f411eeb8526f930
Signed-off-by: Benson Huang <benson.huang@mediatek.com>
Diffstat (limited to 'src/com/android/fmradio/FmService.java')
-rw-r--r-- | src/com/android/fmradio/FmService.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/com/android/fmradio/FmService.java b/src/com/android/fmradio/FmService.java index c00e8cf..7f2ef78 100644 --- a/src/com/android/fmradio/FmService.java +++ b/src/com/android/fmradio/FmService.java @@ -385,19 +385,16 @@ public class FmService extends Service implements FmRecorder.OnRecorderStateChan private synchronized void startRender() { Log.d(TAG, "startRender " + AudioSystem.getForceUse(FOR_PROPRIETARY)); - // Stop old AudioRecord and create a new AudioRecord - // when plugging out and then plugging in wired headset. - // Otherwise, reading data from old AudioRecord will be blocked. - if (AudioSystem.getForceUse(FOR_PROPRIETARY) == - AudioSystem.FORCE_SPEAKER && mIsSpeakerUsed) { - if (mAudioRecord != null) { - mAudioRecord.stop(); - } - if (mAudioTrack != null) { - mAudioTrack.stop(); - } - initAudioRecordSink(); - } + + // need to create new audio record and audio play back track, + // because input/output device may be changed. + if (mAudioRecord != null) { + mAudioRecord.stop(); + } + if (mAudioTrack != null) { + mAudioTrack.stop(); + } + initAudioRecordSink(); mIsRender = true; synchronized (mRenderLock) { |