Bug 1105452 - Need to use new Audio system APIs for audio offload playback. r=roc, r=jld, r=ggrisco

Resolve the build failure caused by API changes

There are some changes in Audio APIs in Android version
21. Modifying the code to use the new APIs.

Change-Id: I24fdeb20f8f957d05fb6c0c317de0a6f0769c347

Resolve seccomp violation caused by syscall 256

Modify the filter to allow syscall 256 (set_tid_address).

Change-Id: I49461770c4c5e70bf68462d34321381b0b7ead0a
This commit is contained in:
Jay Wang 2014-12-02 17:10:00 -05:00
parent a3489c7de6
commit 32debb7f9a
2 changed files with 10 additions and 0 deletions

View File

@ -77,8 +77,13 @@ AudioOffloadPlayer::AudioOffloadPlayer(MediaOmxCommonDecoder* aObserver) :
#endif
CHECK(aObserver);
#if ANDROID_VERSION >= 21
mSessionId = AudioSystem::newAudioUniqueId();
AudioSystem::acquireAudioSessionId(mSessionId, -1);
#else
mSessionId = AudioSystem::newAudioSessionId();
AudioSystem::acquireAudioSessionId(mSessionId);
#endif
mAudioSink = new AudioOutput(mSessionId,
IPCThreadState::self()->getCallingUid());
}
@ -86,7 +91,11 @@ AudioOffloadPlayer::AudioOffloadPlayer(MediaOmxCommonDecoder* aObserver) :
AudioOffloadPlayer::~AudioOffloadPlayer()
{
Reset();
#if ANDROID_VERSION >= 21
AudioSystem::releaseAudioSessionId(mSessionId, -1);
#else
AudioSystem::releaseAudioSessionId(mSessionId);
#endif
}
void AudioOffloadPlayer::SetSource(const sp<MediaSource> &aSource)

View File

@ -244,6 +244,7 @@ SandboxFilterImplContent::Build() {
Allow(SYSCALL(sched_setparam));
Allow(SYSCALL(sigaltstack));
Allow(SYSCALL(pipe));
Allow(SYSCALL(set_tid_address));
/* Always last and always OK calls */
/* Architecture-specific very infrequently used syscalls */