Commit Graph

1254 Commits

Author SHA1 Message Date
Jamie Gennis f15a83f581 SurfaceFlinger: add a crop to the layer state
This change adds a crop rectangle specified in window coordinates to the layer
state.  The all window pixels outside this crop rectangle are treated as though
they were fully transparent.  This change also adds the plumbing necessary for
WindowManager to set that crop.

Change-Id: I582bc445dc8c97d4c943d4db8d582a6ef5a66081
2012-05-11 03:16:02 -07:00
Jean-Michel Trivi 3c32e5da5b Merge "OMX IL header additions for FLAC" into jb-dev 2012-05-10 09:53:44 -07:00
Jean-Michel Trivi 224c78405f OMX IL header additions for FLAC
Bug 5525503

Change-Id: I8d305d5351d3780f8ca933b8e602f2bf88e9ac78
2012-05-09 16:35:50 -07:00
Dianne Hackborn 555f89d8df Add callback hack to find out when to reload system properties.
Every IBinder object can accept a new transaction to tell it that
it might want to reload system properties, and in the process
anyone can register a callback to be executed when this happens.

Use this to reload the trace property.

This is very much ONLY for debugging.

Change-Id: I55c67c46f8f3fa9073bef0dfaab4577ed1d47eb4
2012-05-09 14:53:26 -07:00
Jamie Gennis 82c53806ad Merge "SurfaceTexture: improve texture matrix computation" into jb-dev 2012-05-09 12:52:25 -07:00
Jamie Gennis cae7c0b955 Merge "libgui: Add support for post-xform crops." into jb-dev 2012-05-09 12:51:57 -07:00
Jamie Gennis 59df82f355 Merge "libui: add the Rect::transform method" into jb-dev 2012-05-09 12:51:39 -07:00
Jamie Gennis 5c1139fea3 SurfaceTexture: improve texture matrix computation
This change reduces the shrinking of the crop rectangle in some cases.  It adds
a way to inform the SurfaceTexture that its texture will be used without
bilinear interpolation, and uses knowledge of the pixel format to avoid
shrinking unecessarily.

Change-Id: I72365f39f74ecb7fcc51b4cf42f2d0fa97727212
2012-05-08 17:08:33 -07:00
Jamie Gennis d72f233ffa libgui: Add support for post-xform crops.
This change adds support for specifying a crop rectangle to a
SurfaceTextureClient that is in post-transformed coordinate space.

Change-Id: I247901de343e71b32850f7ae3bac62dfa612ad3d
Bug: 6299171
2012-05-08 17:08:33 -07:00
Jamie Gennis 5933280430 libui: add the Rect::transform method
This change adds a method to Rect to transform a rectangle by a graphics HAL
transform.

Change-Id: Ic0d0988e731bdb5662faee41a5927b1242891658
Bug: 6299171
2012-05-07 15:25:52 -07:00
Glenn Kasten 5b38a1dfe8 Add audio tag to systrace
Change-Id: I4a558c43e4ccd81a4ed94684c5fad6b3c486bd14
2012-05-07 11:08:31 -07:00
Andy Stadler 081c80c2e0 Add System Tracing capability to Sync Manager
See also: Change-Id: Ia8bc01adbba345a568405b0ac8ade96e56b40cc1

Change-Id: I2678974cf85464fbc09072b06f647a0787e6e23f
2012-05-03 15:04:37 -07:00
Dianne Hackborn 627f471812 Merge "Add traces for window manager and activity manager." into jb-dev 2012-04-26 15:24:00 -07:00
Dianne Hackborn 1cb93ba130 Add traces for window manager and activity manager.
Change-Id: I6677ca64164f234efc7856ddd173ad6989b4f59e
2012-04-26 14:15:10 -07:00
Dave Burke 8e846fd6b3 Define OMX_AUDIO_AACObjectELD
Change-Id: Icfbcbddb46fc0bf185e00b193462bc9e035c222b
2012-04-25 22:04:04 -07:00
Jamie Gennis efc7ab6dce libgui: Add plumbing for active rectangle
This change adds the plumbing to SurfaceTextureClient, BufferQueue, and
SurfaceTexture to get the active rectangle passed to the ANativeWindow to
the buffer consumer.

Change-Id: I35da0889b266327ebb079b6a7136fa3e2e8b00e6
2012-04-24 17:34:38 -07:00
Mathias Agopian 2488b20aec add a way to query whether an ANativeWindow consumer is running ahead of the producer
Change-Id: Ibccfa1feb56db2ab11f0c0934ce2d570a2b65ae2
2012-04-23 20:06:02 -07:00
Mathias Agopian 24202f5676 update the binder protocol for connect to match that of queueBuffer
indeed, connect and queueBuffer return the same data, so it's
easier to have them use the same protocol.

Change-Id: I4f9fa3be0a80c9ab0a7a4039b282ae843aab02e1
2012-04-23 20:06:02 -07:00
Mathias Agopian a0db308c3d remove SurfaceTexture::connect()
use BufferQueue::connect() instead

Change-Id: I04aab7cf11304bf962cde38470747f3b19ddba42
2012-04-23 20:06:02 -07:00
Glenn Kasten 0f00cca168 Merge "Scheduling group cleanup" 2012-04-23 17:11:51 -07:00
Mathias Agopian 64a1e08b86 SF doesn't need more than a few binder threads
Change-Id: Ic4659fb81f9990cc7caf84a496a8ae659a1d16a9
2012-04-19 17:32:03 -07:00
Andreas Huber 383190e475 Allow the crypto plugin to specify error detail if it returns an error
in the range ERROR_DRM_VENDOR_MIN..ERROR_DRM_VENDOR_MAX.

Change-Id: Ic5d53e98cf6d98d92ad305d51f848e03d0bf3a84
related-to-bug: 6365261
2012-04-19 13:49:56 -07:00
Glenn Kasten a26e1cfbbc Scheduling group cleanup
Remove C++ APIs androidSetThreadSchedulingGroup and
androidGetThreadSchedulingGroup, and the ANDROID_TGROUP_* constants.

Former callers of these should now use the C APIs set_sched_policy and
get_sched_policy, and the SP_* constants.

Note: debug.sys.noschedgroups is not supported by the C APIs,
this needs to be discussed.

Change-Id: I32bbfc539ef4090faf9ef0320380e8cca9eae07c
2012-04-19 11:32:59 -07:00
Mathias Agopian 9798ff28b8 Merge "add set thread count" 2012-04-18 18:36:16 -07:00
Mathias Agopian 1b80f793d2 add set thread count
Change-Id: I70f02908d8362a465eb8a2a24356f6989847f7ba
2012-04-18 17:50:03 -07:00
Eino-Ville Talvala 85b217668d Remove fixed USAGE_HW_TEXTURE flag from BufferQueue.
USAGE_HW_TEXTURE applies to SurfaceTexture, not to all uses of
BufferQueue. Refactor accordingly.

Change-Id: Ic7add5e1f2bbec3d3e796ba7f15eaa0633945d8f
2012-04-18 10:56:06 -07:00
Jeff Brown 992b4c556b Merge "Support tokenizing arbitrary content." 2012-04-17 18:20:55 -07:00
Jeff Brown a8be8fa096 Support tokenizing arbitrary content.
Bug: 6110399
Change-Id: I37be63b68934fd451e6dffbf7d6079553619c0a3
2012-04-17 18:19:50 -07:00
Chris Craik 4851e21d2a Merge "Add webview tracing bit" 2012-04-17 10:04:42 -07:00
Mathias Agopian 3aecbb0715 fix Region const_iterator.
- it returned an empty rect when the region was empty, instead
of returning an empty list of rect.

- also fixed an infinite loop when boolean_operation was given
an empty list of rects

