am b83abf76: am 5323940b: Merge "[FM] There is no sound output after resuming playing when FM is over BT" into lmp-mr1-dev
* commit 'b83abf7618010cd8ac8e5038f67fe61ab50e5e7b':
[FM] There is no sound output after resuming playing when FM is over BT
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 @@
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) {