summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-09-13 11:18:23 -0700
committerEric Laurent <elaurent@google.com>2012-09-13 17:03:00 -0700
commit896adcd3ae6a1c7010e526327eff54e16179987b (patch)
tree8c999b21698b1b7b45ac1d290ef3c64c808f380d /media/libmedia
parent4362f5300162ed55f56cf167eccf7f2e5b89d435 (diff)
downloadframeworks_av-896adcd3ae6a1c7010e526327eff54e16179987b.zip
frameworks_av-896adcd3ae6a1c7010e526327eff54e16179987b.tar.gz
frameworks_av-896adcd3ae6a1c7010e526327eff54e16179987b.tar.bz2
audioflinger: send priority request from a thread
When creating a fast AudioTrack, a request is sent to SchedulingPolicyService to elevate the requesting thread priority. This generates a binder call into system_server process and to a JAVA service via JNI. If the thread from which the track was created is in the system_server process and does not have the "can call java" attribute, a crash occurs because the binder optimization reuses the same thread to process the returning binder call and no JNI env is present. The fix consists in sending the priority change request from the AudioFlinger mixer thread, not from the binder thread. This also reverts the workaround in commit 73431968 Bug 7126707. Change-Id: I3347adf71ffbb56ed8436506d4357eab693078a3
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/AudioTrack.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index d9d8aee..362d022 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -279,8 +279,7 @@ status_t AudioTrack::set(
mCbf = cbf;
if (cbf != NULL) {
- //FIXME ignoring threadCanCallJava to work around track recreation issue
- mAudioTrackThread = new AudioTrackThread(*this, true /*threadCanCallJava*/);
+ mAudioTrackThread = new AudioTrackThread(*this, threadCanCallJava);
mAudioTrackThread->run("AudioTrack", ANDROID_PRIORITY_AUDIO, 0 /*stack*/);
}