Change-Id: I62225c7dcd2832025bb8f12e6cb3762f2a7b36cb
2012-04-16 18:40:30 -07:00
Chris Craik 6acafadea0 Add webview tracing bit
Change-Id: I82e54f5eeb2666a255e372fd3bfcc54c1b3d76a0
2012-04-16 16:09:16 -07:00
Mathias Agopian ac6035a12a s/w rendered apps can now use n-buffering (n>2)
Bug: 6311881
Change-Id: I6e52e281e8d432430aad011f6d9dcf35d7b4ac7d
2012-04-13 16:04:44 -07:00
Daniel Lam 016c8cbce4 Enabled cropping support in SurfaceTexture
SurfaceTexture will modify the crop rect so it matches
the desired output aspect ratio when the scaling
mode is NATIVE_WINDOW_SCALING_MODE_CROP.  Added a test
for this new scaling mode.

Change-Id: I60f24dcbc294b65cd10a393d9e27d40f07d27bb6
2012-04-12 17:49:03 -07:00
Michael I. Gold 55a701459d SurfaceTextureClient: support for application buffer dimensions
Add a new API native_window_set_buffers_user_dimensions to allow native
applications to override the native window size for the default buffer size.
This has lower precedence than the existing
native_window_set_buffers_dimensions and allows the two to co-exist.

Change-Id: Ie73590e1c94ef0dadbce500bd0941dfabbcace3c
2012-04-11 18:37:54 -07:00
Mathias Agopian f0bc2f1d8d use in/out structures for queueBuffer() IPC
Change-Id: Ie125df2444b62a9a2200586a717dca268852afc9
2012-04-10 21:04:12 -07:00
Daniel Lam fbcda930dd BufferQueue returns proper code on acquire
Also removed unnecessary debug messages from
SurfaceTextureClient.

Change-Id: I291897a44170142f9d42a007b008823fad4683e0
2012-04-09 23:21:33 -07:00
Daniel Lam abe61bfda4 BufferQueue no longer hardcodes buffer counts
BufferQueue is now more flexible as it can be used
by SurfaceMediaSource in addition to SurfaceTexture.

Change-Id: I4222be8918d63372c44fcd412d9ad241c6a3eeb9
2012-04-06 21:02:13 -07:00
Jamie Gennis 8cce8a9a75 Merge "Fixed disconnect bug in SurfaceTexture" 2012-04-06 09:05:49 -07:00
Mathias Agopian 9b71221171 Merge "use a socketpair instead of a pipe in BitTube" 2012-04-03 15:38:10 -07:00
Andreas Huber cf0db31c32 New Crypto "HAL" API.
Change-Id: I225cdfeffb7663a2d639a01cfe704aa12f9014b8
related-to-bug: 6275919
2012-04-03 14:15:05 -07:00
Mathias Agopian 7b5be95cb3 use a socketpair instead of a pipe in BitTube
Bug: 6252830
Change-Id: Ia7a7b08409517214136261c05569dc5959a597ab
2012-04-02 18:41:10 -07:00
Yang Chuang a1ec30ef26 Add Japanese specific key codes
These keys are specific to Japanese hardware keyboard which can be
used by input method.

Patch ported from AOSP, with the addition of KANA.

Change-Id: I1474f0eb8971ed5d632822b1f9825c426f4817eb
2012-04-02 15:20:24 -07:00
Daniel Lam 9abe1ebc95 Fixed disconnect bug in SurfaceTexture
BufferQueue's disconnect could race with updateTexImage
where invalid buffers could be released.  Additionally
fixed similar bug with setBufferCount.  Tests were added
to stress the disconnect mechanism.

Change-Id: I9afa4c64f3e025984e8a9e8d924852a71d044716
2012-04-02 14:55:01 -07:00
Jamie Gennis 0e1080f887 Merge "SurfaceTexture: add context attach & detach" 2012-04-01 15:41:24 -07:00
Jamie Gennis 74bed55fff SurfaceTexture: add context attach & detach
This change adds the detachFromContext and attachToContext methods to
SurfaceTexture.  These methods allow the SurfaceTexture to switch from
one consumer GLES context to another.  This change also includes a few
cleanups to the error return codes in updateTexImage.

Change-Id: I0df1eb599aa7b6f58f07431f242f8f09269559ed
2012-03-30 16:47:28 -07:00
Mathias Agopian 851ef8f1bf reduce IPC with BufferQueue
collapse setCrop, setTransform and setScalingMode to queueBuffer()
this ends up simplifying things quite a bit and reducing the numnber
of IPC needed per frame.

Change-Id: I3a13c07603abe4e76b8251e6380b107fde22e6d9
2012-03-30 15:16:30 -07:00
Jamie Gennis 9285a16450 Merge "Refactored DummyConsumer" 2012-03-29 13:57:10 -07:00
Colin Cross b731ae01b1 Move services/powermanager from frameworks/base to frameworks/native
Move services/powermanager into frameworks/native so audioflinger can
use it.  Note that this is not the same as a PowerManagerService,
which is part of systemserver and handles turning the screen on and
off, etc.  This is just a binder interface to allow taking wakelocks.

Change-Id: I6b6a8b41cdbad17e826fda45aab5f059f22fc64e
2012-03-28 13:58:23 -07:00
Daniel Lam 9d61a28d72 Refactored DummyConsumer
DummyConsumer no longer uses a ProxyConsumerListener

Change-Id: I0a99428b3f9dae82cb47d5da3589de77653f3d7c
2012-03-27 16:47:12 -07:00
Jamie Gennis 87579669e0 Merge "Added a DummyConsumer for use with BufferQueue." 2012-03-26 17:17:49 -07:00
Daniel Lam f71c4ae136 Added a DummyConsumer for use with BufferQueue.
The DummyConsumer is a consumer that can connect to BufferQueue
that does nothing.  It is required as BufferQueue checks
if a consumer is connected.  Also fixes a bug where SurfaceTexture
was reusing old texture slots.

Bug: 6172739
Change-Id: I5e7a118dd4d07807ba4c763200242b5ee7d3412b
2012-03-26 15:29:35 -07:00
Glenn Kasten 0b94dcd03d mv libcpustats from frameworks/base to /native
OK to lose history

Change-Id: I563fec271e0bc240e4a09a8b9647c7439badd85b
2012-03-26 12:18:24 -07:00
Mathias Agopian e1c61d3cc8 move ndk headers to frameworks/native
Change-Id: Ib740333753818ff8f8230ed009211b447e30cbee
2012-03-23 14:19:36 -07:00
Mathias Agopian b0e76f456a remove dependency of EGL on ndk header
Change-Id: Ia6e489b5b4f028864bdf54923e81f604710dd8ad
2012-03-23 14:15:44 -07:00
Colin Cross 163d5a9fa7 frameworks/native: move Zip* from libandroidfw to libutils
ZipUtils is needed by build/tools, move it from libandroidfw
(frameworks/base) to libutils (frameworks/native).

Change-Id: Ib8c41134ccdec6d6aa8d49860f8dddef49a24783
2012-03-22 18:50:03 -07:00
Kenny Root 4639dcfb2a Add UniquePtr.h to frameworks/native
This is a copy of libcore's UniquePtr.h header which is used until we
get C++11 which has std::unique_ptr which is essentially the same.

Taken from libcore project at commit
3e6dd45baa0d7f9b4fa06f4ade76e088b59cc7bf

Change-Id: I7537b016f9eae33bfc4c57b24f86260909719ab8
2012-03-22 16:36:18 -07:00
Jamie Gennis de3b072b12 Merge "libgui: have ST::updateTexImage check the GL ctx" 2012-03-20 12:03:29 -07:00
Jamie Gennis 782cb13c12 Merge "libgui: add BQ consumer buffer free notifications" 2012-03-20 12:03:06 -07:00
Jamie Gennis ce56137218 libgui: have ST::updateTexImage check the GL ctx
This change adds a check to SurfaceTexture::updateTexImage to verify
that the current GL context is the same as the one that was used for
previous updateTexImage calls.

