Commit Graph

748 Commits

Author SHA1 Message Date
Kenny Root
c91e0eda56 Add invariant check for stylesString size
It was possible for stylesStrings to claim to start past the end of the
data area thereby making mStringPoolSize larger than the data area.

Change-Id: Ibc4d5b429e3a388516135801c8abc3681daae291
2010-06-08 20:50:37 -07:00
Mathias Agopian
67c4219aa3 am 34e5d967: am 55f8209d: Merge "allow re-targetting of surfaces" into kraken 2010-06-08 20:18:05 -07:00
Mathias Agopian
579b3f88d0 allow re-targetting of surfaces
Surfaces can now be parcelized and sent to remote
processes. When a surface crosses a process
boundary, it looses its connection with the
current process and gets attached to the new one.

Change-Id: I39c7b055bcd3ea1162ef2718d3d4b866bf7c81c0
2010-06-08 20:10:02 -07:00
Mathias Agopian
7b268e7967 am 37583aeb: am 1debc665: fix [2751143] Device crashes when in a text box for too long 2010-06-08 15:49:45 -07:00
Mathias Agopian
53503a97a9 fix [2751143] Device crashes when in a text box for too long 2010-06-08 15:40:56 -07:00
Kenny Root
615f5d64db Range checking for ResTable_map
Correct previous offset change and get ready for safe-iop.

Change-Id: Ib276c726f32b0711a72f47d3263eb21640e5a800
2010-06-08 12:51:49 -07:00
Kenny Root
61c22be593 Improve checking in aapt dump
The aapt dump reading had less error checking than the actual parsing,
so this change brings it more into parity so that bad APKs don't crash
"aapt dump"

Change-Id: Ib30e63e41be5c652645c4aa0de580a87b184529d
2010-06-08 10:28:19 -07:00
Mathias Agopian
fcd61524e8 am f5f7d389: am fae5cb2b: optimize Surface.readFromParcel() 2010-06-04 19:17:16 -07:00
Mathias Agopian
e78d81eddd am fd89b1c8: am 7623da43: split surface management from surface\'s buffers management 2010-06-04 19:17:12 -07:00
Mathias Agopian
a0b3ad88db am cfa6de70: am 593c05ce: clean-up client management. 2010-06-04 19:17:08 -07:00
Mathias Agopian
a0c30e9241 optimize Surface.readFromParcel()
this is called for each relayout() and used to create a full Surface (cpp)
which in turn did some heavy work (including an IPC with surfaceflinger),
most of the time to destroy it immediatelly when the returned surface
(the one in the parcel) was the same.

we now more intelligentely read from the parcel and construct the new
object only if needed.

Change-Id: Idfd40d9ac96ffc6d4ae5fd99bcc0773e131e2267
2010-06-04 18:57:41 -07:00
Mathias Agopian
b7e930db17 split surface management from surface's buffers management
Change-Id: If3c5655d1231f8f0c49ba68f972b1b20c93b3f87
2010-06-04 18:57:41 -07:00
Mathias Agopian
96f0819f81 clean-up client management.
simplified things a lot, the biggest change is that the concept
of "ClientID" is now gone, instead we simply use references.

Change-Id: Icbc57f80865884aa5f35ad0d0a0db26f19f9f7ce
2010-06-04 18:57:40 -07:00
Konstantin Lopyrev
bad51959c5 Fix 1684100: Making sure that empty package, type and resource ids are not accepted.
Change-Id: I4c94877e4312e9a5b4d22c8625069ca056c62e40
2010-06-04 14:37:37 -07:00
Eric Laurent
0d20832fbf am 030a1553: am 2ea200c5: Merge "Issue 2667801: [Audio Effect Framework] AudioFlinger, AudioMixer AudioTrack modifications." into kraken 2010-06-04 00:18:07 -07:00
Eric Laurent
eafff459aa Issue 2667801: [Audio Effect Framework] AudioFlinger, AudioMixer AudioTrack modifications.
First drop of audio framework modifications for audio effects support.

