Sleep for 100us and try to open the input device again if it fails, with a
maximum of 10 attempts.
We need the retry logic because setting permissions on a new input device is
racy. The init process watches for new input device (via uevent) and sets the
permission on them in devices.c:make_device(). However at the same time
EventHub.cpp watches for new input devices from the system_server process, and
immediately tries to open them. I can't see a simple way to avoid this race
condition.
As best as I can tell this race condition has always exisited.
There must have been some timing change that happened recently that causes us
to hit this race condition much more often. See repro notes in referenced bug.
Bug: 2375632
make sure to fallback properly to software when copybit operation fails.
with this change, the preview image will at least be displayed in b&w
(since GL doesn't support the yuv format). This would also fix
2363506, but that one is now handled more cleanly.
First implementations of audio policy manager in Eclair branch have shown that most code is common to all platforms.
Creating AudioPolicyManagerBase base class will improve code maintainability and readability.
Audio policy manager code for platforms using generic audio previously in AudioPolicyManagerGeneric is replaced by AudioPolicyManagerBase.
Audio policy manager test code previously in AudioPolicyManagerGeneric is moved to AudioPolicyManagerBase.
Also added a wake lock for delayed commands in AudioPolicyService.
Modified AudioFlinger duplicating output thread so that audio tracks are not mixed until both outputs (A2DP and hardware) have exited standby mode. This avoids to have one output far ahead of the other and audio frames dropped because the compensation mechanism cannot keep up.
Also calculate the maximum wait time in OutputTrack::write() based the on smallest frame count of all output threads instead of the frame count of the thread the OutputTrack is connected to. This avoids starving the thread with the smallest frame count by waiting too long on the other thread.
Since the frame count was reduced on hardware output to reduce latency the difference between A2DP and hardware outputs frame counts had become problematic.
Also increased the number of overflow buffers to cope with bigger timing differences among outputs.
Merge commit '2378f1413426987ccfe9d6ed5f856bb01c9d7c30'
* commit '2378f1413426987ccfe9d6ed5f856bb01c9d7c30':
fix [2269582] [TOP-10][Passion_1506][APT:Camera]Sometimes camera preview screen is truncated after launching and back to home screen by home key repeatedly
Merge commit '871f9de3554ccfd2028837dea97b76fcaf5ffedb'
* commit '871f9de3554ccfd2028837dea97b76fcaf5ffedb':
fix [2319255] crash in openGL : from the media recorder stress test.
Merge commit 'f9b0e826689cca5ecbd40aa49f3ea7f7c73ad2a2' into eclair-mr2
* commit 'f9b0e826689cca5ecbd40aa49f3ea7f7c73ad2a2':
fix [2269582] [TOP-10][Passion_1506][APT:Camera]Sometimes camera preview screen is truncated after launching and back to home screen by home key repeatedly
When a surface is removed from the screen while it holds a "freeze lock", the
release of that lock happens in the destructor as a "safety net". However, it
doesn't trigger an update at that point.
Make sure that "freeze locks" are released from the transaction at the point
a surface is removed from the screen (if it's not on screen, it shouldn't
prevent the screen to redraw, and therefore cannot hold a freeze lock).
The refresh corresponding to that transaction will pick it up as soon as possible.
Merge commit 'abcb37038a4981e935e516dd4d56cecd1f6fcb39'
* commit 'abcb37038a4981e935e516dd4d56cecd1f6fcb39':
fix [2315900] Monochrome camera preview screen after launching camera
Merge commit '083a557c25e0032bc4900f335b6643d0badd09ce' into eclair-mr2
* commit '083a557c25e0032bc4900f335b6643d0badd09ce':
fix [2319255] crash in openGL : from the media recorder stress test.
Merge commit '76169da0e84b0fcf621aeac6141af3ee85bc7c1e' into eclair-mr2
* commit '76169da0e84b0fcf621aeac6141af3ee85bc7c1e':
fix [2315900] Monochrome camera preview screen after launching camera
Merge commit 'b62954b66542e3e2654d97a81123c51805bceca7'
* commit 'b62954b66542e3e2654d97a81123c51805bceca7':
Throttle low priority RS threads by sleeping once per frame to avoid starving other apps.
Merge commit 'd1b8019a69d186df74f072cc51b413e34c3016f4'
* commit 'd1b8019a69d186df74f072cc51b413e34c3016f4':
improve video performance to minimize the tearing effect seen in 720p movies
Merge commit '57ce0888fcb1376b385c3dab5e4262793acaaf16' into eclair-mr2
* commit '57ce0888fcb1376b385c3dab5e4262793acaaf16':
Throttle low priority RS threads by sleeping once per frame to avoid starving other apps.
Merge commit 'd8c752ef74bc6d8b412defe35caf1a19be15eb8b' into eclair-mr2
* commit 'd8c752ef74bc6d8b412defe35caf1a19be15eb8b':
improve video performance to minimize the tearing effect seen in 720p movies