Change-Id: If02d2f787bcfdb528046dc9ddf6665f8a90e1bf4
2012-03-19 18:33:05 -07:00
Jamie Gennis fa5b40ebb8 libgui: add BQ consumer buffer free notifications
This change adds a new callback for BufferQueue consumers to be notified
when the BufferQueue frees some or all of its buffers.  This is needed
to retain SurfaceTexture behavior where all buffers would be freed when
the producer disconnects.  This change also modifies the
SurfaceTextureGLToGLTest.EglDestroySurfaceUnrefsBuffers test to catch
when the buffers are not freed.

The implementation is a little complicated because it needs to avoid
circular sp<> references across what will be a binder interface (so wp<>
can't be used directly).  It also needs to avoid the possibility of
locking the BufferQueue and consumer (e.g. SurfaceTexture) mutexes in
the wrong order.

This change also includes a few additional fixes and test cleanups.

Change-Id: I27b77d0af15cb4b135f4b63573f634f5f0da2182
2012-03-19 15:09:09 -07:00
Jeff Brown 0818b0921e Add a simple work queue abstraction.
Makes it easy to schedule a bunch of work to happen in parallel.

Change-Id: Id9c0e52fc8b6d78d2b9ed4c2ee47abce0a01775c
2012-03-17 14:28:38 -07:00
Jeff Brown e6d77c593d Add traits to common utils data structures.
Many of our basic data structures are trivially movable using
memcpy() even if they are not trivially constructable, destructable
or copyable.  It's worth taking advantage of this *ahem* trait.

Adding trivial_move_trait to String16 reduces appt running
time on frameworks/base/core/res by 40%!

Change-Id: I630a1a027e2d0ded96856e4ca042ea82906289fe
2012-03-16 16:21:21 -07:00
Andreas Huber 599ebfd48d Remove all traces of long obsolete OMXComponentBase class.
Change-Id: I749994fe1560363afc95beae45b66ea56a20caa8
2012-03-16 09:00:53 -07:00
Eino-Ville Talvala 642b9e58a3 Merge "Move CameraParameters.h to frameworks/native." 2012-03-15 10:33:59 -07:00
Eino-Ville Talvala 8c511a9d0c Move CameraParameters.h to frameworks/native.
CameraParameters.h is indirectly required to implement the Camera
HAL. Move it to frameworks/native.

Bug: 6171735
Change-Id: If4ccb273ea7ca79f54402ebc00febf1c3e59799f
2012-03-14 17:17:05 -07:00
Daniel Lam b267579ba8 SurfaceTexture: Fully refactored from BufferQueue
SurfaceTexture and BufferQueue are separate objects.

Change-Id: I230bc0ae6f78d0f9b2b5df902f40ab443ed5a055
2012-03-13 14:39:07 -07:00
James Dong 9f70b92f1b Copy one more file to /frameworks/native
o related-to-bug: 6044887

Change-Id: I920c487089eb258ada87603134f2597db6fe14e9
2012-03-12 18:55:13 -07:00
James Dong e56a585271 Merge "Copied some headers from /frameworks/base to /frameworks/native to support PDK effort" 2012-03-12 15:00:47 -07:00
Jeff Brown 4d0f967484 Merge "Expose the set of enabled tags." 2012-03-12 13:25:00 -07:00
James Dong 334de520b0 Copied some headers from /frameworks/base to /frameworks/native to support PDK effort
o added some minor header include changes
o related-to-bug: 6044887

Change-Id: Ia8e7ba861c509a4fb688ab2ed1e81151a708861a
2012-03-12 12:48:46 -07:00
James Dong e936584ac1 Move II420ColorConverter.h to /frameworks/native/include/media/editor
o related-to-bug: 6044894

Change-Id: Ib8f5406e32bd6c190d65e4a2e014f73e759d4415
2012-03-12 10:59:55 -07:00
Jeff Brown 45b80c69ad Expose the set of enabled tags.
This is used by the Java trace wrappers to avoid JNI overhead
when trace tags are disabled.

Also added a new tag for the input subsystem and view hierarchy.

Change-Id: Ia04a507e42a37b1d3bbb19859e6c07a92f4fe9aa
2012-03-09 15:43:12 -08:00
Andreas Huber bc48ce68e6 Instead of hardcoding OMX component names in our code, support
a config file instead.

Change-Id: I5835903ab9f1c4a22ccc605ca99ed966767adf57
2012-03-01 11:30:10 -08:00
Mathias Agopian 7a7524810a get rid of MemoryHeapPmem
MemoryHeapPmem is not used any longer. PMEM is not a supported
type of memory by the system anymore. a particular device might
use PMEM and need something like MemoryHeapPmem, in this case this
should be implemented in device specific code (HAL).

This will most likely break older no longer supported targets.

Change-Id: I434e4291219950018de8b793b0403bb2d92dd5cc
2012-02-27 19:58:57 -08:00
Mathias Agopian 89d353a4c5 move CursorWindow from libbinder to libandroidfw
Change-Id: I3b304e4f74e0d0ec8b20c57296c62449c9a0f792
2012-02-27 18:11:20 -08:00
Daniel Lam eae59d2ea7 Removed dependecies between BufferQueue and SurfaceTexture
Refactored SurfaceTexture and BufferQueue such that share
no protected members.  Created an consumer facing interface
for BufferQueue in preparation of connecting SurfaceTexture
and BufferQueue through a binder.

Change-Id: I938e63e085128148c58d0e26c7213b30145c109f
2012-02-27 16:40:48 -08:00
Jamie Gennis 015b842041 Merge "libutils: add a system-wide tracing utility" 2012-02-27 13:35:30 -08:00
Jamie Gennis fbb1655916 Merge "Revert "Removed dependecies between BufferQueue and SurfaceTexture"" 2012-02-27 13:23:51 -08:00
Mathias Agopian 90ac799241 fix libgui header location
Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
2012-02-27 13:03:08 -08:00
Mathias Agopian f91bb05132 split utils/threads.h into multiple headers
AndroidDefs.h - C/C++ enums and types
Mutex.h - Mutex class declaration
Condition.h - Condition class declaration
RWLock.h - RWLock class declaration
Thread.h - Thread class declaration
AndroidThreads.h - low-level thread creation functions
threads.h - includes all the above for backward source compatibility

Change-Id: Ia2f80c175333b59a41d1720985810bb2346e94cb
Note: implementations are still in Threads.cpp
2012-02-27 13:03:04 -08:00
Mathias Agopian 864d2afbb3 libagl shouldn't export anything
Change-Id: Ia823dbc56aab2a0b8a6063df4348fe6baac124c6
2012-02-27 13:03:04 -08:00
Daniel Lam 9b10c47e11 Revert "Removed dependecies between BufferQueue and SurfaceTexture"
This reverts commit a631399f71dbc7659d2f241968f85d337726ae61
2012-02-27 11:32:06 -08:00
Jamie Gennis 3216705634 Merge "Removed dependecies between BufferQueue and SurfaceTexture" 2012-02-26 17:06:42 -08:00
Jamie Gennis f64b1ca000 libutils: add a system-wide tracing utility
This change adds some utility functionality for doing userland tracing
into the kernel trace log.

Change-Id: Id0a8cee9ea515b1d8765afd1cecf472a88b4b9e8
2012-02-26 16:06:53 -08:00
Mathias Agopian 5f2165f945 remove dependency on android_native{s_priv|buffer}.h
Change-Id: Ie4b95f7061c240f37c504414259f92d72c4ffc89
2012-02-24 18:26:01 -08:00
Mathias Agopian 870b8aa15c remove libui dependency on libEGL
Change-Id: I1194f04085637d5c384e134967249430cc43b6ee
2012-02-24 16:42:46 -08:00
Mathias Agopian ff615cc7a1 deprecate L_8, LA_88 and RGB_332 in sdk
re-add support for pixelformats L_8, LA_88 and RGB_332 in libui
for backward compatibility.

This may or may not fix 6058926

Bug: 6049685
Change-Id: Ic1b8b4cc994522f7fe664da64c0ef76b98bc6d53
2012-02-24 14:58:36 -08:00
Jean-Baptiste Queru bd16dd1b38 am 32916f7a: am fc4215ee: am 2d03a93e: Merge "Xcode 4.3 compatibility checkin"
* commit '32916f7a22f2abf5c1e7021f44c2337ca172f2e5':
  Xcode 4.3 compatibility checkin
2012-02-23 12:22:35 -08:00
Daniel Lam 3330238841 Removed dependecies between BufferQueue and SurfaceTexture
Refactored SurfaceTexture and BufferQueue such that share
no protected members.  Created an consumer facing interface
for BufferQueue in preparation of connecting SurfaceTexture
and BufferQueue through a binder.

Change-Id: Iff55e740e36a7f70c9f7a17ee7a5af38e3d21f0f
2012-02-22 20:12:27 -08:00
Mathias Agopian 42e2458144 remove libui's dependency on libpixelflinger
this also remove support for unused pixelformats.

Change-Id: I2c759a6d2daa740f3786ed62095def8047ae933d
2012-02-21 18:56:08 -08:00
Al Sutton 579c2b4dc1 Xcode 4.3 compatibility checkin
The update compiler in Xcode 4.3 (and 4.4) requires lookups into dependant
bases of class templates to be qualified. This checkin fixes the issues
raised by the compiler by implementing the this-> recommendation from
the llvm page at http://clang.llvm.org/compatibility.html#dep_lookup_bases

Signed-off-by: Al Sutton <al@funkyandroid.com>
2012-02-19 08:31:19 +00:00
Mathias Agopian a3a3881208 frameworks/base refactoring.
step 2: move libutils headers to their new home: androidfw

Change-Id: I14624ba23db92a81f2cb929f104386e1fab293ef
2012-02-17 19:01:26 -08:00
Mathias Agopian 80c3918042 frameworks/base refactoring.
First step. Move libui includes to their new home: androidfw.

Change-Id: Ic042b52fdba72f30edc3cc6339bf30b4c1b99662
2012-02-17 15:36:10 -08:00
Jeff Brown 94d0070b96 Merge "Clean up InputChannel file descriptor data type." 2012-02-14 17:11:41 -08:00
Jamie Gennis 1eea29f48d Merge "Refactored query function from SurfaceTexture into BufferQueue" 2012-02-14 16:29:02 -08:00
Jeff Brown 9491e81ff6 Clean up InputChannel file descriptor data type.
File descriptors are ints.

Change-Id: Ie36733bf36ddfeaa9a09ef6ebd7bd2f1788f5d27
2012-02-14 15:57:59 -08:00
Glenn Kasten 87548ee2b3 Update comments
We no longer put the filename at start of file.

Change-Id: Ic435b159a23105681e3d4a6cb1ac097bc853302e
2012-02-14 09:17:59 -08:00
Jeff Brown a18829ab23 Accurately track the sequence numbers of batched events.
Instead of sending finished signals immediately when appending to
a batch, record the chain of sequence numbers that were part of
the batch and then send finished signals all at once when done.
This change helps the dispatcher keep track of the true state
of the application and can improve ANR detection slightly.

This is part of a series of changes to improve input system pipelining.

Bug: 5963420
Change-Id: I463c2221e2aa8fdf1c3d670c18e39e59ab69b0db
2012-02-13 13:59:32 -08:00
Jeff Brown 0a63adaff2 Enable deferred input messages to be batched.
This is part of a series of changes to improve input system pipelining.

Bug: 5963420
Change-Id: I6874d2128e880a35c6c33890c858cc6ee22af0fd
2012-02-13 12:44:01 -08:00
Jeff Brown f0490c94d0 Implement batching of input events on the consumer side.
To support this feature, the input dispatcher now allows input
events to be acknowledged out-of-order.  As a result, the
consumer can choose to defer handling an input event from one
device (because it is building a big batch) while continuing
to handle input events from other devices.

The InputEventReceiver now sends a notification when a batch
is pending.  The ViewRoot handles this notification by scheduling
a draw on the next sync.  When the draw happens, the InputEventReceiver
is instructed to consume all pending batched input events, the
input event queue is fully processed (as much as possible),
and then the ViewRoot performs traversals as usual.

With these changes in place, the input dispatch latency is
consistently less than one frame as long as the application itself
isn't stalled.  Input events are delivered to the application
as soon as possible and are handled as soon as possible.  In practice,
it is no longer possible for an application to build up a huge
backlog of touch events.

This is part of a series of changes to improve input system pipelining.

Bug: 5963420

Change-Id: I42c01117eca78f12d66d49a736c1c122346ccd1d
2012-02-13 10:28:41 -08:00
Jeff Brown 6cdee9831d Rewrite input transport using sockets.
Since we will not longer be modifying events in place, we don't need
to use an ashmem region for input.  Simplified the code to instead
use a socket of type SOCK_SEQPACKET.

This is part of a series of changes to improve input system pipelining.

Bug: 5963420

Change-Id: I05909075ed8b61b93900913e44c6db84857340d8
2012-02-13 10:28:40 -08:00
Dianne Hackborn a94f129a7b Some hardening of isolated processes by restricting access to services.
Services now must explicitly opt in to being accessed by isolated
processes.  Currently only the activity manager and surface flinger
allow this.  Activity manager is needed so that we can actually
bring up the process; SurfaceFlinger is needed to be able to get the
display information for creating the Configuration.  The SurfaceFlinger
should be safe because the app doesn't have access to the window
manager so can't actually get a surface to do anything with.

The activity manager now protects most of its entry points against
isolated processes.

Change-Id: I0dad8cb2c873575c4c7659c3c2a7eda8e98f46b0
2012-02-09 18:06:01 -08:00
Daniel Lam b856052c00 Refactored query function from SurfaceTexture into BufferQueue
Change-Id: Id1cb6cc38d01edb4fcfcad867c5a7693bdcc3ab1
2012-02-09 16:16:51 -08:00
Jamie Gennis d94bb5c883 Merge "Refactored ISurfaceTexture calls from SurfaceTexture into BufferQueue." 2012-02-09 11:08:02 -08:00
Romain Guy b8a2e98cd7 Preliminary support for clipRect(Rect, Op)
This adds basic support for clip regions. It is currently disabled at compile
time. Enabling clip regions will require setting up a stencil buffer.

Change-Id: I638616a972276e38737f8ac0633692c3845eaa74
2012-02-07 17:04:34 -08:00
Daniel Lam 6b091c5300 Refactored ISurfaceTexture calls from SurfaceTexture into BufferQueue.
Change-Id: I514f6b802f6b49c9ae27bed37bf0b9d23da03c9a
2012-02-07 13:57:01 -08:00
Amith Yamasani a11edd8dc1 Merge "Multi-user - 1st major checkin" 2012-02-03 12:04:40 -08:00
Amith Yamasani 4e975bb488 Multi-user - 1st major checkin
Switching activity stacks
Cache ContentProvider per user
Long-press power to switch users (on phone)

Added ServiceMap for separating services by user
Launch PendingIntents on the correct user's uid
Fix task switching from Recents list
AppWidgetService is mostly working.

Commands added to pm and am to allow creating and switching profiles.

Change-Id: I15810e8cfbe50a04bd3323a7ef5a8ff4230870ed
2012-02-03 12:01:47 -08:00
Mathias Agopian 064b68d1bc Merge "separate transactions from updates" 2012-02-02 16:28:05 -08:00
Glenn Kasten a1eee39f58 Merge "Thread::getTid returns pid_t gettid() after run" 2012-02-02 13:24:52 -08:00
Mathias Agopian 99ce5cdeb3 separate transactions from updates
with this changes, SF transactions are handled as soon as possible
but do not trigger updates. the update is delayed until the next
vsync.

this allows us to work much better without requiring triple-buffering.

Change-Id: I1fa10794d0cf742129f0877698b7b1e1f2ec7401
2012-02-01 20:43:06 -08:00
Mathias Agopian baf1c68c74 Merge "fix an issue with vsync event delivery" 2012-01-31 16:46:27 -08:00
Mathias Agopian 3cf199aef6 fix an issue with vsync event delivery
vsync events were sometimes delivered to connected
client who didn't request them. this happened if
another client requested the delivery and that client
was first in the client list.

also fix the vsync test which didn't request any events as
well as DisplayEventReveiver documentation which was misleading
about the necessity to request vsync events.

Change-Id: Ie990fda3f337f8f0042745c4b2cde67936c45686
2012-01-31 16:42:54 -08:00
Dianne Hackborn 60b133efc3 aapt now sorts the strings in the resource string pool.
In our current environment with very many translations, this can
save a lot of RAM -- for example over 200K in Gmail just by sorting
the strings in the Gmail .apk (not the framework).

Also add a new aapt command to print the contents of the resource
table string pool.

Change-Id: I1da037b3e2c377b890833ff57ab158965314ac48
2012-01-31 15:41:30 -08:00
Dianne Hackborn 907e08f2de Add xxhdpi; fix ActivityManager.getLauncherLargeIconSize() etc.
Change-Id: I519d6cdc527a402d93b98df17a64fc1da52ad598
2012-01-25 15:14:50 -08:00
Steve Block 5b11920b1a Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF)
Change-Id: I26f76452ac49e2890b14d133c065493d8df0fb4a
2012-01-19 14:44:56 -08:00
Steve Block 00469f1940 Rename (IF_)LOG() to (IF_)ALOG()
Change-Id: If49c81a2793182771c6160fbca93905daa6f44c1
2012-01-18 11:08:20 +00:00
Glenn Kasten ba699cb0f7 Thread::getTid returns pid_t gettid() after run
This is needed when the parent or any other thread besides the child
needs access to the child's kernel tid.