- AudioTrack/AudioRecord:
Added support for auxiliary effects in AudioTrack
Added support for audio sessions
Fixed left right channel inversion in setVolume()

- IAudioFlinger:
Added interface methods for effect enumeraiton and instantiation
Added support for audio sessions.

- IAudioTrack:
Added method to attach auxiliary effect.

- AudioFlinger
Created new classes to control effect engines in effect library and manage effect connections to tracks or
output mix:
  EffectModule: wrapper object controlling the effect engine implementation in the effect library. There
	is one EffectModule per instance of an effect in a given audio session
  EffectChain: group of effects associated to one audio session. There is one EffectChain per audio session.
	EffectChain for session 0 is for output mix effects, other chains are attached to audio tracks
	with same session ID. Each chain contains a variable number of EffectModules
  EffectHandle: implements the IEffect interface. There is one EffectHandle object for each application
	controlling (or using) an effect module. THe EffectModule maintians a list of EffectHandles.

Added support for effect modules and effect chains creation in PlaybackThread.
modified mixer thread loop to allow track volume control by effect modules and call effect processing.

-AudioMixer
Each track now specifies its output buffer used by mixer for accumulation
Modified mixer process functions to process tracks by groups of tracks with same buffer
Modified track process functions to support accumulation to auxiliary channel

Change-Id: I26d5f7c9e070a89bdd383e1a659f8b7ca150379c
2010-06-03 03:21:53 -07:00
Mathias Agopian
7704f5da75 am 7258fd92: am 5be7de5f: Merge "fix a bug where fading in/out of opaque 32-bits windows wasn\'t working" into kraken 2010-06-01 16:11:31 -07:00
Mathias Agopian
d13f23fca6 am 5220af87: am 770492cb: more clean-up in preparation of bigger changes 2010-06-01 16:08:48 -07:00
Mathias Agopian
49753266d2 fix a bug where fading in/out of opaque 32-bits windows wasn't working
opaque 32-bits windows are now allocated as RGBX_8888 buffers and
SurfaceFlinger always uses GL_MODULATE instead of trying to
optimize to GL_REPLACE when possible (makes no sense on
h/w accelerated GL).

we still have a small hack for devices that don't support
RGBX_8888 in their gralloc implementation where we revert to
RGBA_8888.
2010-06-01 15:57:44 -07:00
Mathias Agopian
7e27f05739 more clean-up in preparation of bigger changes
the most important change here is the renaming of
ISurfaceFlingerClient to ISurfaceComposerClient

Change-Id: I94e18b0417f50e06f21377446639c61f65f959b3
2010-05-28 17:19:16 -07:00
Mike Lockwood
3d11c77bae Merge "Move CursorWindow class from core/jni to libbinder" 2010-05-28 10:24:29 -07:00
Mathias Agopian
ea4412c1df am 6a9d88ff: am 64ff6ab4: Merge "more clean-up of Surfaceflinger\'s client management" into kraken 2010-05-28 09:35:08 -07:00
Mike Lockwood
244a7655ae Move CursorWindow class from core/jni to libbinder
To allow use of the native CursorWindow class outside of the core framework jni

Change-Id: I72e8dcb91a2c691130c33cdfd9a25d343da1c592
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-05-28 10:08:21 -04:00
Mathias Agopian
d4784a3b90 more clean-up of Surfaceflinger's client management
SurfaceComposerClient now only exist on the WindowManager side,
the client side uses the new SurfaceClient class, which only
exposes what a client needs.

also instead of keeping mappings from IBinder to SurfaceComposerClients
we have a SurfaceClient per Surface (referring to the same IBinder), this
is made possible by the fact that SurfaceClient is very light.

