summaryrefslogtreecommitdiffstats
path: root/core/jni/android_media_ToneGenerator.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-11-04 08:27:26 -0800
committerEric Laurent <elaurent@google.com>2009-11-04 23:47:21 -0800
commitbda7469d9b1ec6d9c9d6da40ddf64dc39ff271a9 (patch)
treeb89b73e6feeadefb4ad958c0359789cf0ae5b90f /core/jni/android_media_ToneGenerator.cpp
parente1e0dc8e6eaec052ebb6b88f5b1223075ce5a356 (diff)
downloadframeworks_base-bda7469d9b1ec6d9c9d6da40ddf64dc39ff271a9.zip
frameworks_base-bda7469d9b1ec6d9c9d6da40ddf64dc39ff271a9.tar.gz
frameworks_base-bda7469d9b1ec6d9c9d6da40ddf64dc39ff271a9.tar.bz2
Fix issue 2203561: Sholes: audio playing out of earpiece.
Create a new IAudioTrack interface to AudioFlinger when start() fails due to a broken pipe error. Do the same if start fails due to the same error after time out in obtainBuffer(). Do not indicate that the AudioTrack is started to AudioPolicyManager if IAudioTrack start fails. This avoids that an AudioTrack keeps a dead IAudioTrack after a media server crash. Same modifications for AudioRecord. Add a flag to ToneGenerator indicating that the callback thread can call Java. Without it, when the media server crashes and restarts, the AudioSystem error callback will crash in JNI if the IAudiotrack is created from AudioTrack callback thread.
Diffstat (limited to 'core/jni/android_media_ToneGenerator.cpp')
-rw-r--r--core/jni/android_media_ToneGenerator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/jni/android_media_ToneGenerator.cpp b/core/jni/android_media_ToneGenerator.cpp
index 07bb1ab..50aa967 100644
--- a/core/jni/android_media_ToneGenerator.cpp
+++ b/core/jni/android_media_ToneGenerator.cpp
@@ -79,7 +79,7 @@ static void android_media_ToneGenerator_release(JNIEnv *env, jobject thiz) {
static void android_media_ToneGenerator_native_setup(JNIEnv *env, jobject thiz,
jint streamType, jint volume) {
- ToneGenerator *lpToneGen = new ToneGenerator(streamType, AudioSystem::linearToLog(volume));
+ ToneGenerator *lpToneGen = new ToneGenerator(streamType, AudioSystem::linearToLog(volume), true);
env->SetIntField(thiz, fields.context, 0);