Change-Id: Ib148505913eb78314cfd76657c30d7b20663dffd
2012-01-17 09:38:23 -08:00
Jeff Brown fcc24a5b4d Merge "Fix compilation with Clang." 2012-01-13 15:16:59 -08:00
Evgeniy Stepanov 97470659e9 Fix compilation with Clang.
warning: extraneous template parameter list in template specialization
template<>

Change-Id: If3e3e1d06a018343b40ac0984dfd9ecc12629f8d
2012-01-13 15:33:54 +04:00
Mathias Agopian 55ef343331 remove dead/usnused code
Change-Id: I6fa2bc6ee01790abd2c1533f043d61a5e5c8d26e
2012-01-11 22:03:41 -08:00
Steve Block e6f43ddce7 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-08 13:19:13 +00:00
Steve Block a19954ab37 Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00:00
Joe Onorato 99c520a069 Add a new ui mode for "appliance"
The idea is that this is a device which is more-or-less headless.  It
might have some limited interaction capabilities, but it's not something
that you want to rely on having.

Change-Id: Ib92f53a120bf83de781728011721a4859def7d9f
2011-12-15 16:16:14 -08:00
Romain Guy b634cd3f13 Merge "GenerationCache::get would return a random value instead of NULL Bug #5401917" 2011-12-08 18:51:03 -08:00
Romain Guy 870165d2a2 GenerationCache::get would return a random value instead of NULL
Bug #5401917

