Commit Graph

838 Commits

Author SHA1 Message Date
Kenny Root
d4066a4ac5 ZipUtilsRO rewrite based on Dalvik Zip rewrite
Change the way zip archives are handled.  This is necessary to deal with
very large (~1GB) APK files, for which our current approach of mapping
the entire file falls over.

We now do the classic scavenger hunt for the End Of Central Directory
magic on a buffer of data read from the file, instead of a memory-mapped
section.  We use what we find to create a map that covers the Central
Directory only.

If the caller is interested in unpacking the file contents, we have to
do an additional file read to discover the size of the Local File Header
section so we can skip past it.

This is based on Change I745fb15abb in the dalvik tree. Both
implementations share a common ancestry, but the cost of unifying them
outweighs the benefits of wrapping C calls.

Change-Id: Iddacb50fe913917c2845708a530872d65fdbe620
2010-05-12 05:07:48 -07:00
Mathias Agopian
0c7af77450 am 56aed6bd: am c69775d6: Merge "fix [2664345] Flash: Bad flicker at the end of a pinch zoom." into froyo
Merge commit '56aed6bde0c52658d2cb1207c0cfe8ba0a764c59' into kraken

* commit '56aed6bde0c52658d2cb1207c0cfe8ba0a764c59':
  fix [2664345] Flash: Bad flicker at the end of a pinch zoom.
2010-05-10 09:49:19 -07:00
Mathias Agopian
179169e88e fix [2664345] Flash: Bad flicker at the end of a pinch zoom.
the window manger puts SurfaceViews up before they have been
rendered into, because of that surfaceflinger doesn't have
anything ready to draw for that surface when an udpate occurs
and responds by filling the surface with black.
With this fix, we only fill those areas of the framebuffer
that would otherwise be undefined (no content at all).

in the Flash case, the "flash" window is not drawn at all
until it has some content, instead the underlaying browser
window is shown.

Change-Id: Ifb610f7f8c27b88edf83e09adc4803fc295c15a1
2010-05-06 20:21:45 -07:00
Dan Egnor
7dd2bb8412 am ca48c88c: am 8a8658a5: Merge "Make static versions of libutils and libbinder." into froyo
Merge commit 'ca48c88c3d5733c4405a2fc4f7d9bb7fbba3d43f' into kraken

* commit 'ca48c88c3d5733c4405a2fc4f7d9bb7fbba3d43f':
  Make static versions of libutils and libbinder.
2010-05-06 17:35:06 -07:00
Dan Egnor
386a332b4f Make static versions of libutils and libbinder.
Fix some small static-initialization-order issues (and a static-
initializers-missing issue) that result from doing so.  The static
libraries don't actually get used for anything real at the moment --
they're used for perf tests of bug 2660235.

Bug: 2660235
Change-Id: Iee2f38f79cc93b395e8d0a5a144ed92461f5ada0
2010-05-06 01:03:31 -07:00
Mathias Agopian
d52128786f make sure the server-side validates pointers/indices visible on the client side
Change-Id: I604f58d3fcd2d09ec7998123c627401081345cd6
2010-04-30 13:05:36 -07:00
Mathias Agopian
30c4c182ec Merge "Add support for enqueuing buffers in arbitrary order" into kraken 2010-04-30 12:58:11 -07:00
Mathias Agopian
4fcad80654 Merge "cleanup. waitForCondition() now uses polymorphsim instead of templtes" into kraken 2010-04-29 14:17:12 -07:00
Mathias Agopian
a228cc5efa Merge "fix a race condition in undoDequeue(), where 'tail' could be computed incorrectly." into kraken 2010-04-29 14:16:14 -07:00
Dianne Hackborn
c93a781c24 New xlarge screen size.
Not complete, only for experimentation at this point.

This includes a reworking of how screen size configurations are matched,
so that if you are on a larger screen we can select configurations for
smaller screens if there aren't any exactly matching the current screen.

The screen size at which we switch to xlarge has been arbitrarily
chosen; the compatibility behavior has not yet been defined.

Change-Id: I1a33b3818eeb51a68fb72397568c39ab040a07f5
2010-04-28 16:51:52 -07:00
Mathias Agopian
c0a9164e9e Add support for enqueuing buffers in arbitrary order
Also added a very simple SharedBufferStack unit test.

Change-Id: I253dbbe98a53c966b78d22d4d6dd59f8aefc8c40
2010-04-28 16:12:54 -07:00
Mathias Agopian
b296533607 cleanup. waitForCondition() now uses polymorphsim instead of templtes
the reason for the above change is that waitForCondition() had become
large over time, mainly to handle error cases, using inlines to
evaluate the condition doesn't buys us much anymore while it increases
code size.

Change-Id: I2595d850832628954b900ab8bb1796c863447bc7
2010-04-28 16:12:54 -07:00
Mathias Agopian
0a8cd0689a fix a race condition in undoDequeue(), where 'tail' could be computed incorrectly.
in the undoDequeue() case, 'tail' was recalculated from 'available' and 'head'
however there was a race between this and retireAndLock(), which could cause
'tail' to be recalculated wrongly.

the interesting thing though is that retireAndLock() shouldn't have any impact
on the value of 'tail', which is client-side only attribute.
we fix the race by saving the value of 'tail' before dequeue() and restore it
in the case of undoDequeue(), since we know it doesn't depend on retireAndLock().

Change-Id: I4bcc4d16b6bc4dd93717ee739c603040b18295a0
2010-04-28 16:12:54 -07:00
Mathias Agopian
1b5e1021b8 more surfaceflinger cleanups
get rid of the "fake rtti" code, and use polymorphism instead.
also simplify how we log SF's state (using polymorphism)

Change-Id: I2bae7c98de4dd207a3e2b00083fa3fde7c467922
2010-04-21 22:28:20 -07:00
Mathias Agopian
245e4d78c5 better fix for [2420565] Surface.lockCanvas() updates the dirty region too often
Change-Id: I83438b40effd21538f1c74396dc665254b9d5ab6
2010-04-21 22:25:35 -07:00
Mathias Agopian
11777e9a6e DO NOT MERGE fix [2557396] Adreno200: glDrawTexi() doesn't work with height <= 16
don't use glDrawTexi() anymore

Change-Id: If71334de39114b0edce7771366f8d8dc26f6911e
2010-04-20 21:55:40 -07:00
Mathias Agopian
082e3be0da Merge "added setCrop() to android_native_window_t" into kraken 2010-04-20 16:28:24 -07:00
Mathias Agopian
f2d283de91 Merge "add support for up to 16 buffers per surface" into kraken 2010-04-20 16:28:14 -07:00
Mathias Agopian
b1ab57601a Merge "clean-up surfaceflinger a bit" into kraken 2010-04-20 15:59:57 -07:00
Mathias Agopian
78fd5010a8 clean-up surfaceflinger a bit
get rid of the glDrawTexi path and use floating points instead of fixed point maths

Change-Id: I3aa9ce2dc082f702160e605a16ba5fe987cdf087
2010-04-20 15:58:36 -07:00
Jean-Michel Trivi
5bd957f458 am 0fabf2e8: am 8ccbd4ba: Merge "Fix bug 2604132 40s skip after undocking In case of A2DP write errors, there is an overflow in the calculation of the sleep duration to simulate the timing of a successful write." into froyo
Merge commit '0fabf2e81559106cb4aaf9e8ba45b0bed37d5eb8' into kraken

* commit '0fabf2e81559106cb4aaf9e8ba45b0bed37d5eb8':
  Fix bug 2604132 40s skip after undocking
2010-04-20 14:48:15 -07:00
Mathias Agopian
cc08e688f5 added setCrop() to android_native_window_t
hooked up the new method up to Surface.cpp
the actual crop is not implemented in SF yet

