This change fixes the stability problems experienced when using
a bluetooth headset supporting both A2DP and SCO. Problems occur
when starting the video chat at which time the A2DP output is being
stopped to start SCO. At that time, active AudioTracks are invalidated
by AudioFlinger so that a new AudioTrack binder interface can be
recreated by the client process on the new mixer thread with correct parameters.
The problem was that the process to restore the binder interface was not
protected against concurrent requests which caused 2 binder interfaces
to be created sometimes. This could lead to permanent client deadlock
if one of the client threads was waiting for a condition of the first
created binder interface while the second one was created (as the AudioFlinger
would only signal conditions on the last one created).
This concurrent request situation is more likely to happen when a client
uses the JAVA AudioTrack as the JNI implementation uses simultaneously the
native AudioTrack callback and write push mechanisms. By doing so, the code
that checks if the binder interface should be restored (in obtainBuffer()) is
much more likely to be called concurrently from two different threads.
The fix consists in protecting the critical binder interface restore phase
with a flag in the AudioTrack control block. The first thread acting upon the binder
interface restore request will raise the flag and the second thread will just wait for
a condition to be signaled when the restore process is complete.
Also protected all accesses to the AudioTrack control block by a mutex to prevent
access while the track is being destroyed and restored. If a mutex cannot be held
(e.g because we call a callback function), acquire a strong reference on the IAudioTrack
to prevent its destruction while the cblk is being accessed.
Modified AudioTrack JNI to use GetByteArrayElements() instead of
GetPrimitiveArrayCritical() when writing audio buffers. Entering a critical section would
cause the JNI to abort if a mediaserver crash occurs during a write due to the AudioSystem
callback being called during the critical section when media server process restarts.
Anyway with current JNI implementation, either versions do not copy data most of the times
and the criticial version does not guaranty no data copy.
The same modifications have been made to AudioRecord.
Change-Id: Idc5aa711a04c3eee180cdd03f44fe17f3c4dcb52
Bug #3461349
This change also fixes two bugs that prevented partial invalidates
from working with other views. Both bugs were in our EGL implementation:
they were preventing the caller from comparing the current context/surface
with another context/surface. This was causing HardwareRenderer to always
redraw the entire screen.
Change-Id: I33e096b304d4a0b7e6c8f92930f71d2ece9bebf5
Bug #3461349
Before this change, eglGetCurrent*() could not be used to compare
contexts, displays and surfaces at the Dalvik level.
Change-Id: I442037dae37bc357b64810ab10c779b5754e9153
If the RIL_REQUEST_OPERATOR response[2], the numeric for the operator,
is bad use the system property ro.cdma.home.operator.numeric.
bug: 3383515
Change-Id: I090e5ba0cb7e3a7f1dc08d24996e78e489b9cd41
Calls thought to be duplicates were removed, which caused rendering problems
for Browser as well as crashes in the widget list and music.
Change-Id: I6364aaa362619ea3dd368990304d61d84bbe2a90
Bug 3510106
The CAB animation does not fire events, which does not update the
handles' positions.
The solution is to make the handle update their position before any
draw traversal, using an onPreDrawListener. The ScrollingPopupWindow
onScroll listener is no longer needed with this change. This is also
a more robust solution since other events (such as animations) may
change the TextView's position.
The cost is a recomputation of the Handles' positions at each redraw
which was not necessary with listeners. But as mentioned before, not
all possible events provide listeners or will in the future.
Change-Id: I0f46118de5f660a75d95eecb2cf987fcb4b3b322
This change unhides RTP related classes including AudioCodec,
AudioGroup, AudioStream, and RtpStream. This allows developers
to control audio streams directly and also makes conference
calls possible with the combination of the public SIP APIs.
Change-Id: Idfd4edf65a1cbf3245ec2786fbc03b06438b0fb3
sqlite3 is overkill for what we are doing here, and more fragile.
BUG: 3512856
Change-Id: I83d86127949d894a3887db3456d91b013060e852
Signed-off-by: Mike Lockwood <lockwood@android.com>