This was causing a ton of random crashes in apps.

Change-Id: I9069a060824ec89115cd3bcd38beaeb9ecc4488e
2011-12-08 18:50:27 -08:00
Mathias Agopian 478ae5eb5a Improve the VSYNC api a bit.
- add the ability to set the vsync delivery rate, when the rate is
set to N>1 (ie: receive every N vsync), SF process' is woken up for
all of vsync, but clients only see the every N events.

- add the concept of one-shot vsync events, with a call-back
to request the next one. currently the call-back is a binder IPC.

Change-Id: I09f71df0b0ba0d88ed997645e2e2497d553c9a1b
2011-12-06 22:43:10 -08:00
Mathias Agopian a4fbecd119 am 55d3880e: am bb1e7d43: Merge changes I7e973a35,Ib3386fcc into ics-mr1
* commit '55d3880eed3450748eb7b97281e030902ee29c2a':
  SurfaceTexture: add EGL_KHR_fence_sync option
  SurfaceTexture: add a blit-to-FBO test
2011-11-30 10:50:52 -08:00
Jamie Gennis 27d22dc862 am c040e1e7: am 6f1dd757: Merge "SurfaceMediaSource: use the vid enc usage bit" into ics-mr1
* commit 'c040e1e77923d81050f2d3dbdac5d07e01be72f6':
  SurfaceMediaSource: use the vid enc usage bit
2011-11-30 10:50:49 -08:00
Mathias Agopian 0c740a46d2 Merge changes I7e973a35,Ib3386fcc into ics-mr1
* changes:
  SurfaceTexture: add EGL_KHR_fence_sync option
  SurfaceTexture: add a blit-to-FBO test
2011-11-29 17:46:35 -08:00
Jamie Gennis e06a1748a4 Merge "SurfaceMediaSource: use the vid enc usage bit" into ics-mr1 2011-11-29 17:25:09 -08:00
Jamie Gennis 86edf4f647 SurfaceTexture: add EGL_KHR_fence_sync option
This change adds a compile-time option for SurfaceTexture to use the
EGL_KHR_fence_sync extension to synchronize access to Gralloc buffers.

Bug: 5122031
Change-Id: I7e973a358631fff5308acf377581b811911fe790
2011-11-29 17:09:01 -08:00
Jeff Brown 47c70d98d4 am c339fe30: am be6ab576: Merge "Fix application launch shortcuts." into ics-mr1
* commit 'c339fe302bc5083f0a110569eec06676be511088':
  Fix application launch shortcuts.
2011-11-29 13:17:42 -08:00
Mathias Agopian d0566bc26f Add support for sending VSYNC events to the framework
use gui/DisplayEvent to receive the events. Events are
dispatched through a unix pipe, so the API is compatible
with utils/Looper. see gui/DisplayEvent.h for more info.

Bug: 1475048
Change-Id: Ia720f64d1b950328b47b22c6a86042e481d35f09
2011-11-29 13:10:25 -08:00
Mathias Agopian 439cf8576d Fix build.
Revert "Add support for sending VSYNC events to the framework"

This reverts commit f3918c5bd4bc9f02f74da42995564150ca2dd382.

Change-Id: I998e3e1aa3fa310829ae973b64fe11b01f6f468f
2011-11-29 13:07:40 -08:00
Jeff Brown 9ee44c8f94 Fix application launch shortcuts.
Improved quick launch bookmarks to support category-based shortcuts
instead of hardcoding package and class names for all apps.

Added a set of Intent categories for typical applications on the
platform.

Added support for some of the HID application launch usages to
reduce reliance on quick launch for special purpose keys.  Some
keyboard vendors have hardcoded launch keys that synthesize
"Search + X" type key combos.  The goal is to encourage them
to stop doing this by implementing more of HID.