Change-Id: I6a1f7015424f07871632a25ed6a502c55abfcfa6
2010-05-27 19:55:43 -07:00
Mathias Agopian
5d4f4eaf84 am ec272924: am df0364de: Merge "minor clean-up GLclampx -> GLclampf" into kraken 2010-05-26 22:52:06 -07:00
Mathias Agopian
010fccb063 minor clean-up GLclampx -> GLclampf 2010-05-26 22:26:12 -07:00
Mathias Agopian
1d111ec85c am ed34e950: am d908822d: Merge "clean-up dead-code" into kraken 2010-05-26 22:23:40 -07:00
Mathias Agopian
dc7a80f07a clean-up dead-code 2010-05-26 22:19:19 -07:00
Mathias Agopian
adb1550d38 am 521b8d5c: am a950aa84: Merge "Make sure to use filtering while in fixed-size mode" into kraken 2010-05-26 22:14:43 -07:00
Mathias Agopian
a7f669256f Make sure to use filtering while in fixed-size mode 2010-05-26 22:10:04 -07:00
Mathias Agopian
4f20157df2 am 2a0f01ea: am 7ca7eedb: Merge "oopsie. forgot to displatch SET_BUFFERS_GEOMETRY" into kraken 2010-05-26 21:38:42 -07:00
Mathias Agopian
38ece279ea oopsie. forgot to displatch SET_BUFFERS_GEOMETRY 2010-05-26 21:31:09 -07:00
Mathias Agopian
5a733d4455 am eaac2761: am 64f7549b: Merge "fix [2712278] The preview buffer left some black borders in left and bottom edges" into kraken 2010-05-26 11:42:51 -07:00
Mathias Agopian
631f358d34 fix [2712278] The preview buffer left some black borders in left and bottom edges
we were incorrectly flagging push_buffer surfaces as invalid

Change-Id: I4dfd4ffbbe8a71f7e23e835db8d71966416c29bb
2010-05-25 17:51:34 -07:00
Eric Laurent
0b6a930096 Fix issue 2641884: Bluetooth volume is dependent on in call volume.
The problem is that the code in AudioPolicyManagerBase::checkAndSetVolume() that forces
voice volume to max when setting bluetooth SCO volume is not called if the bluetooth stream
volume did not actually change. So even if we re apply volumes when switching to bluetooth
device, the volume voice volume is not changed and remains what it was when routed to earpiece
What makes things worse on Passion is that stream volumes are limited when connected to bluetooth
and their actual value does not change as soon as they exceed the limit threshold.

Change-Id: I18265e5e6686db0a1f30fc37a31e2ecde4f3fbc6
2010-05-25 09:31:59 -07:00
Mathias Agopian
a138f89c5e added the notion of fixed-size buffers
the new native_window_set_buffers_geometry allows
to specify a size and format for all buffers to be
dequeued. the buffer will be scalled to the window's
size.

Change-Id: I2c378b85c88d29cdd827a5f319d5c704d79ba381
2010-05-24 18:26:01 -07:00
Mathias Agopian
a0b3f1d2eb fix a bug when reallocating a window's buffers is needed
we need to mark the buffers that need to be reallocated,
NOT the buffer's indices.

Change-Id: I809e2e1b03b56c4d2ab983c25523dae99aa1da74
2010-05-24 13:47:24 -07:00
Mathias Agopian
f10d7fde03 added native_window_set_buffer_count()
this method can be used to change the number of buffers
associated to a native window. the default is two.

Change-Id: I608b959e6b29d77f95edb23c31dc9b099a758f2f
2010-05-21 14:34:32 -07:00
Mathias Agopian
bb641244d7 fix the threading issue for setBuffercount()
this change introduces R/W locks in the right places.
on the server-side, it guarantees that setBufferCount()
is synchronized with "retire" and "resize".
on the client-side, it guarantees that setBufferCount()
is synchronized with "dequeue", "lockbuffer" and "queue"
2010-05-20 18:00:42 -07:00
Mathias Agopian
3fbd902c9e add a few tests to SharedBufferStackTest
Change-Id: I1c46c07aa1483aee4d4ebd8745638a2c462cc1b3
2010-05-17 20:08:22 -07:00
Mathias Agopian
cd45552c57 improve SharedBufferStack test
Change-Id: I32683bfe0916918757280db89113595867acd5a7
2010-05-17 18:56:10 -07:00
Mathias Agopian
b5c4577b88 fix a bug where queueBuffer() would fail after the SharedbufferStack is resized
Change-Id: I12bf13a62018ce1349bab7be0b0cad7fad13fee8
2010-05-17 18:54:19 -07:00
Mathias Agopian
d6297f7d09 fix some bugs in SharedBufferStack::resize
added buffers should now be labeled properly.

