The problem comes from a deadlock with AudioPolicyService mutex: When the second ringtone starts,
this mutex is locked by AudioPolicyService::startOutput() which in turn calls setParameters() to change the output device.
Audioflinger::ThreadBase::setParameters() signals the parameter change to the AudioFlinger mixer thread and waits for a condition
indicating that the parameter change has been processed.
At the same time, the mixer thread detects that the audio track corresponding to the first ring tone has been killed and calls its destructor.
This calls AudioPolicyService::releaseOutput() which tries to lock the AudioPolicyService mutex.
If this happens before the mixer thread can process the setParameters() command we are deadlocked.
The deadlock ends because setParameters() uses a timeout when waiting for the condition.
This regression was introduced by change 33736 fixing issue 2265163.
The fix consists in calling AudioPolicyService::releaseOutput() from Track::destroy() instead of from Track destructor: as detroy() is never called from the mixer thread loop (as opposed to the destructor) the deadlock described above cannot occur.
Merge commit 'f817218e09a556f20efc81309ba2cdb3475a370b' into eclair-mr2
* commit 'f817218e09a556f20efc81309ba2cdb3475a370b':
dumpstate: Pick up the last kernel log from /proc
We will need those values for new camera framework. And change the canned jpeg
image to match the new width and height setting.
Change-Id: I49f8fb63d2b859b9e9f1c5d27657a10203315bb6
Merge commit 'bcab01f6d0158c4d928f42b034949dc9608665a6' into eclair-mr2
* commit 'bcab01f6d0158c4d928f42b034949dc9608665a6':
Add a test app that will drain the battery. NOT IN BUILD.
Merge commit 'ca00dee21425882619aef4ecbe3e0d08de0544e5' into eclair-mr2
* commit 'ca00dee21425882619aef4ecbe3e0d08de0544e5':
Improve the exception message text by including eglGetError().
* changes:
Change the DropBoxManager API slightly (this is public, but not yet released) -- take a File instead of a ParcelFileDescriptor (gets opened internally) -- that way the caller doesn't have to worry about closing their PFD and so on. (Pretty much 100% of the time the caller will be uploading a file, anyway.)
Merge commit '7f7c16dee2f825f37aec4d457bdf5ec9b8109a47' into eclair-mr2
* commit '7f7c16dee2f825f37aec4d457bdf5ec9b8109a47':
Rename WebChromeClient.addMessageToConsole to WebChromeClient.onConsoleMessage. Do not merge.
Update JavaDoc for CacheManger.CacheResult, WebChromeClient.getDefaultVideoPoster and WebChromeClient.getVideoLoadingProgressView. Do not merge.
Improves documentation for GeolocationPermissions class. Do not merge.
* changes:
Rename WebChromeClient.addMessageToConsole to WebChromeClient.onConsoleMessage. Do not merge.
Update JavaDoc for CacheManger.CacheResult, WebChromeClient.getDefaultVideoPoster and WebChromeClient.getVideoLoadingProgressView. Do not merge.
Improves documentation for GeolocationPermissions class. Do not merge.
* changes:
Fix a bug in the Settings contract class (introduced in an ... iffy ... fix to a race condition) that breaks the caching of non-existent Settings/Secure/ Gservices values (causing lots of unnecessary database queries).
Merge commit '55896f3c5121e73e3f657ed14e7ee8937ad72449' into eclair-mr2
* commit '55896f3c5121e73e3f657ed14e7ee8937ad72449':
Fix 2283089 - ERD47B: Force Close of Launcher2 process when hitting Search button to invoke QSB
Merge commit '638514048141bf9f28a4bede77b83c3238f5c194' into eclair-mr2
* commit '638514048141bf9f28a4bede77b83c3238f5c194':
When using MDP, we needed to use a texture for diming.
* changes:
Copy SYSTEM_LAST_KMSG from /proc/last_kmsg instead of /data/dontpanic/last_kmsg. (In preparation for not copying to /data/dontpanic/last_kmsg at all.)
Merge commit '7f8e34091efdee1a383280b08585f8254472c1fd' into eclair-mr2
* commit '7f8e34091efdee1a383280b08585f8254472c1fd':
Temporarily add explicit step to disable keyguard to imf tests to attempt solve test flakiness.