Bug: 5674723
Change-Id: I79f1147c65a208efc3f67228c9f0fa5cd050c593
2011-11-29 12:17:22 -08:00
Mathias Agopian 461afeb9fd Add support for sending VSYNC events to the framework
use gui/DisplayEvent to receive the events. Events are
dispatched through a unix pipe, so the API is compatible
with utils/Looper. see gui/DisplayEvent.h for more info.

Bug: 1475048
Change-Id: If4126023fc9c067e56087ec7d16a8fd542ce1794
2011-11-29 11:44:05 -08:00
Mathias Agopian 41f673c9b3 split ComposerService out of SurfaceComposerClient.h
Change-Id: I1eb691f7ca263d5895d871ab675bb5826e0323c6
2011-11-28 15:21:57 -08:00
Jeff Brown 48585f35c7 Use sized integer typedefs in hash_type specializations.
Change-Id: I3f9e004db2f3be1cb43a885c3ae142f251fd6845
2011-11-24 11:54:21 -08:00
Jeff Brown 66fbde3050 Add a basic hashtable data structure, with tests!
The basic hashtable is intended to be used to support a variety
of different datastructures such as map, set, multimap,
multiset, linkedmap, generationcache, etc.

Consequently its interface is fairly primitive.

The basic hashtable supports copy-on-write style functionality
using SharedBuffer.

The change introduces a simple generic function in TypeHelpers for
specifying hash functions.  The idea is to add template
specializations of hash_type<T> next to the relevant data structures
such as String8, String16, sp<T>, etc.

Change-Id: I2c479229e9d4527b4fbfe3b8b04776a2fd32c973
2011-11-22 17:12:22 -08:00
Jamie Gennis 185a0a0420 am c2597295: am 53cf2020: Merge changes I37fd43b5,I91eb29db,I0491ce35 into ics-mr1
* commit 'c25972950c2ea62fb085524dbe737c2bf0f08f4a':
  SurfaceTexture: fix a couple tests
  EGL: default to swap interval 1
  SurfaceTexture: clean up some tests
2011-11-21 21:08:21 -08:00
Jamie Gennis b7d87c40ef SurfaceMediaSource: use the vid enc usage bit
This change makes SurfaceMediaSource add the VIDEO_ENC usage bit when
allocating its GraphicBuffers rather than the HW_TEXTURE bit.

Change-Id: Ie20e225c894fdbc31cad6bb82b3b64c7e98074eb
2011-11-21 17:48:19 -08:00
Jamie Gennis 59769469e4 EGL: default to swap interval 1
This change explicitly sets swap interval 1 on the window when an
EGLSurface is created to render to it.

Change-Id: I91eb29dbee3ae4a55076b921f084d503fbe94e03
2011-11-21 14:37:29 -08:00
Mathias Agopian 8bee68fac2 am d0df44b5: am 4d71053b: Merge "attempt to fix bug 5313580" into ics-mr1
* commit 'd0df44b5c979e00a19187cea35768ba26557e447':
  attempt to fix bug 5313580
2011-11-18 15:22:59 -08:00
Mathias Agopian a36bcd53ac attempt to fix bug 5313580
the working theory here is that a Surface object has become non-promotable
because it lost its last reference; later Surface::readFromParcel is called
the previous surface is found in the cache, but can't be promoted. this causes
a new Surface object to be created which will promptly try to connect to the
CPU_API -- this in turn will fail because the previous (now dead) surface is
still connected.

To fix this, we make sure to disconnect from the SurfaceTexture when
Surface[TextureClient] is destroyed.

Change-Id: I422234868a05d7b7d283e9d5a85f7ab79e65d8a9
2011-11-17 18:46:09 -08:00
Jamie Gennis ccf5b9febc am 7765fc65: am fd6b64f6: Merge "SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call" into ics-mr1
* commit '7765fc651a9519dd2f0ac9d3374a50e9865c5c99':
  SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call
2011-11-17 05:46:00 -08:00
Jamie Gennis c1ef3c4d7d Merge "SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call" into ics-mr1 2011-11-16 11:34:30 -08:00
Jeff Brown 0c5ccc081a am 4c0e0dd2: am 3e7497b4: Merge "Eliminate hw.keyboards system properties." into ics-mr1
* commit '4c0e0dd29dcce33e7521b11d01d21d9431f3b264':
  Eliminate hw.keyboards system properties.
2011-11-15 19:43:35 -08:00
Jeff Brown 882b0a59d8 Eliminate hw.keyboards system properties.
Stop using system properties to publish information about
the key character map path.  Instead, we can retrieve it
on demand by asking the window manager.

It was possible to exhaust the supply of system properties
when repeatedly adding and removing input devices.

Bug: 5532806
Change-Id: Idd361a24ad7db2edc185c8546db7fb05f9c28669
2011-11-15 18:00:10 -08:00
Sunita Nadampalli a929748ddb SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call
Surface Texture dequeue logic is modified to return the oldest of the
free buffers to Client on dequeue call.

Currently dequeue method is returning the first buffer index which is free.
The parsing is done in ascending order of the buffer slot indices.
This leads to returning the buffer which has been just queued to composer,
and hence display, and this defeats the purpose of having minimum dequeue count
as 2 in asynchrnouse mode.

This is fixed by checking all the free slots and returning the oldest buffer.

Change-Id: Ibbac10593c3994c278c601af0480b171635ecdd4
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
2011-11-15 11:43:35 -08:00
Jeff Brown 4e8650d546 Merge "Clean up GenerationCache." 2011-11-14 18:28:59 -08:00
Mathias Agopian 8c11963dda am 738d8cae: am c93a151f: Merge "Define, document, and test the behavior of very large SurfaceTextures" into ics-mr1
* commit '738d8cae2239d194429676f2889cfae3c8f7ba08':
  Define, document, and test the behavior of very large SurfaceTextures
2011-11-14 11:54:38 -08:00
Jeff Brown b4293fe408 Clean up GenerationCache.
Use const references to keys and values where appropriate to avoid
copying them unnecessarily.

Deleted some dead code.

Simplified a few pieces that were doing unnecessary redundant work.

Change-Id: Ib2145b7094a40db2d679e05dafe050fe1e87b846
2011-11-11 22:14:07 -08:00
Mathias Agopian 194c76c047 Define, document, and test the behavior of very large SurfaceTextures
updateTexImage() now throws a runtime exception when its native
counterpart fails

Bug: 5506633

Change-Id: I151a6f685d465966e7df4df624412ab2da62e95f
2011-11-11 18:44:35 -08:00
Jeff Brown c17f56fdf1 am 88061d6b: am 5462bc63: Fix a leak in Parcel::writeBlob.
* commit '88061d6b38cfb4bf374039846b753a3b21ac61e1':
  Fix a leak in Parcel::writeBlob.
2011-11-07 15:51:31 +00:00
Jeff Brown efd912c05c am 5462bc63: Fix a leak in Parcel::writeBlob.
* commit '5462bc6318b4b70e7a58c66994e2bd79f59d9739':
  Fix a leak in Parcel::writeBlob.
2011-11-05 02:35:57 +00:00
Jeff Brown 93ff1f985e Fix a leak in Parcel::writeBlob.
Was mistakenly assuming that Parcel::writeFileDescriptor took
ownership of the fd that was passed in.  It does not!
Added some comments and a default parameter to allow the caller
to specify whether it wishes the Parcel to take ownership.

Bug: 5563374
Change-Id: I5a12f51d582bf246ce90133cce7690bb9bca93f6
2011-11-04 19:26:03 -07:00
Jamie Gennis 7fbb39960e am 236aea35: Merge changes Ibc99cb1c,Ie1f4f6f8 into ics-mr1
* commit '236aea3579787961fdd41d87574760b63323c0c1':
  BlobCache: implement cache serialization
  BlobCache: remove the mutex locking
2011-11-03 18:55:14 +00:00
Jamie Gennis 0e1bc17429 BlobCache: implement cache serialization
This change adds serialization and deserialization functionality to
BlobCache, conforming to the Flattenable interface.