Change-Id: I28aa753fbe89ab89134e7753575319478934c7fa
2010-05-17 17:27:26 -07:00
Eric Laurent
4edfe75018 Fix issue 2553359: Pandora does not work well with Passion deskdock / Cardock.
The problem is due to a too big difference between the buffer size used at the hardware interface and at the A2DP interface.
When no resampling occurs we don't notice problems but the timing is very tight. As soon as resampling is activated, the AudioTrack underruns.
This is because the AudioTrack buffers are not resized when moving the AudioTrack from hardware to A2DP output.
The AudioTrack buffers are calculated based on a hardware output buffer size of 3072 bytes. Which is much less than the A2DP output buffer size (10240).

The solution consists in creating new tracks with new buffers in AudioFlinger when the A2DP output is opened
instead of just transfering active tracks from hardware output mixer thread to the new A2DP output mixer thread.
To avoid synchronization issues between mixer threads and client processes, this is done by invalidating tracks
by setting a flag in their control block and having AudioTrack release the handle on this track (IAudioTrack)
and create a new IAudioTrack when this flag is detected next time obtainBuffer() or start() is executed.

AudioFlinger modifications:
- invalidate the tracks when setStreamOutput() is called
- make sure that notifications of output opening/closing and change of stream type to output mapping are sent synchronously to client process.
This is necessary so that AudioSystem has the new stream to output mapping when the AudioTrack detects the invalidate flag in the client process.
Previously their were sent when the corresponding thread loop was executed.

AudioTrack modifications:
- move frame count calculation and verification from set() to createTrack() so that is is updated every time a new IAudioTrack is created.
- detect track invalidate flag in obtainBuffer() and start() and create a new IAudioTrack.

AudioTrackShared modifications
- group all flags (out, flowControlFlag, forceReady...) into a single bit filed to save space.

Change-Id: I9ac26b6192230627d35084e1449640caaf7d56ee
2010-05-17 02:23:47 -07:00
Mathias Agopian
0d184f0169 Merge "fix uninitialized variable in DisplayHardware" into kraken 2010-05-14 18:35:34 -07:00
Mathias Agopian
0d4e00dd6a fix uninitialized variable in DisplayHardware
this fixes the issue where the display is all messed-up sometimes.

Change-Id: I20be91b5166bfff0c6d353a777351842c9df8e95
2010-05-14 18:33:30 -07:00
The Android Open Source Project
0259a7534f am 900b6157: merge from open-source master
Merge commit '900b6157f5dee2ed7b2c73cf320b2baf293230ff' into kraken

* commit '900b6157f5dee2ed7b2c73cf320b2baf293230ff':
  Only hold a weak pointer on SurfaceComposerClients
2010-05-14 15:12:17 -07:00
The Android Open Source Project
4c53558835 merge from open-source master
Change-Id: I0249c6d796b35af9ba08cbccd463a1f5cf779ecd
2010-05-14 15:04:52 -07:00
Eric Laurent
e151216d38 AudioFlinger: rename variables to clarify reference to track channel count or channel mask
Some variables and structure members should be renamed to reflect the fact that they contain the
number of channels in a track (channel count) or the actual channels used by a track (channel mask).
Especially member "channels" of track control block (struct audio_track_cblk_t) is actually the
number of channels (channels count).

Change-Id: I220c8dede9fc00c8a5693389e790073b6ed307b8
2010-05-14 05:45:46 -07:00
Eric Laurent
7232215a17 Merge "Fix issue 2678048: binder death detection in AudioFlinger is broken." into kraken 2010-05-12 23:40:28 -07:00