Change-Id: Ic6e313c98fd880f127a051a0ccc71808bd689751
2010-04-20 13:36:29 -07:00
Mathias Agopian
1100c8b901 add support for up to 16 buffers per surface
also increase the dirtyregion size from 1 to 6 rectangles.
Overall we now need 27KiB process instead of 4KiB

Change-Id: Iebda5565015158f49d9ca8dbcf55e6ad04855be3
2010-04-20 13:36:29 -07:00
Jean-Michel Trivi
e783275aca Fix bug 2604132 40s skip after undocking
In case of A2DP write errors, there is an overflow in the calculation
of the sleep duration to simulate the timing of a successful write.

Change-Id: Ic4e570aebf07fac69735aab1bbc2fc73512ee795
2010-04-20 12:12:13 -07:00
Mathias Agopian
0ec1f2fc6e am 26f61635: am 0a4ab1b9: Merge "fix [2599939] "cannot play video" after open/close a video player a dozen of times" into froyo
Merge commit '26f6163557980062dbb203388b3d0794ee0d06f7' into kraken

* commit '26f6163557980062dbb203388b3d0794ee0d06f7':
  fix [2599939] "cannot play video" after open/close a video player a dozen of times
2010-04-19 19:29:22 -07:00
Mathias Agopian
3c772b706d fix [2599939] "cannot play video" after open/close a video player a dozen of times
get rid off the MAP_ONCE flag is MemoryHeapBase (as well as it's functionality),
this feature should not be used anymore.

the software renderer was incorrectly using the default ctor which set MAP_ONCE,
causing the leak. the software renderer itself is incorrectly used while coming
back from sleep.

Change-Id: I123621f8d140550b864f352bbcd8a5729db12b57
2010-04-19 19:09:03 -07:00
Mathias Agopian
5629eb1676 when a zero dimension buffer is allocated, turn the allocation into
a 1x1 buffer instead of Nx1 (or 1xN)

Change-Id: I27eeb15e83e13002dd9405f4e52b54f7dffc0fe7
2010-04-15 15:23:25 -07:00
Mathias Agopian
ddf1dd1353 am e7d5a2f9: am 45423465: Merge "fix [2594950] Flash: Zooming in on some content crashes the Nexus One and causes it to reboot (runtime restart)" into froyo
Merge commit 'e7d5a2f9ae47d8ea8face3f1e451314ed36f4026' into kraken

* commit 'e7d5a2f9ae47d8ea8face3f1e451314ed36f4026':
  fix [2594950] Flash: Zooming in on some content crashes the Nexus One and causes it to reboot (runtime restart)
2010-04-14 18:25:21 -07:00
Mathias Agopian
ca99fb8f65 fix [2594950] Flash: Zooming in on some content crashes the Nexus One and causes it to reboot (runtime restart)
We now limit the size of the surface to the maximum size supported by the GPU.
On Nexus One this will 2048 -- it could be different on other devices.
Surface creation fails if the limit is exceeded.

Change-Id: I9ecfc2e9c58c9e283782b61ebfc6b590f71df785
2010-04-14 16:43:44 -07:00
Eric Laurent
63aff8160c am 1921527c: am 9da7730d: Merge "Additional fix for isssue 2548710: Native AudioTrack resources never freed." into froyo
Merge commit '1921527c8dbcb9f10683e43bca12648cb2c6e5b7' into kraken

* commit '1921527c8dbcb9f10683e43bca12648cb2c6e5b7':
  Additional fix for isssue 2548710: Native AudioTrack resources never freed.
2010-04-09 08:58:30 -07:00
Eric Laurent
775fa3cd32 Additional fix for isssue 2548710: Native AudioTrack resources never freed.
This changes fixes the issue for the direct output thread that was not
addressed by commit 71f37cd8a175ee00635cb91506d6810fd02b5b51.

Change-Id: I1bbe26be5f444415dd97270e49257650f5d2858f
2010-04-09 06:11:48 -07:00
Mathias Agopian
3a80695667 fix [2420565] Surface.lockCanvas() updates the dirty region too often
There was a bug where we were we could be reallocating buffers for no reason.

Change-Id: Ieb8a81a289da9339ab7faf987cd3a73428943c1a
2010-04-08 19:09:04 -07:00
Matt Fischer
166bcf9072 Only hold a weak pointer on SurfaceComposerClients
Each process maintains an array of active SurfaceComposerClient
objects, so that they can be reused as new surfaces are parceled
across.  When a SurfaceComposerClient is disposed, it will remove
itself from this list.  However, because the list maintains a strong
reference on the object, a reference cycle is created, and the
client is never deleted.

This patch changes the list to maintain weak pointers on the clients
instead.

Change-Id: I93dc8155fe28b4e350366a3400cdf22a8c77cdd3
2010-04-07 14:27:03 -05:00
Mathias Agopian
8f10540cd5 Make pixels prettier.
Change-Id: If3b0774b70cbe943894c15ffa1da111ad887010f
2010-04-05 18:12:27 -07:00
Eric Laurent
deea502a92 Fix isssue 2548710: Native AudioTrack resources never freed.
The problem is a bug in AudioFlinger::MixerThread::prepareTracks_l() that makes that even if the TrackHandle
is destroyed, the corresponding Track will remain active as long as frames are ready for mixing.
If the track uses shared memory (static mode) and the sound is looped, this track will play for ever.

The fix consists in removing the track from active list immediately if the track is terminated.

Change-Id: I4582aa1d981079ab79be442fb6185f5afaed5cf3
2010-03-31 12:36:34 -07:00
Dianne Hackborn
c85e12e075 Revert "fix [2542425] memory leak during video recording"
This reverts commit 544592e14f8d7643238e40ba9879727497900f35.
2010-03-30 21:04:17 -07:00
Mathias Agopian
77e26d6822 fix [2542425] memory leak during video recording
[Sorted|Keyed]Vector<TYPE> would leak their whole storage when resized
from the end and TYPE had trivial dtor and copy operators.

Change-Id: I8555bb1aa0863df72de27d67ae50e20706e90cf5
2010-03-30 19:02:59 -07:00
Mathias Agopian
caeddc7236 fix [2542425] memory leak during video recording
Vector::sort() is using _do_copy() incorrectly; _do_copy() calls the
copy constructor, not the assignment operator, so we need to destroy
the "destination" before copying the item.

Change-Id: Iaeeac808fa5341a7d219edeba4aa63d44f31473c
2010-03-29 13:45:18 -07:00
Mathias Agopian
c8620b60d6 fix [2545826] calling into gralloc with external lock held
Change-Id: I2d0e017382404c684c768a0dd0423d574213f10a
2010-03-25 14:34:49 -07:00
Mathias Agopian
6795478949 Merge "libutils Condition are now PRIVATE by default" 2010-03-19 17:20:08 -07:00
Mathias Agopian
26d244281a libutils Condition are now PRIVATE by default
Condition must be initialized with SHARED for the old behavior, where
they can be used accross processes.

Updated the two places android that require SHARED conditions.

PRIVATE conditions (and mutexes) use more efficient syscalls.

Change-Id: I9a281a4b88206e92ac559c66554e886b9c62db3a
2010-03-19 16:16:43 -07:00
Christopher Tate
440fd870b2 Ensure that binder incalls to the system process keep the fg cgroup
On binder incalls, the handler thread is given the caller's priority by the
driver, but not the caller's cgroup.  We have explicit code that sets the
handler's cgroup to match the caller's, *except* that the system process
explicitly disables this behavior.  This led to a siuation in which we were
running binder incalls to the system process at nice=10 but cgroup=fg.

That's fine as far as it goes, except that if a GC happened in the handler
thread, it would be promoted to foreground priority and cgroup both, to avoid
having the GC take forever.  Then, when GC finished, the original priority
is reset, and the cgroup set *based on that priority*.  This would push the
handler thread into nice=10 cgroup=bg_non_interactive -- which matches the
caller, but is supposed to be impossible in the system process.

The end result of this was that we could be running "lengthy" operations in
the system process in the background.  Unfortunately, some of the operations
that wound up like this would hold important global system locks for up to
twenty seconds as a result, making the entire device unresponsive to input
for that period.

This CL fixes the binder incall setup to ensure that within the system process,
a binder incall is always begun from the normal foreground priority as well
as cgroup.  In practice now the device still becomes laggy/sluggish when the
offending lock-holding time-consuming incall occurs, but since it still runs
as a foreground task it is able to proceed to completion within a short time
rather than taking 20 seconds.

Fixes bug #2403717

Change-Id: Id046aeabd0e80c48eef94accc37842835eab308d
2010-03-18 18:13:57 -07:00
Eric Laurent
d6ce100464 Merge "Fix issue 2416481: Support Voice Dialer over BT SCO." 2010-03-17 09:16:27 -07:00
Mathias Agopian
ab02873e8f fix [2511580] Window poop on screen - drop down list left some residual when it resized
Change-Id: Ib9a3622e7a568ba26717a93b5bfa4a191651f4d0
2010-03-16 17:54:27 -07:00
Eric Laurent
101e77a31b Fix issue 2416481: Support Voice Dialer over BT SCO.
- AudioPolicyManager: allow platform specific choice for opening a direct output.
 Also fixed problems in direct output management.
- AudioFliinger: use shorter standby delay and track inactivity grace period for direct output
thread to free hardware resources as soon as possible.
- AudioSystem: do not use cached output selection in getOutput() when a direct output
can be selected.

Change-Id: If44b50d29237b8402ffd7a5ba1dc43c56f903e9b
2010-03-16 17:32:18 -07:00
Mathias Agopian
d343e3d5e3 fix [2515291] Native crash and runtime restart while trying to preview captured picture on Sapphire
if a buffer couldn't be allocated because of an OOM, SF could, in some case dereference
a null pointer.

Change-Id: I5321248c38a21e56d5278b6aada2694e64451378
2010-03-15 18:15:20 -07:00
Jean-Michel Trivi
08abf1fa13 Fix bug 2203203 Route STREAM_VOICE_CALL to A2DP when not in call.
Change-Id: I5581702780308658415dc4ad19fbe409fdc5c368
2010-03-14 10:55:57 -07:00
Mathias Agopian
55fa25161a implement connect/disconnect in our native_window_t implementations
the framebuffer implementation doesn't do anything special with this
but the surfaceflinger implementation makes sure the surface is not used
by two APIs simultaneously.

Change-Id: Id4ca8ef7093d68846abc2ac814327cc40a64b66b
2010-03-11 15:06:54 -08:00
Mathias Agopian
d129659347 fix [2483456] Video orientation is wrong on Droid for some videos
Change-Id: I450191f1335f57bffc51aff3e27295395847dbc0
2010-03-11 12:55:39 -08:00
Jean-Baptiste Queru
c3897a2aea Merge "Use proper config to enable LVMX" 2010-03-09 18:43:57 -08:00
Jean-Baptiste Queru
e4623e8754 Use proper config to enable LVMX
Change-Id: Ifa75a82884b99aeee139e055f40e7c510cf28213
2010-03-09 18:13:59 -08:00
Dianne Hackborn
82fecb01df Add ability for some manifest attributes to reference resources.
This loosens our restriction on many manifest attributes requiring
literal string values, to allow various ones to use values from
resources.  This is only allowed if the resource value does not change
from configuration changes, and the restriction is still in place
for attributes that are core to security (requesting permissions) or
market operation (used libraries and features etc).

Change-Id: I4da02f6a5196cb6a7dbcff9ac25403904c42c2c8
2010-03-09 17:18:05 -08:00
Glenn Kasten
d5ea969b41 Initial version of LifeVibes integration.
Also changed tabs to spaces in other audioflinger files.
2010-03-09 14:16:01 -08:00
Jean-Michel Trivi
84cf7d9e88 Fix bug 2329540
Part 1 of the fix: when the user doesn't elect to use the car dock
 for music and media, the APM was not aware of the device being
 docked.
 This is fixed by dissociating the notification for the APM of
 the docking to the dock from the sink state change of the A2DP
 device.
 Also missing was forcing the volumes to be reevaluated whenever
 the device is docked or undocked, as volumes for docks may
 differ, even when the same output device is being used.

Change-Id: If5314e27821a71adbd6df6fdf887c45208241d96
2010-03-09 12:45:55 -08:00
Mathias Agopian
948d69fca4 improve SF logging/debugging a little bit
Change-Id: I6a57f89c25defc293fd748cc1fbd710031c02ec2
2010-03-08 19:30:56 -08:00
Mathias Agopian
7d3f8ed3a5 Merge "Fix a small bug where we could compute SharedBufferStack's tail incorrectly." 2010-03-08 19:24:27 -08:00
Mathias Agopian
c2e30de00c Fix a small bug where we could compute SharedBufferStack's tail incorrectly.
Also add "tail" to the debug dump().

Change-Id: I04b1ea375dfc9ddcc22f0c6b6cd01300e507572e
2010-03-08 19:23:26 -08:00
Mathias Agopian
f23a5e052e Merge "fixes for [2474091] Saw Poor behaviour playing a video." 2010-03-08 15:35:44 -08:00
Mathias Agopian
fcfeb4b597 fixes for [2474091] Saw Poor behaviour playing a video.
- fix a bug when hacking video buffers into gralloc buffers
 where the buffer size was incorrect this was causing the
 "direct-form-texture" mode to fail

- also when the above fails, make sure to revert to the
 "mdp copy mode" before going to "slow mode"

- finally disable completely the "direct-from-texture" mode
 for now. It cannot work because the allocated buffers can't
 respect the GPU constraints (alignment and such). We'll
 have to find a solution for that.
2010-03-08 11:14:20 -08:00
Eric Laurent
219795f5d0 Fix issue 2317760: Change the priority between wired headset and A2DP.
Modified audio policy manager so that wired headset has precedence over A2DP headset.
2010-03-08 06:50:44 -08:00
Eric Laurent
194e485dd1 Merge "Fix issue 2428563: Camera rendered inoperable by voice call interruption." 2010-03-05 16:01:47 -08:00
Eric Laurent
4f1fcc2890 Fix issue 2428563: Camera rendered inoperable by voice call interruption.
The problem is that AudioRecord never exits read() when a timeout occurs while trying
to get new PCM data from audio hardware input buffer: it just keeps waiting and retrying until stop() is called.
In the same time, opencore AndroidAudioInput::audin_thread_func() loop cannot be exited when stuck
in AudioRecord::read() because the iExitAudioThread flag can only be sampled when AudioRecord::read()
returns. We remain stuck with the audio input thread running.

The fix consists in modifying AudioRecord behavior in case of timeout when getting new PCM samples.
We now wait only one timeout period and try to restart audio record, in case the problem is due to a media_server
process crash. If this fails, we exit read() with a number of bytes read equals to 0 so that
AndroidAudioInput::audin_thread_func() loop can exit.

Also modified Audioflinger::RecordThread() loop so that we attempt to recover from HAL read errors.
In case of read error, the input stream is forced to standby so that next read attempt does a
reconfiguration and restart of the audio input device.
2010-03-05 11:54:23 -08:00
Christopher Tate
9855a0575e Calculate bitmask array sizes correctly in the EventHub
We've gotten lucky to date:  the previous calculation of bitmask array
sizes, (maxval+1)/8 only works properly when 'maxval' is one less than
a multiple of 8.  Fortunately, this has either been the case for us,
or there has been sufficient 'unused' space at the end of the defined
max value range that we haven't wound up overreading/overwriting the
allocated buffers.

Change-Id: I563a93a86644ab9f19489565e06c28e06bb53abc
2010-03-04 16:32:32 -08:00
Christopher Tate
2032f98f8c Fix #2489986 : The key bitmask needs to cover all possible keys
Change-Id: Ieebd2f879e6b6fbc0388655dd66f34be89e809a0
2010-03-04 16:00:29 -08:00
Dianne Hackborn
6687fb103d Fix some bugs.
Bug #2376231: Apps lose window focus (and back key causes ANR) if the
lock screen is dismissed while the phone is in landscape mode

This is another case where we weren't recomputing the focused window
after changing the visibility policy.

bug #2479958: Investigate source of "Resources don't contain package
for resource number 0x7f0a0000"

Um, okay, so it turns out there were bugs all over the place where
we would load an XML resource from a another application, but not
use the Resources for that application to retrieve its resources...!
I think the only reason any of this stuff was working at all was
because it typically only cared about retrieving the resource
identifiers of the items (it would look up the values later).

Bug #2401082: Passion ERE26 monkey crash - InputMethodManagerService

Add some null checks.
2010-03-04 11:52:14 -08:00
Dianne Hackborn
71c3eb2a38 Maybe fix issue #2482201: Paired bluetooth device looks like a qwerty keyboard
We now only consider a device to be a default keyboard if its name
has "-keypad".  A hack, but whatever.

Also add some debug logging for the input state to help identify such
issues in the future.
2010-03-02 17:37:45 -08:00
Dima Zavin
4fe6ac33d1 surfaceflinger: remove un-cached buffers hack for Adreno
Change-Id: I5ae4e74bfa3e25b55be2cddf7b3c51368a140ab9
Signed-off-by: Dima Zavin <dima@android.com>
2010-03-02 16:44:46 -08:00
Eric Laurent
134ccbd131 Issue 2071329: audio track is shorter than video track for video capture on sholes
Add API to retrieve number of frames dropped by audio input kernel driver.

Submitted on behalf of Masaki Sato <masaki.sato@motorola.com>
2010-03-02 08:20:13 -08:00
Dianne Hackborn
8eca036d24 Fix issue #2448075: aapt doesn't fix up activity-alias android:targetActivity links
And related:

- The aapt tool now sets a resource configurations sdk level to match any configs
  that have been set (for example if you specify density your sdk level will be
  at least 4).
- New option to modify the targetPackage attribute of instrumentation.
- Clean up of aapt options help.
- Fix of UI type values to leave 0 for "unspecified".
- Make the UI mode config APIs public.
2010-03-01 20:42:14 -08:00
Mathias Agopian
064e1e672e fix [2425395] portrait UI briefly shows in landscape
the "freeze" timeout was not initialized properly which caused it
to kick-in immediately instead of after 5s
2010-03-01 18:36:14 -08:00
Mathias Agopian
285dbde2e0 Added a name to Surface created by SurfaceFlinger
Updated the window manager to use this new facility.
Surfaces name are now printed by "dumpsys".
2010-03-01 18:34:50 -08:00
Ficus Kirkpatrick
dc7caf18da Demote the famous ResourceTypes warning to LOGV.
It is spamming the log bigtime and can be promoted back to LOGW
or worse by whoever decides to actually investigate the bug.

Change-Id: I72d950155378f641ebdfbacabae774f5736a52bc
2010-03-01 16:33:53 -08:00
Mathias Agopian
45853c9759 to help debugging [2461567] Home screen redraw messed up
log SF's idea of the front buffer in dumpsys.
2010-02-26 18:59:23 -08:00
Eric Laurent
83db7782aa Merge "Fix issue 2327064: Music played via line out is interrupted due to the phone call audio on BT hs." 2010-02-25 00:14:47 -08:00
Eric Laurent
15498d6a23 Fix issue 2327064: Music played via line out is interrupted due to the phone call audio on BT hs.
This is not a real fix for the issue but a change to make sure that the behavior is consistent regardless of
external condidions (WIFI ON or OFF, music started before call or not, A2DP device same as SCO device...).

As there is now way to guaranty good quality audio over both SCO and A2DP simultaneously, especially when WIFI is on, We will stick to this behavior:
When music is playing and we are docked to the desk dock and a call is answered with a BT SCO headset, A2DP output will be suspended.
If music is restarted during the call, it will appear muted to the user until the call is terminated.
2010-02-24 11:54:32 -08:00
Kenny Root
f70c4cebcc Merge "Use UTF-8 strings to avoid duplicate caching, part 1" 2010-02-24 07:52:27 -08:00
Eric Laurent
057aa729dd Merge "Fix issue 2305382: Pick up original call makes a noisy beep when wired headset connected." 2010-02-23 23:36:37 -08:00
Eric Laurent
34248170a7 Fix issue 2305382: Pick up original call makes a noisy beep when wired headset connected.
The noise is the residual ring tone that is still playing while the call is answered and the
audio route changed to headset or earpiece.

The fix consists in muting the ringing tone when changing mode from ringtone to in call
and delaying the route change until the audio buffers are emptied.
2010-02-23 11:00:56 -08:00
Kenny Root
9e333ab42c Use UTF-8 strings to avoid duplicate caching, part 1
StringBlock instances containing UTF-8 strings use a cache to convert
into UTF-16, but using that cache and then using a JNI call to NewString
causes the UTF-8 string as well as two copies of the UTF-16 string to
be held in memory. Getting the UTF-8 string directly from the StringPool
eliminates one copy of the UTF-16 string being held in memory.

This is part 1. Part 2 will include ResXMLParser optimizations.

Change-Id: Ibd4509a485db746d59cd4b9501f544877139276c
2010-02-23 10:02:20 -08:00
Mathias Agopian
eda65400f5 remove a dependency of surfaceflinger on libskia
libskia was only used for a small part of SkTransform. We now implement
Transform is surfaceflinger directly.
2010-02-22 17:30:40 -08:00
Mathias Agopian
98e71ddaed remove a dependency of GraphicBuffer (libui) on Parcel (libbinder).
Add a Flattenable interface to libutils which can be used to flatten
an object into bytestream + filedescriptor stream.
Parcel is modified to handle Flattenable. And GraphicBuffer implements
Flattenable.

Except for the overlay classes libui is now independent of libbinder.
2010-02-21 23:27:25 -08:00
Mathias Agopian
ca6fab2b53 Initialize layer position 2010-02-19 17:51:58 -08:00
Mathias Agopian
b6121422ef Remove a dependency of Region (libui) on Parcel (libbinder). 2010-02-17 20:26:47 -08:00
Mathias Agopian
3db2164051 fix a bug I introduced recently where YUV formats would crash the system 2010-02-16 20:43:39 -08:00
Mathias Agopian
54ed4f6282 get rid off the YUV formats at the libui layer 2010-02-16 17:33:37 -08:00
Mathias Agopian
713e2f1bf5 Merge "minor cleanup." 2010-02-16 12:56:56 -08:00
Mathias Agopian
c9e4a12546 minor cleanup. 2010-02-12 18:50:28 -08:00
Kenny Root
0d88e7a8d7 Totally remove Unicode.cpp and rely on ICU
Unicode.cpp used a packed data table for character data that essentially
duplicated ICU's functionality.

Change-Id: Ia68fe4ac94e89dc68d9a3f45f33f6e648a5500b7
2010-02-12 14:37:42 -08:00
Kenny Root
196e320734 Excise code from Unicode.cpp that was dead
Remove some utility functions for discovering character data
that ICU probably took over a while ago.

Change-Id: I97abe4de2f51eb2bf48679941258bc501184c3dc
2010-02-12 13:01:16 -08:00
Mathias Agopian
9cce325fae split libsurfaceflinger_client and libcamera_client out of libui 2010-02-11 13:16:22 -08:00
Wu-cheng Li
1776e77c68 Merge "Remove some logs." 2010-02-10 00:07:36 -08:00
Wu-cheng Li
d5a4f1ff5b Remove some logs. 2010-02-10 13:02:17 +08:00
Wu-cheng Li
dfec3a92cb Merge "Add exposure compensation parameter." 2010-02-09 20:49:06 -08:00
Wu-cheng Li
a05c822704 Add exposure compensation parameter.
bug:2375993
2010-02-09 18:28:50 +08:00
Mathias Agopian
2b92d89e23 Add support for physically rotated displays
This feature is currently controled by a system property.
"ro.sf.hwrotation" can be set to either 90 or 270. It'll cause
SF to rotate the screen by 90 and 270 degres respectively.

That is, if the driver reports 800x480 for instance, and
ro.sf.hwrotation is set to 90, applications will "see" a
480x800 display and will run in portrait.

This is implemented by introducing an extra "display"
transformation in the GraphicPlane.
2010-02-08 15:49:35 -08:00
Mathias Agopian
a7e380396e Add support for direct EGLImageKHR use with pushbuffer API
We now always first try to use the EGLImageKHR directly before
making a copy with copybit. The copy may be needed when
EGLImage doesn't support the requested format, which is
currently the case with YUV.
2010-02-04 17:13:06 -08:00
Wu-cheng Li
391f3f8b5e Add float support for set and get in CameraParameters.
bug:2375989
bug:2375987
2010-01-31 17:03:10 +08:00
Wu-cheng Li
077c40fee3 Add focal length and view angle API.
bug:2375989,2375987
2010-01-30 20:36:04 +08:00
Mathias Agopian
0dd0d2944a Simplify the MemoryDealer implementation
At some point the implementation became complicated because of
SurfaceFlinger's special needs, since we are now relying on gralloc
we can go back to much simpler MemoryDealer.

Removed HeapInterface and AllocatorInterface, since those don't need
to be paramterized anymore. Merged SimpleMemory and Allocation.
Made SimplisticAllocator non virtual.

Removed MemoryDealer flags (READ_ONLY, PAGE_ALIGNED)

Removed a lot of unneeded code.
2010-01-29 14:51:06 -08:00
Eric Laurent
7ccc09a4f3 Remove verbose log from AudioPolicyManagerBase. 2010-01-28 13:42:59 -08:00
Eric Laurent
2550f8557f Merge "Fix issue 2285561: New AudioFlinger and audio driver API needed for A/V sync" 2010-01-27 14:21:20 -08:00
Chih-Chung Chang
556a6fed12 Merge "Add support for setting camera display orientation." 2010-01-27 09:20:19 -08:00
Eric Laurent
e9ed2721f4 Fix issue 2285561: New AudioFlinger and audio driver API needed for A/V sync
Added getRenderPosition() API to IAudioFlinger to retreive number of audio frames
written by AudioFlinger to audio HAL and by DSP to DAC.

Added getRenderPosition() API to AudioHardwareInterface to retreive number of audio frames
written by DSP to DAC.

Exposed AudioTrack::getPosition() to AudioSink() to make it available to media player.

Removed excessive log in AudioHardwareGeneric.
2010-01-26 18:40:39 -08:00
Chih-Chung Chang
f091e833d3 Add support for setting camera display orientation. 2010-01-26 11:07:07 -08:00
Nick Pelly
1b5cf329ea Revert "Fix failure to open AVRCP input device due to EPERM."
This reverts commit e6b1bbd8acca3f6e174c24cf4eb23a66db2d08a2.
2010-01-26 10:28:52 -08:00
Nick Pelly
2b2c2e3a35 am 425324e9: am e834722f: Merge "Fix failure to open AVRCP input device due to EPERM." into eclair
Merge commit '425324e97bba75cd69bb6c81de6248529540e6fe'

* commit '425324e97bba75cd69bb6c81de6248529540e6fe':
  Fix failure to open AVRCP input device due to EPERM.
2010-01-25 18:12:47 -08:00
Eric Laurent
43c0b0a1f6 Fix issue 2378022: AudioService should direct volume control to STREAM_VOICE_CALL stream when STREAM_VOICE_CALL stream is active.
Modified AudioService.getActiveStreamType() so that STREAM_VOICE_CALL is selected when a track using this stream
type is playing.

Chanded isMusicActive() for a more generic isStreamActive(stream) method in AudioSystem, IAudioFlinger and AudioFlinger.
2010-01-25 14:00:10 -08:00
Wu-cheng Li
88eeff5270 Change key to KEY_SUPPORTED_JPEG_THUMBNAIL_SIZES for consistency.
bug:2375986
2010-01-25 15:20:23 +08:00
Chih-Chung Chang
703111327e Merge "Add support for 180/270 degrees rotation." 2010-01-22 18:08:23 -08:00
Chih-Chung Chang
5994a330ac Add support for 180/270 degrees rotation. 2010-01-22 16:30:39 -08:00
Mathias Agopian
519f29f5d8 Merge "return an error when Surface::lock() is called while the surface is already locked." 2010-01-22 11:52:08 -08:00
Mathias Agopian
9014726d89 return an error when Surface::lock() is called while the surface is already locked. 2010-01-22 11:47:55 -08:00
Chih-Chung Chang
52e7200b6e Add an orientation parameter for overlay, so we can do camera preview in portrait mode. 2010-01-21 20:20:08 -08:00
Mathias Agopian
edfd97c0f2 fix [2324665] texture leak in surfaceflinger when using camera 2010-01-21 16:29:34 -08:00
Mathias Agopian
8c3b597aa7 fix a texture leak introduced recently.
create the texture name once and for all for a given BufferSource
and make sure to recreate it when we're forced to delete the texture.
2010-01-21 16:27:30 -08:00
Nick Pelly
c81bb207c6 Fix failure to open AVRCP input device due to EPERM.
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
2010-01-20 19:56:24 -08:00
Mathias Agopian
5fdea8d5b0 fix [2363362] [Sapphire] Corrupted raw picture displayed during snapshot
handled all cases where the scale factor of a video is out of bounds of
supported scale factors in copybit.
2010-01-20 14:31:53 -08:00
Mathias Agopian
ecc99c003b part of fix for [2363362] [Sapphire] Corrupted raw picture displayed during snapshot
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.
2010-01-20 14:07:44 -08:00
Mathias Agopian
42d095aaa5 Merge "fix [2363506] [Sapphire] Video playback broken" 2010-01-20 13:44:53 -08:00
Mathias Agopian
1faed66086 fix [2363506] [Sapphire] Video playback broken
don't try to use copybit for incompatible buffers
2010-01-20 13:24:14 -08:00
Eric Laurent
da3529b468 Create base class for audio policy manager.
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.
2010-01-13 09:25:13 -08:00
Eric Laurent
8a468f2fd6 am 0c5cc224: am d20a55af: Merge change Iccfa50fe into eclair
Merge commit '0c5cc224b052654ee38d39effce427a47697481b'

* commit '0c5cc224b052654ee38d39effce427a47697481b':
  Fix issue 2323920: Notification & A2DP audio stutter.
2009-12-22 10:01:39 -08:00
Eric Laurent
7e2aad1e27 Fix issue 2323920: Notification & A2DP audio stutter.
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.
2009-12-22 09:06:46 -08:00
Mathias Agopian
839604c769 am f9b0e826: 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 '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
2009-12-11 01:16:08 -08:00
Mathias Agopian
f5430db059 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.
2009-12-11 00:56:10 -08:00
Mathias Agopian
3fb6f499f8 am 083a557c: fix [2319255] crash in openGL : from the media recorder stress test.
Merge commit '083a557c25e0032bc4900f335b6643d0badd09ce' into eclair-mr2

* commit '083a557c25e0032bc4900f335b6643d0badd09ce':
  fix [2319255] crash in openGL : from the media recorder stress test.
2009-12-10 19:48:05 -08:00
Android (Google) Code Review
2c05ff5518 Merge change I6478884a into eclair-mr2
* changes:
  Add string resource type inspection
2009-12-10 18:05:19 -08:00
Mathias Agopian
b2bf11e389 am 76169da0: fix [2315900] Monochrome camera preview screen after launching camera
Merge commit '76169da0e84b0fcf621aeac6141af3ee85bc7c1e' into eclair-mr2

* commit '76169da0e84b0fcf621aeac6141af3ee85bc7c1e':
  fix [2315900] Monochrome camera preview screen after launching camera
2009-12-10 17:40:41 -08:00
Mathias Agopian
495c1be363 am d8c752ef: Merge change Ib548dbb2 into eclair
Merge commit 'd8c752ef74bc6d8b412defe35caf1a19be15eb8b' into eclair-mr2

* commit 'd8c752ef74bc6d8b412defe35caf1a19be15eb8b':
  improve video performance to minimize the tearing effect seen in 720p movies
2009-12-10 16:43:09 -08:00
Mathias Agopian
8f03b47432 fix [2319255] crash in openGL : from the media recorder stress test.
never call eglCreateImageKHR() with a NULL native buffer, which can
happen in OOM conditions.
2009-12-10 15:59:08 -08:00
Kenny Root
ccb5b89029 Add string resource type inspection
Allows "aapt dump --values resource" to print out whether a string in a
ResStringPool is in UTF-8 or UTF-16 encoding.

Change-Id: I6478884a70a3b46fee862dece6cb33454fc34843
2009-12-10 14:22:08 -08:00
Mathias Agopian
c5e181f8b3 fix [2315900] Monochrome camera preview screen after launching camera
this was introduced by a recent change. when we try to figure out the size of
the yuv->rgb temporary buffer, the output resolution has not been computed yet
and an invalid buffer size is used. most of the time the allocation fails
and the system reverts to "standard" GL will uses onle the Y plane.

the allocation of the temporary buffer is moved to onDraw(), the first
time it is called, by that time, the window is positioned properly.
2009-12-09 15:26:29 -08:00
Dianne Hackborn
d0aeccebe2 Maybe really fix windows build. 2009-12-08 19:45:59 -08:00
Mathias Agopian
69ff5de1b7 improve video performance to minimize the tearing effect seen in 720p movies
always rescale videos to their target size using copybit during yuv->rgb
conversion. this improves performance of the GPU pass and doesn't require
linear filtering to be enabled. Also always use 16-bits buffers.

the average processing time for 720p dropped from ~50ms to ~30ms
2009-12-08 19:29:38 -08:00
Dianne Hackborn
c5b138995e Hopefully fix Windows build 2009-12-08 16:38:01 -08:00
Android (Google) Code Review
eb318fd88d Merge change I129483f8 into eclair-mr2
* changes:
  Optional use of UTF-8 strings in resource bundles
2009-12-08 13:41:38 -08:00
Dianne Hackborn
8c6cedc9bc Propagate background scheduling class across processes.
This is a very simply implementation: upon receiving an IPC, if the handling
thread is at a background priority (the driver will have taken care of
propagating this from the calling thread), then stick it in to the background
scheduling group.  Plus an API to turn this off for the process, which is
used by the system process.

This also pulls some of the code for managing scheduling classes out of
the Process JNI wrappers and in to some convenience methods in thread.h.
2009-12-07 19:11:14 -08:00
Kenny Root
92f5984d2c Optional use of UTF-8 strings in resource bundles
Allows the use of UTF-8 for packing resources instead of the
default of UTF-16 for Java. When strings are extracted from the
ResStringPool, they are converted to UTF-16 and the result is
cached for subsequent calls.

When using aapt to package, add in the "-8" switch to pack the
resources using UTF-8. This will result in the value, key, and
type strings as well as the compiled XML string values taking
significantly less space in the final application package in
most scenarios.

Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
2009-12-07 15:14:15 -08:00
Eric Laurent
7749a90e1e am 0a08029f: Fix issue 2306779: Runtime restart - Init failed at android.media.ToneGenerator.
Merge commit '0a08029fc9a370c6ef2a2a6fd1d800d9159b61f8' into eclair-mr2

* commit '0a08029fc9a370c6ef2a2a6fd1d800d9159b61f8':
  Fix issue  2306779: Runtime restart - Init failed at android.media.ToneGenerator.
2009-12-07 12:36:30 -08:00
Eric Laurent
fed9382a6a Fix issue 2306779: Runtime restart - Init failed at android.media.ToneGenerator.
The ToneGenerator failed to initialize because no more tracks were available in AudioFlinger mixer.

All tracks were used because the duplicating output was failing to free the tracks on audio hardware output mixer when exiting due to a misplaced test on output activity: output tracks where only freed if the duplicating output was active when exiting.

The fix consists in freeing the output tracks when the duplicating thread is destroyed without condition.
2009-12-07 12:30:22 -08:00
Eric Laurent
8aaf9a21bc am 6d42d806: Merge change I9cc489a2 into eclair
Merge commit '6d42d80653f2c41f3e72a878a1d9a6f9693b89f7' into eclair-mr2

* commit '6d42d80653f2c41f3e72a878a1d9a6f9693b89f7':
  Fix issue 2304669: VoiceIME: starting and canceling voice IME yields persistent "error 8" state on future attempts and breaks voice search.
2009-12-07 11:03:17 -08:00
Android (Google) Code Review
0aa2563bb7 Merge change I9cc489a2 into eclair
* changes:
  Fix issue 2304669: VoiceIME: starting and canceling voice IME yields persistent "error 8" state on future attempts and breaks voice search.
2009-12-07 11:00:54 -08:00
Eric Laurent
5291095089 Fix issue 2304669: VoiceIME: starting and canceling voice IME yields persistent "error 8" state on future attempts and breaks voice search.
Fixed AudioFlinger::openInput() broken in change ddb78e7753be03937ad57ce7c3c842c52bdad65e
so that an invalid IO handle (0) is returned in case of failure.
Applied the same correction to openOutput().
Modified RecordThread start procedure so that a failure occuring during the first read from audio input stream is detected and causes
the record start to fail.
Modified RecordThread stop procedure to make sure that audio input stream fd is closed before we exit the stop function.

Fixed AudioRecord JAVA and JNI implementation to take status of native AudioRecord::start() into account
and not change mRecordingState to RECORDSTATE_RECORDING if start fails.
2009-12-07 05:37:47 -08:00
Dima Zavin
0fe8a9bc4b am 0019215f: Revert "When using MDP, we needed to use a texture for diming."
Merge commit '0019215fc395ef12c191049b1903eeabf70859cf' into eclair-mr2

* commit '0019215fc395ef12c191049b1903eeabf70859cf':
  Revert "When using MDP, we needed to use a texture for diming."
2009-12-07 01:36:26 -08:00
Dima Zavin
a9ec9be195 Revert "When using MDP, we needed to use a texture for diming."
This reverts commit bf0c320afbf6bf2441916755ecb443b64afbe73f.
2009-12-07 00:17:06 -08:00
Erik Gilling
19b18d75fe am cef8d031: Merge change I00d0b54a into eclair
Merge commit 'cef8d031e842b773bbd6481b517996a185391e92' into eclair-mr2

* commit 'cef8d031e842b773bbd6481b517996a185391e92':
  surfaceflinger: remove un-cached buffer hack for SGX
2009-12-03 15:35:55 -08:00
Erik Gilling
1bd48776eb surfaceflinger: remove un-cached buffer hack for SGX
Signed-off-by: Erik Gilling <konkers@android.com>
2009-12-03 14:09:31 -08:00
Mathias Agopian
fd70b7f335 am 121a31ac: Merge change Id86beb99 into eclair
Merge commit '121a31ac3901fcb81c808da2b4a9a7cf66c12b7c' into eclair-mr2

* commit '121a31ac3901fcb81c808da2b4a9a7cf66c12b7c':
  fix [2291418] Camera preview cannot work in Emulator
2009-12-02 17:50:45 -08:00
Mathias Agopian
3e8a81e354 fix [2291418] Camera preview cannot work in Emulator
The image buffer used by glTexImage2d() would be uninitialized when no copybit engine
can be found.
We now always initialize images, since the abscence of copybit is not necessarily fatal.
2009-12-02 16:23:11 -08:00
Eric Laurent
b598e9f38d am 1ac56b60: Merge change Iac196e17 into eclair
Merge commit '1ac56b602aa6a1ac54c608e5a8b76f44638db23b' into eclair-mr2

* commit '1ac56b602aa6a1ac54c608e5a8b76f44638db23b':
  Fix issue 2292062: Audio freezes for three seconds when choosing ringtones with a headset connected and music playing.
2009-12-02 09:48:52 -08:00
Mathias Agopian
ca8fa5a7bf am 33ad0f9e: Merge change I0e44976a into eclair
Merge commit '33ad0f9ec8d47660b16ced45242a45f369fe2547' into eclair-mr2

* commit '33ad0f9ec8d47660b16ced45242a45f369fe2547':
  fix [2297155] SurfaceFlinger's freeze-timeout doesn't work
2009-12-02 09:47:48 -08:00
Android (Google) Code Review
9e50912d68 Merge change Iac196e17 into eclair
* changes:
  Fix issue 2292062: Audio freezes for three seconds when choosing ringtones with a headset connected and music playing.
2009-12-01 22:39:33 -08:00
Mathias Agopian
0408772e34 fix [2297155] SurfaceFlinger's freeze-timeout doesn't work
There was bug in the logic that calculated the relative timeout, the start time was
reset each time an event was received, which caused the timeout to never occur if
an application was constantly redrawing.

Now we always check for a timeout when we come back from the waitEvent() and
process the "anti-freeze" if needed, regardless of whether an event was received.
2009-12-01 17:23:28 -08:00
Mathias Agopian
5f1cc4826c am 8e4a110b: Merge change I5469a4ac into eclair
Merge commit '8e4a110b3e146b30b804d7e2cd0825bf56bd7d0f' into eclair-mr2

* commit '8e4a110b3e146b30b804d7e2cd0825bf56bd7d0f':
  fixed [2260070] display stopped updating
2009-12-01 17:10:08 -08:00
Eric Laurent
d3fc8ac6c5 Fix issue 2292062: Audio freezes for three seconds when choosing ringtones with a headset connected and music playing.
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.
2009-12-01 02:17:41 -08:00
Mathias Agopian
c61de17f14 fixed [2260070] display stopped updating
always check that the visible region isn't empty after all visible regions are recomputed
clear he freeze-lock if it is.
2009-11-30 11:15:41 -08:00
Eric Laurent
760971d097 Fix A2dpAudioInterface getParameters.
A2dpAudioInterface::getParameters() was prepending a ';' to the key value pair returned from underlying AudioHardwareInterface.
2009-11-25 06:08:44 -08:00
Mathias Agopian
2f0a0a58f6 When using MDP, we needed to use a texture for diming. 2009-11-23 22:41:36 -08:00
Android (Google) Code Review
151f4f6027 Merge change I49f02be9 into eclair
* changes:
  Issue 2265163: Audio still reported routed through earpiece on sholes
2009-11-21 00:18:24 -08:00
Dianne Hackborn
7b92d7ec36 Debugging for issue #2228381 android.view.InflateException
Binary XML file line #37: Error inflating class <unknown> after adding a secondary account

Now that I have these debug logs, I want to keep them since they will make
debugging these kinds of issues a lot easier in the future.  (Note in this
case there was no problem in the framework.)

Change-Id: If2b0bbeda4706b7c5dc1ba4a5db04b74f40e1543
2009-11-20 14:26:42 -08:00
Eric Laurent
09b4ba82d7 Issue 2265163: Audio still reported routed through earpiece on sholes
This is a second attempt to fix the audio routed to earpiece syndrom.
The root cause identified this time is the crash of an application having an active AudioTrack playing on the VOICE_CALL stream type.
When this happens, the AudioTrack destructor is not called and the audio policy manager is not notified of the track stop.
Results a situation where the VOICE_CALL stream is considered as always in use by audio policy manager which makes that audio is routed to earpiece.

The fix consists in moving the track start/stop/close notification to audio policiy manager from AudioTrack to AudioFlinger Track objet.
The net result is that in the case of a client application crash, the AudioFlinger TrackHandle object (which implements the remote side of the IAudioTrack binder interface) destructor is called which in turn destroys the Track object and we can notify the audio policy manager of the track stop and removal.

The same modification is made for AudioRecord although no bug related to record has been reported yet.
Also fixed a potential problem if record stop is called while the record thread is exiting.
2009-11-19 23:57:45 -08:00
Mathias Agopian
60f5d3694b backout a workaround that is not needed anymore
we had to add a call to glFinish() before glReadPixels() because of a bug in the GL ES
driver of a certain device. This is not needed anymore.
2009-11-19 15:52:28 -08:00
Mathias Agopian
713795a2e0 fix [2269022] The raw picture displayed post shutter seems to have low-resolution
Make sure to always enable linear filtering in LayerBuffer. This change doesn't affect
devices using overlays.
2009-11-19 14:46:26 -08:00
Mathias Agopian
9e911efc10 fix [2262591] Junk on screen in ERD46
since we're using the GPU for composition, don't use a texture for dimming,
instead simply use an alpha-blended quad.

also workaround what looks like a GL driver bug by calling glFinish() before
glReadPixels().
2009-11-16 14:55:36 -08:00
Mathias Agopian
dcaf29af10 addresses several bugs: 2206097, 2166583, 2261119, 2216759
2206097: Broken suggestions while composing message
2166583: Color artifacts with MDP dithering
2261119: Passion transition animations are rough
2216759: Screen flicker when dropdown list in background window shows or hides

This is part of enabling GPU composition instead of using the MDP. This change
is dependent on another change in the vendor project.

Specifically this change disables the use of EGLImageKHR for s/w buffers
for cache coherency reasons. memcpy is used instead.
2009-11-13 18:54:14 -08:00
Mathias Agopian
963abad79a fix some aspects of [2258746] native crash in launcher2
Surface::validate() could sometimes dereference a null pointer before checking it wasn't null.
This will prevent the application to crash when given bad parameters or used incorrectly.
However, the bug above probably has another cause.
2009-11-13 15:26:29 -08:00
Android (Google) Code Review
0b9285e707 Merge change Iad79689a into eclair
* changes:
  Improvements for issue 2197683:	English IME key-press latency is noticeably higher on passion than sholes
2009-11-12 22:53:28 -08:00
Rebecca Schultz Zavin
c0c1092183 Modify the binder to request 1M - 2 pages instead of 1M. The backing store
in the kernel requires a guard page, so 1M allocations fragment memory very
badly.  Subtracting a couple of pages so that they fit in a power of
two allows the kernel to make more efficient use of its virtual address space.

Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2009-11-12 16:31:12 -08:00
Android (Google) Code Review
ad55651fe7 Merge change I31c52bef into eclair
* changes:
  Revert change incorrectly submitted as part of change #32153.
2009-11-12 13:37:30 -08:00
Mathias Agopian
bbc21b01cf fix [2143798] Need to figure out how to do video on Passion w/ GPU
This builds on the EGLImage solution. We simply use copybit to convert from the
YUV frame into an EGLImage created for that purpose and proceed with the
regular EGLImage code.
We need to do this because "regular" GL doesn't support YUV textures.

We could improve upon this by detecting exacly what the GL supports and bypass
this extra step if not required, but we'll do this later if needed.
2009-11-11 16:44:43 -08:00
Eric Laurent
0e49d35fa4 Improvements for issue 2197683: English IME key-press latency is noticeably higher on passion than sholes
This change goes with a kernel driver change that reduces the audio buffer size from 4800 bytes (~27ms) to 3072 bytes (~17ms).
- The AudioFlinger modifcations in change 0bca68cfff161abbc992fec82dc7c88079dd1a36 have been removed: the short sleep period was counter productive when the AudioTrack is using the call back thread as it causes to many preemptions.
- AudioFlinger mixer thread now detects long standby exit time and in this case anticipates start by writing 0s as soon as a track is enabled even if not ready for mixing.
- AudioTrack::start() is modified to start call back thread before starting the IAudioTrack so that thread startup time is masked by IAudioTrack start and mixer thread wakeup time.
2009-11-11 12:13:27 -08:00
Eric Laurent
7b57085a73 AudioFlinger: delete Track object when createTrack() fails due to lack of tracks in AudioMixer.
This problem was encountered as a side effect of issue 2245298.
2009-11-09 04:45:39 -08:00
Android (Google) Code Review
5dc4fb0849 Merge change Ifb9d6df3 into eclair
* changes:
  More log for issue 2242381.
2009-11-08 22:58:34 -08:00
Christopher Tate
07d69893e1 Reset binder service threads' cgroup/priority after command completion
To prevent buggy command implementations from poisoning binder threads'
scheduling class & priority for future command execution, we now reset the
cgroup and thread priority to foreground/normal when a binder service thread
finishes executing the designated command.

Change-Id: Ibc0ab2485751453f6dc96fdb4eb877fd02796e3f
2009-11-08 14:29:02 -08:00
Eric Laurent
ee47d43ed3 More log for issue 2242381.
Added more log in system dump for AudioFlinger and AudioPolicyService to help debug issue 2242381 and other issues where the audio driver hangs.
2009-11-07 01:18:20 -08:00
Evan Millar
6dfe8f1ffa Revert jparks code from IPCThreadState. 2009-11-06 11:25:23 -08:00
Romain Guy
092fa4beaf Revert change incorrectly submitted as part of change #32153.
Change-Id: I31c52beff03c0d038a257fc151eff3b8da60eddc
2009-11-05 15:49:22 -08:00
Romain Guy
471afca7fc Prevent crash in Home when using widgets whose ids collide with Home's
resources.

Bug #2228943.

Approved by mcleron, triaged by ryanpc.

Change-Id: Idf40f3b09502ae5d0d3b9a6a72c265a2de2ffca2
2009-11-05 15:40:35 -08:00
Jason Parks
b5c4135333 When a thread is about to be put back onto the thread pool ensure that it is in the foreground cgroup. 2009-11-04 14:25:26 -08:00
Android (Google) Code Review
f19995856d Merge change If2fdad3b into eclair
* changes:
  Add a warning when we leave threads in the binder thread pool in the background scheduling group.
2009-11-03 16:29:22 -05:00
Jason Parks
dcd3958c50 Add a warning when we leave threads in the binder thread pool in the background scheduling group. 2009-11-03 13:10:15 -08:00
Eric Laurent
7f698b4c5c Log for issue 2203561.
Implemented AudioPolicyService dump().
Added detailed dump for AudioPolicyManageriGeneric when AudioPolicyService is dumped.
2009-11-03 09:33:35 -08:00
Android (Google) Code Review
368ad53c54 Merge change I36d0184e into eclair
* changes:
  fix[2228133] pixelflinger ignores the "vertical stride" leading to artifacts when playing back video
2009-11-02 21:26:54 -05:00
Mathias Agopian
6fee064809 fix[2228133] pixelflinger ignores the "vertical stride" leading to artifacts when playing back video
we lost the concept of vertical stride when moving video playback to EGLImage.
Here we bring it back in a somewhat hacky-way that will work only for the
softgl/mdp backend.
2009-11-02 17:48:33 -08:00
Dima Zavin
d7f53e1945 libbinder: MemoryHeapPmem: honor the NO_CACHING flag when creating a client heap
Change-Id: Ia7beb800f5a24beaa4b7f3032b486d4ed1991b23
Signed-off-by: Dima Zavin <dima@android.com>
2009-11-02 16:36:45 -08:00
Android (Google) Code Review
1bd16a1511 Merge change Ibaef6141 into eclair
* changes:
  libbinder: add a NO_CACHING flag to MemoryHeapBase
2009-11-02 17:55:43 -05:00
Eric Laurent
134aa9c942 Fix issue 197683: English IME key-press latency is noticeably higher on passion than sholes. Part 2.
Reduce sleep time in AudioFlinger mixer thread when no data has been written to output to speed up startup time when  exiting standby.

The rest of the modifications for this issues is in kernel driver:
 commit 0dbb0ee136ed8de757df1ae26d84556c1751deae for buffer size modification from 8192 to 4800 bytes.
Another kernel improvement that is not submitted yes will reduce delay when audio output is exiting standby.
2009-11-02 00:13:56 -08:00
Iliyan Malchev
0db1a8931b libbinder: add a NO_CACHING flag to MemoryHeapBase
The NO_CACHING flag translates to opening a memory region with O_SYNC.

Signed-off-by: Iliyan Malchev <malchev@google.com>
2009-10-30 18:35:47 -07:00
Android (Google) Code Review
fa4c9b8af8 Merge change Id8b28e4f into eclair
* changes:
  fix [2225964] Android runtime restarted in surfaceflinger/BlurFilter.cpp
2009-10-30 17:54:16 -04:00
Android (Google) Code Review
bd5a0027f4 Merge change I56779290 into eclair
* changes:
  fix[2222341] Soft reset while going back from camcorder settings
2009-10-30 17:54:10 -04:00
Android (Google) Code Review
b4d8fbb1a7 Merge change If007a2fa into eclair
* changes:
  return proper error code from eglCreateImageKHR
2009-10-30 17:54:03 -04:00
Mathias Agopian
863e5fdde8 fix[2222341] Soft reset while going back from camcorder settings
add a way to convert a mapped "pushbuffer" buffer to a gralloc handle
which then can be safely used by surfaceflinger, without including
gralloc_priv.h
2009-10-30 14:48:50 -07:00
Andy McFadden
550a11455a DO NOT MERGE: Another gcc 4.0.3 workaround.
Temporarily make a function public that doesn't need to be.  When
host gcc-4.0.3 is gone from the build servers we can undo this.

(Cherry-picked from eclair-mr2.)
2009-10-30 10:24:06 -07:00
Mathias Agopian
8889a8183c fix [2225964] Android runtime restarted in surfaceflinger/BlurFilter.cpp
crash was due to an unintialized variable, which caused the wrong bluring
format to be used and caused a memory overrrun.
2009-10-29 20:24:44 -07:00
Mathias Agopian
df2d929405 return proper error code from eglCreateImageKHR 2009-10-29 16:45:41 -07:00
Mathias Agopian
54ba51dff2 fix [2143798] Need to figure out how to do video
Use EGLImageKHR instead of copybit directly.
    We now have the basis to use streaming YUV textures (well, in fact
    we already are). When/if we use the GPU instead of the MDP we'll
    need to make sure it supports the appropriate YUV format.

    Also make sure we compile if EGL_ANDROID_image_native_buffer is not supported
2009-10-27 13:13:29 -07:00
Android (Google) Code Review
730ab0bc3b Merge change Icf10db28 into eclair
* changes:
  Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.
2009-10-24 04:32:28 -04:00
Mathias Agopian
57720c384a fix [2211532] improves sholes graphics performance
Instead of using glTex{Sub}Image2D() to refresh the textures, we're using an EGLImageKHR object
backed up by a gralloc buffer. The data is updated using memcpy(). This is faster than
glTex{Sub}Image2D() because the texture is not swizzled. It also uses less memory because
EGLImageKHW is not limited to power-of-two dimensions.
2009-10-23 15:37:28 -07:00
Eric Laurent
63da2b65f9 Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.
Added setVoiceVolume() method to AudioSystem, AudioFlinger, IAudioFlinger, AudioPolicyService.
Removed call to AudioHardwareInterface::setVoiceVolume() from AudioFlinger::setStreamVolume().
2009-10-21 12:29:37 -07:00
Mathias Agopian
38a7fa2ae3 fix [2182249] [MR1] valgrind error in surface flinger 2009-10-15 18:08:15 -07:00