Change-Id: Ibc99cb1c3d015f363d57d0713eabccec07ff975e
2011-10-31 18:49:32 -07:00
Jamie Gennis 93ca6fb91c BlobCache: remove the mutex locking
This change removes the mutex from the BlobCache class.  The caller must
be responsible for thread synchronization in order to properly implement
the Flattenable interface, which is coming soon.  Otherwise would be the
potential for the cache contents to change between the call to the
getFlattenedSize and flatten methods.  Because the caller must do this
synchronization anyway there's no reason to also some synchronization
inside BlobCache.

Change-Id: Ie1f4f6f82b78744f46a41ce863cac0cad276a20e
2011-10-31 18:48:31 -07:00
Mathias Agopian 7796e962da Merge "Rename SensorChannel to BitTube" 2011-10-26 12:51:44 -07:00
Steve Block 9f760150f6 Rename (IF_)LOG() to (IF_)ALOG() DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/141576

Bug: 5449033
Change-Id: I42575e7c29cf1c0f465c357a5c97ab118df6f473
2011-10-25 16:28:24 +01:00
Jeff Brown e27d62bbf2 Use libcorkscrew for stack unwinding.
Change-Id: Iee1ee5a2018ab8cfc1ce12ec2a124809245eaa02
2011-10-22 15:44:12 -07:00
Mathias Agopian 5cae0d0699 Rename SensorChannel to BitTube 2011-10-20 18:42:02 -07:00
Dave Burke 818fb24357 am 70ac412b: Merge "Add a LayerScreenshot" into ics-mr0
* commit '70ac412b2fe7be2507189a9fdfb30c43b36d56ac':
  Add a LayerScreenshot
2011-10-18 23:00:08 -07:00
Mathias Agopian 118d0245ee Add a LayerScreenshot
A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Make sure to call compositionComplete() after rendering into a FBO.

Bug: 5446982, 5467587, 5466259
Change-Id: I5d8a1b4c327f9973d950cd4f4c0bca7f62825cd4
2011-10-18 20:21:47 -07:00
Mathias Agopian 7731f4eb63 am 9a0732af: Merge "SensorManager reconnects to sensor service when the later dies" into ics-mr0
* commit '9a0732af1bd96a7d8247dee124a7da389137a52f':
  SensorManager reconnects to sensor service when the later dies
2011-10-17 15:52:31 -07:00
Mathias Agopian 0ee55fd4e5 Merge "SensorManager reconnects to sensor service when the later dies" into ics-mr0 2011-10-17 15:50:36 -07:00
Mathias Agopian cdec8f01aa am 840b8a67: Revert "Add a LayerScreenshot"
* commit '840b8a678537519c27ddf2f818494eaa20a135d4':
  Revert "Add a LayerScreenshot"
2011-10-17 11:32:19 -07:00
Elliott Hughes 090cb44b94 Merge branch 'master' of ssh://android-git:29418/platform/frameworks/base 2011-10-17 11:32:08 -07:00
Jamie Gennis cb2de7182e Merge changes I4e5ff00c,Id5e3ca1d,I97cbba61
* changes:
  SurfaceFlinger: Remove display freezing code
  SurfaceFlinger: add some layer update tests
  SurfaceFlinger: make sync transactions explicit
2011-10-17 11:31:39 -07:00
Mathias Agopian c33f784c4b am 57337eb7: Merge "Add a LayerScreenshot" into ics-mr0
* commit '57337eb78e65c160fb9c46a01e04c476d1bfdca1':
  Add a LayerScreenshot
2011-10-17 11:30:33 -07:00
Mathias Agopian e9800c8311 Revert "Add a LayerScreenshot"
This reverts commit d6809f40cf61203573ec5dbc437f695cd132cc18.
2011-10-16 23:54:25 -07:00
Mathias Agopian 1a2b83a17d SensorManager reconnects to sensor service when the later dies
if system process ever restarted, processes using a SensorManager
would loose the ability to use it, resulting to a crash.
we now listen for sensor service death and reconnected if necessary.

Bug: 5445240
Change-Id: Ia47f8b26cdcecb729fa22bf11d55e10fcaef8cfc
2011-10-16 22:15:23 -07:00
Jamie Gennis a402c4c991 SurfaceFlinger: Remove display freezing code
This change removes the dead code from SurfaceFlinger that resulted from
disabling support for freezing the display.

Change-Id: I4e5ff00c94b4c7a79af2f65c9850c135210068ed
2011-10-14 16:44:08 -07:00
Jamie Gennis 28378392fd SurfaceFlinger: make sync transactions explicit
This change enables a layer or orientation update transaction sent to
SurfaceFlinger to explicitly request a synchronous transaction.

Change-Id: I97cbba610c13679849f66114b216fa6dbf12f2a9
2011-10-14 16:11:51 -07:00
Mathias Agopian f171ab6da9 Add a LayerScreenshot
A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Bug: 5446982
Change-Id: I7814aff2380e7e146937f2b641907be2a30c76cc
2011-10-14 14:32:48 -07:00
Jeff Brown 3e2fb7056a Deprecate local-only CursorWindows.
There is no difference and has never really been a difference
between local-only and remotable CursorWindows.  By removing the
distinction officially in the API, we will make it easier to
implement CrossProcessCursor correctly.  CrossProcessCursor
is problematic currently because it's not clear whether a call
to getWindow() will return a local-only window or a remotable window.
As a result, the bulk cursor adaptor has special case handling
for AbstractWindowedCursors vs. ordinary CrossProcessCursors
so that it can set a remotable window before the cursor fills it.
All these problems go away if we just forget about local-only
windows being special in any way.

Change-Id: Ie59f517968e33d0ecb239c3c4f60206495e8f376
2011-10-12 22:19:41 -07:00
Romain Guy 0d602e072c Merge "Reduce the size of libhwui by 50%" 2011-10-12 13:50:11 -07:00
Romain Guy 5c78b6861f Reduce the size of libhwui by 50%
This change removes unnessary symbols. All symbols are hidden by
default, public APIs with exported symbols are explicitly marked
with ANDROID_API.

Change-Id: I692fde432a86c12108de1cfd1f6504919a7d5f3f
2011-10-12 13:48:51 -07:00
Jamie Gennis a799380eea Merge "SurfaceFlinger: update orientation via transactions" into ics-mr0 2011-10-12 13:03:11 -07:00
Jamie Gennis b8d69a55f1 SurfaceFlinger: update orientation via transactions
This change merges the ISurfaceComposer::setOrientation functionality
into ISurfaceComposer::setTransactionState.  It enables the window
manager to atomically update both the display orientation and the
position and size of the windows in a single transaction with
SurfaceFlinger.

Bug: 5439574
Change-Id: I18a8ccc564d7d760ef8afb2d015ccdb7a7963900
2011-10-11 13:34:01 -07:00
Jeff Brown ec4e0063a1 Use ashmem for CursorWindows.
Bug: 5332296

The memory dealer introduces additional delays for reclaiming
the memory owned by CursorWindows because the Binder object must
be finalized.  Using ashmem instead gives CursorWindow more
direct control over the lifetime of the shared memory region.

The provider now allocates the CursorWindows and returns them
to clients with a read-only protection bit set on the ashmem
region.

Improved the encapsulation of CursorWindow.  Callers shouldn't
need to care about details like how string fields are allocated.

Removed the compile-time configuration of string and numeric
storage modes to remove some dead weight.

Change-Id: I07c2bc2a9c573d7e435dcaecd269d25ea9807acd
2011-10-11 11:03:19 -07:00
Jeff Brown de27227026 Fix regression in CursorWindow.copyStingToBuffer.
Bug: 5332296

Change-Id: Iff9eed786f0a8293b6156f883a66a322ddad5e99
2011-10-07 13:28:18 -07:00
Jeff Brown cc0bf53f21 Clean up CursorWindow code.
Bug: 5332296

The code is functionally equivalent, but a little more efficient
and much easier to maintain.

Change-Id: I90670a13799df05831843a5137ab234929281b7c
2011-10-06 14:40:13 -07:00
Dianne Hackborn 7746cc3188 Fix handling of "allow fds" state.
Didn't take into account nesting of bundles.  Boo.

Change-Id: Ic8cf21ad8d6f4938a3e105128624c9d162310d01
2011-10-03 21:09:35 -07:00
Jeff Brown 5707dbf15d Transfer large bitmaps using ashmem.
Bug: 5224703

Change-Id: If385a66adf4c6179a0bb49c0e6d09a9567e23808
2011-10-03 17:28:13 -07:00
Dianne Hackborn 8938ed2c8e Add mechanism for Parcel to not allow FDs to be written to it.
This is to help implement issue #5224703.

Change-Id: I026a5890495537d15b57fe61227a640aac806d46
2011-10-03 16:58:41 -07:00
Jamie Gennis fb1b5a2f33 SurfaceTexture: parameterize the texture target
This change adds a hack to allow Android Browser to use a SurfaceTexture
to stream RGBA images to a GL_TEXTURE_2D texture object.

Change-Id: Idb90064d5d4b920959ef3be7451362ac5012460e
2011-09-30 14:19:41 -07:00
Jamie Gennis fa28c35c21 SurfaceTexture: add name support
This change adds support for setting a string that can be used to
identify a SurfaceTexture object in log messages.

Change-Id: Ib4ee085f36c8830dc964c05ef1654f5a55dfcd60
2011-09-22 17:49:10 -07:00
Jeff Brown 21230c6410 Handle orientation changes more systematically.
Bug: 4981385

Simplify the orientation changing code path in the
WindowManager.  Instead of the policy calling setRotation()
when the sensor determined orientation changes, it calls
updateRotation(), which figures everything out.  For the most
part, the rotation actually passed to setRotation() was
more or less ignored and just added confusion, particularly
when handling deferred orientation changes.

Ensure that 180 degree rotations are disallowed even when
the application specifies SCREEN_ORIENTATION_SENSOR_*.
These rotations are only enabled when docked upside-down for
some reason or when the application specifies
SCREEN_ORIENTATION_FULL_SENSOR.

Ensure that special modes like HDMI connected, lid switch,
dock and rotation lock all cause the sensor to be ignored
even when the application asks for sensor-based orientation
changes.  The sensor is not relevant in these modes because
some external factor (or the user) is determining the
preferred rotation.

Currently, applications can still override the preferred
rotation even when there are special modes in play that
might say otherwise.  We could tweak this so that some
special modes trump application choices completely
(resulting in a letter-boxed application, perhaps).
I tested this sort of tweak (not included in the patch)
and it seems to work fine, including transitions between
applications with varying orientation.

Delete dead code related to animFlags.

Handle pausing/resuming orientation changes more precisely.
Ensure that a deferred orientation change is performed when
a drag completes, even if endDragLw() is not called because the
drag was aborted before the drop happened.  We pause
the orientation change in register() and resume in unregister()
because those methods appear to always be called as needed.

Change-Id: If0a31de3d057251e581fdee64819f2b19e676e9a
2011-09-21 19:26:15 -07:00
Mathias Agopian 000e95e7eb fix the float Rect in OpenGLRenderer to handle NANs
- we want functions like isEmpty() to return true if NANs are
involved in the Rect

- also clean-up the intersect familly of calls

- minor cleanup in the int32_t Rect as well

These played a role in http://b/5331198.

Bug: 5331198

Change-Id: I5369725ab482e4b83da9f1bd4cee5256e5de75b2
2011-09-19 16:50:07 -07:00
Andreas Huber 1d60b9629c A new API "androidGetThreadPriority"
Change-Id: I6baeead8c70460863343fd557250635fb1e6a170
2011-09-16 09:33:22 -07:00
Jeff Brown 73aaf0d8d2 Velocity Tracker II: The Revenge of Velocity Tracker
Bug: 5265529

Rewrote the velocity tracker to fit a polynomial curve
to pointer movements using least squares linear regression.
The velocity is simply the first derivative of this polynomial.

Clients can also obtain an Estimator that describes the
complete terms of the estimating polynomial including
the coefficient of determination which provides a measure
of the quality of the fit (confidence).

Enhanced PointerLocation to display the movement curve predicted
by the estimator in addition to the velocity vector.

By default, the algorithm computes a 2nd degree (quadratic)
polynomial based on a 100ms recent history horizon.

Change-Id: Id377bef44117fce68fee2c41f90134ce3224d3a1
2011-09-14 19:16:37 -07:00
Jeff Brown 137c3c5495 Tweak VelocityTracker.
Bug: 5265529

Calculate the velocity using the most recent touch sample as the
point of reference instead of the oldest.  This change more heavily
weights recent touch samples and reduces the sample time window
used for calculation.  This significantly improves the accuracy
of fling gesture detection.

Change-Id: Ib1940933e786e5f6a731552a99bcd9400741d55f
2011-09-09 16:04:09 -07:00
Mathias Agopian 41b6aabf35 fix Surface positions are not floats
Added Surface.setPosition(float, float) which allows to set a surface's
position in float.

Bug: 5239859
Change-Id: I903aef4ad5b5999142202fb8ea30fe216d805711
2011-08-30 18:51:54 -07:00
Glenn Kasten 940673f92e Merge "Add C++ thread API androidGetThreadSchedulingGroup" 2011-08-29 14:38:52 -07:00
Jamie Gennis 3599bf2c07 SurfaceFlinger: use the HWC gralloc usage bit
This change makes SurfaceFlinger always use the
GRALLOC_USAGE_HW_COMPOSER usage bit when allocating buffers that may be
passed to the HWComposer.

Change-Id: I70362a8ede2b359fb2046853f85149d597465817
2011-08-22 14:56:29 -07:00
Jeff Brown ecc7adef2e Input system bug fixes, particularly for stylus.
Bug: 5049148

Finished stylus support, including support for indirect stylus
and mouse tools.

Added TILT axis.  When stylus tilt X/Y is available, it is transformed
into an orientation and tilt inclination which is a more convenient
representation and a simpler extension to the exiting API.

Touch devices now only report touch data using a single input
source.  Previously touch devices in pointer mode would report
both absolute touch pad data and cooked pointer gestures.
Now we just pick one.  The touch device switches modes as needed
when the focused application enables/disables pointer gestures.
This change greatly simplifies the code and reduces the load
on the input dispatcher.

Fixed an incorrect assumption that the value of ABS_(MT_)DISTANCE
would be zero whenever the stylus was in direct contact.  It appears
that the correct way to determine whether the stylus is in direct
contact (rather than hovering) is by checking for a non-zero
reported pressure.

Added code to read the initial state of tool buttons and axis values
when the input devices are initialized or reset.  This fixes
problems where the input mapper state might have the wrong initial
state.

Moved responsibility for cancelling pending inputs (keys down,
touches, etc.) to the InputDispatcher by sending it a device reset
notification.  This frees the InputReader from having to synthesize
events during reset, which was cumbersome and somewhat brittle
to begin with.

Consolidated more of the common accumulator logic from
SingleTouchInputMapper and MultiTouchInputMapper into
TouchInputMapper.

Improved the PointerLocation output.

Change-Id: I595d3647f7fd7cb1e3eff8b3c76b85043b5fe2f0
2011-08-19 15:02:26 -07:00
Jamie Gennis 7f7e85898f Merge "SurfaceTexture: fix queues-to-composer" 2011-08-18 14:31:39 -07:00