Commit Graph

2296 Commits

Author SHA1 Message Date
Flanker 5d17838ade add number constraint for samples per MotionEvent
Bug:23905002

Signed-off-by: Adam Lesinski <adamlesinski@google.com>

(cherry picked from commit 552a8a5d8d)

Change-Id: I9b7ea859889b7697bee4165a2746602212120543
2015-10-20 12:28:15 -07:00
Naveen Leekha c1e6fbb52c Initialize local variables to avoid data leak
The uninitialized local variables pick up
whatever the memory content was there on stack.
This data gets sent to the remote process in
case of a failed transaction, which is a security
issue. Fixed.

(Manual merge of master change
 12ba0f57d028a9c8f4eb3afddc326b70677d1e0c )

For b/23696300

Change-Id: I665212d10da56f0803b5bb772d14c77e632ba2ab
2015-09-22 17:58:21 -07:00
Christopher Tate bb686c25b2 Disregard alleged binder entities beyond parcel bounds
When appending one parcel's contents to another, ignore binder
objects within the source Parcel that appear to lie beyond the
formal bounds of that Parcel's data buffer.

Bug 17312693

Change-Id: If592a260f3fcd9a56fc160e7feb2c8b44c73f514
(cherry picked from commit 27182be9f2)
2015-06-24 20:46:58 +00:00
Adam Lesinski 4ff0cb4404 Verify that the native handle was created
The inputs to native_handle_create can cause an overflowed allocation,
so check the return value of native_handle_create before accessing
the memory it returns.

Bug:19334482
Change-Id: I1f489382776c2a1390793a79dc27ea17baa9b2a2
(cherry picked from commit eaac99a717)
2015-05-13 17:16:00 +00:00
Michael Lentine da9fd70de1 am 2758eb2e: am fde92eb0: Update maxNumber to be smaller.
* commit '2758eb2e67d935cf1f04e3d713438c6ac7fe8b89':
  Update maxNumber to be smaller.
2015-02-19 00:15:40 +00:00
Michael Lentine 2758eb2e67 am fde92eb0: Update maxNumber to be smaller.
* commit 'fde92eb0ffcc37106d5fe85bf1f1ba30d8639d17':
  Update maxNumber to be smaller.
2015-02-19 00:10:11 +00:00
Michael Lentine fde92eb0ff Update maxNumber to be smaller.
There shouldn't be more than 4096 fds (probably signficantly smaller) and
there shouldn't be more than 4096 ints.

Bug: 18076253

Change-Id: I3a3e50ee3078a4710e9737114e65afc923ed0573
2015-02-18 10:34:37 -08:00
Michael Lentine 76ebd319d9 am 3d89edca: am e6f7a44e: Fix for corruption when numFds or numInts is too large.
* commit '3d89edca65e07319c9ac3b9bb9889e80e8c40578':
  Fix for corruption when numFds or numInts is too large.
2014-12-02 17:52:00 +00:00
Michael Lentine 3d89edca65 am e6f7a44e: Fix for corruption when numFds or numInts is too large.
* commit 'e6f7a44e835d320593fa33052f35ea52948ff0b2':
  Fix for corruption when numFds or numInts is too large.
2014-12-02 17:45:44 +00:00
Michael Lentine e6f7a44e83 Fix for corruption when numFds or numInts is too large.
Bug: 18076253
Change-Id: I4c5935440013fc755e1d123049290383f4659fb6
2014-11-21 17:18:59 -08:00
Marco Nelissen 23c2fcbbf4 am c0af9caf: am b14d72bc: am d070009e: am df6774c9: am 7c1cdbdd: am e23f8b8f: am 1f70863d: am 37b44969: Add support for writing byte arrays to parcels
* commit 'c0af9cafba1217e2585777964730c70e40957dcd':
  Add support for writing byte arrays to parcels
2014-03-20 13:26:08 -07:00
Marco Nelissen c0af9cafba am b14d72bc: am d070009e: am df6774c9: am 7c1cdbdd: am e23f8b8f: am 1f70863d: am 37b44969: Add support for writing byte arrays to parcels
* commit 'b14d72bce04e990639305890b2aca3ccad5b3ebb':
  Add support for writing byte arrays to parcels
2014-03-20 13:13:23 -07:00
Marco Nelissen b14d72bce0 am d070009e: am df6774c9: am 7c1cdbdd: am e23f8b8f: am 1f70863d: am 37b44969: Add support for writing byte arrays to parcels
* commit 'd070009ecdb9e8c58ce5d1540d5bcba5587a0448':
  Add support for writing byte arrays to parcels
2014-03-20 11:11:18 -07:00
Marco Nelissen 7c1cdbdd68 am e23f8b8f: am 1f70863d: am 37b44969: Add support for writing byte arrays to parcels
* commit 'e23f8b8f0bf32e79c1d0f9183c064ab61354c452':
  Add support for writing byte arrays to parcels
2014-03-20 10:48:35 -07:00
Marco Nelissen e23f8b8f0b am 1f70863d: am 37b44969: Add support for writing byte arrays to parcels
* commit '1f70863d13668dc97047df15cce547ebc8435ff2':
  Add support for writing byte arrays to parcels
2014-03-20 10:33:12 -07:00
Marco Nelissen 1f70863d13 am 37b44969: Add support for writing byte arrays to parcels
* commit '37b44969c0ca1d00e213da685dfbb2807f2bab30':
  Add support for writing byte arrays to parcels
2014-03-20 10:04:42 -07:00
Kenny Root 5b61ad2cda Check the padded size of the read byte array
Bug: 13509200
Change-Id: Id93894fcc617ec1cd4ce66921c6e1f1c3cf40b09
2014-03-17 13:18:16 -07:00
Marco Nelissen 37b44969c0 Add support for writing byte arrays to parcels
b/13418320

Cherrypicked from f0190bff38
https://googleplex-android-review.git.corp.google.com/#/c/433320/

Change-Id: I2285df9e9d3dc8a6a54055b13b352b81660bf45d
2014-03-17 11:13:30 -07:00
Marco Nelissen f0190bff38 Add support for writing byte arrays to parcels
b/13418320

Change-Id: I2285df9e9d3dc8a6a54055b13b352b81660bf45d
2014-03-13 14:17:40 -07:00
Arve Hjønnevåg 6790329358 Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface
DO NOT MERGE into any branch that uses the new interface

Change-Id: Id54308a89327e69a389ac5916c052ad97f57cb28
2014-02-19 15:35:52 -08:00
Arve Hjønnevåg f50b9eaaee Binder: Make sure binder objects do not overlap
Fixes crashing part of bug 11355082.
The driver still leaks references.

Change-Id: Ibc6a63b151c1fc1f7666237f25255ba781e02071
2014-02-15 03:44:17 +00:00
Marco Nelissen 708cc794f6 Native counterpart of new power manager method
Cherrypicked from master.

b/9464621

Change-Id: I54c0ed50a57ac870da91db8589a73a2c792dbd8d
2013-10-25 12:50:04 -07:00
Michael Wright 3223217aed Only consume touches up until the frame time
When resampling is disabled, it's currently possible to consume
touches after the current frame time. This breaks some guarantees and
could cause unexpected behaviors.

Change-Id: I99908a2cac2df9f795dd4a07188b4451213cf3e4
2013-10-21 23:57:17 +00:00
Andy McFadden 8507586903 Wait for buffers to drain
When a BufferQueue producer disconnects and reconnects, we retain
the previously-queued buffers but empty the slots.  This allows
the number of queued buffers to grow without limit.  The low-memory
killer does not approve.

Bug 11069934

Change-Id: Ia2eaa954c7a3904b54209a3701dba01689e204d8
2013-10-18 23:10:16 +00:00
Dave Burke 9c0dfa0973 Merge "Eliminate latency when resampling is disabled" into klp-dev 2013-10-11 02:33:15 +00:00
Michael Wright ad526f8505 Eliminate latency when resampling is disabled
Since the latency was introduced to avoid egregious errors during
resampling, remove it when we aren't resampling.

Change-Id: Ia8e9a9afb1e16212fec81a8c9c661c598e1b0ebf
2013-10-10 18:54:12 -07:00
Aravind Akella 701166d9f6 Change API from flush(handle) to flush(). Call flush on all active sensors in the given SensorEventConnection.
Change-Id: I4ef2bec80406c517903ab9782dc9eaf3fa8b7f36
2013-10-09 17:26:01 -07:00
Jamie Gennis f0cf5f103c BufferQueue: fix a test crash
Bug: 10935880
Change-Id: If76e9fb055103bad0db7e6c16487532671573149
2013-10-02 18:02:28 +00:00
Jamie Gennis dbe9245e2e GLConsumer: start using EGL_ANDROID_image_crop
This change makes GLConsumer use the EGL_ANDROID_image_crop extension when
available on a device.  The crop rectangle is passed to the EGL driver when
creating EGLImages, allowing the crop to be performed by the driver rather than
using the texture transform matrix.

Bug: 10897141
Change-Id: I63e9a5d5c85067376abc420e3639154468346311
2013-10-02 17:34:35 +00:00
Eino-Ville Talvala d171da973d GLConsumer: Add query for current frame number.
Surface the underlying frame number of the current texture.

Bug: 10830400
Change-Id: Ide3a7da12ea0aac54588beb6bf00dbfe2cd37653
2013-09-19 13:36:07 -07:00
Mathias Agopian c1c05de415 fix camera API 2.0 orientation
we add a flag to ANativeWindow::setBufferTransform that means
"apply the inverse rotation of the display this buffer is displayed
onto to".

Bug: 10804238
Change-Id: Id2447676271950463e8dbcef1b95935c5c3f32b2
2013-09-17 23:45:22 -07:00
Mathias Agopian 799f512680 Fix build (tests)
Change-Id: I5b233ef448e5e7eec3818c6586dfea138b28f7b6
2013-09-17 15:55:18 -07:00
Mathias Agopian 02b62df711 Merge "Make sure do disconnect from a BQ when its client dies." into klp-dev 2013-09-17 21:31:14 +00:00
Mathias Agopian 365857df8b Make sure do disconnect from a BQ when its client dies.
Bug: 5679534

Change-Id: If447e8673df83fe0b1d6210641e0a48522501a53
2013-09-16 16:15:21 -07:00
Jesse Hall 83cafffeac Stop using default value for Surface producerControlledByApp parameter
Bug: 10785749
Change-Id: Ifbf9340e5eabe621a69e990ec3e05ac51f8db66a
2013-09-16 15:39:55 -07:00
Mathias Agopian 90ed3e8d78 fix a few problems with BitTube
BitTube used to send objects one at a time and didn't
handle errors properly.

We now send all the objects in one call, which means they
have to be read as a single batch as well. This changes the
BitTube API.

Update SensorService to the new API.

Also added an API to set the size of the send buffer.

Bug: 10641596
Change-Id: I77c70d35e351fdba0416fae4b7ca3b1d56272251
2013-09-10 21:10:53 -07:00
Aravind Akella 724d91d778 Sensor batching. Changes to the native code.
Bug: 10109508
Change-Id: I7333f3aac76125a8226a4c99c901fb904588df04
2013-09-03 17:04:36 -07:00
Mathias Agopian 9b5534b0e5 Merge changes I8283a989,I64add89a into klp-dev
* changes:
  switch to use mat4
  vector and matrix classes for graphics use
2013-08-31 01:30:10 +00:00
Jesse Hall 8db92553e9 Force async behavior for the virtual display output BufferQueue
Bug: 10551087
Change-Id: I40bbb2b87d64420939a0ea309254f281437dab56
2013-08-29 16:09:11 -07:00
Mathias Agopian 595ea77f6b vector and matrix classes for graphics use
- this implements vec2, vec3, vec4, which are float vectors
of size 2, 3 and 4 respectively.

the code allows easy instantiation of vectors of a different
type via the tvec{2|3|4}<T> template classes.

- this also implements mat4 which is a float 4x4 matrix. the
tmat44<T> template class allows easy instantiation of a
4x4 matrix of a different value_type.

The vector types have some minimal support for the
glsl style swizzled access; for instance:

  vec4 u;
  vec3 v = u.xyz;

only .x, .xy, .xyz and their .stpq / .rgba equivalent are
supported.

most operators are supported on both vector and matrices:
arithmetic, unary, compound assignment and comparison
(bit-wise operators NOT supported).

- operations available on vectors include:
dot, length, distance, normalize and cross

- operations available on matrices include:
transpose, inverse, trace

- and a few utilities to create matrices:
ortho, frustum, lookAt

Change-Id: I64add89ae90fa78d3f2f59985b63495575378635
2013-08-26 20:41:13 -07:00
Jeff Brown 464febc449 Remove input flinger stubs. (DO NOT MERGE)
Bug: 10446930
Change-Id: I4dd46f539cd2a2e324dfc83b45ba2787f7404a4a
2013-08-22 18:40:07 -07:00
Eino-Ville Talvala 7895e90e29 Surface: Fix controlledByApp parameter
Bug: 10425641
Change-Id: I1a47e2ce4ecbdb8e67030a5d9ddf6604c5e2497d
2013-08-21 12:05:42 -07:00
Andy McFadden 8b308ed70e Fix build
Neglected the "checkbuild"-built tests.

Change-Id: I202692f1a6d1e306c88e820c959d07d16e7c6a00
2013-08-19 08:56:07 -07:00
Andy McFadden 3c25621ad7 Re-enable frame dropping for non-auto timestamps
This change adds an entire field to note whether the timestamp was
auto-generated by Surface or supplied by the application.

The value is used when deciding whether or not to drop frames based
on buffer presentation timestamps.  If a desired presentation time
was set explicitly, BufferQueue will use that value to decide if a
frame should be dropped.  If the timestamp was generated by Surface
at the time the buffer was queued, the timestamp is ignored.

Bug 10151804

Change-Id: Ibd571a7578351063b813cbdad2ddbeed70655ba5
2013-08-16 15:15:16 -07:00
Igor Murashkin a5b7513711 gui: CpuConsumer::lockNextBuffer change return code when too many bufs acquired
- Return NOT_ENOUGH_DATA instead of INVALID_OPERATION when too many
  buffers have already been locked.
- INVALID_OPERATION is nominally used when something irrecoverable happens,
  but in this case the client just needs to call unlockBuffer to go back into a
  good state.

Bug: 10333400
Change-Id: I3a034d77de85741429f832a90eedd670afa1dc94
2013-08-14 20:17:17 -07:00
Mathias Agopian c6bae007e6 Fix build. optional tests were broken.
Change-Id: Iba9f5cb57f134559e1f9c55e293578d9f5d8cb96
2013-08-14 16:27:19 -07:00
Mathias Agopian 3f84483382 SurfaceFlinger now uses GLES 2.x when available
Bug: 8679321

Change-Id: I2b152d01fb4e2de2ea9fe87f1ddbd6826d7520d7
2013-08-13 16:07:45 -07:00
Mathias Agopian 45155969dc make sure GLConsumer::releaseTexImage() works after detachFromContext()
Change-Id: I27e0bc57e927d47b2b98113ee37b5396bcc72019
2013-08-12 23:45:28 -07:00
Mathias Agopian 9870c9b66c make GLConsumer's debug texture static
this is so that we don't burn a gralloc handle and a bit
of memory per GLConsumer.

Change-Id: I30c3e7ec45d7f1b5426aca8e06c7716870877706
2013-08-08 17:46:48 -07:00
Jesse Hall 6c913be9ca Add ISurfaceComposer::destroyDisplay
Bug: 10191053
Change-Id: Ia89286f95421344a60ffedaaca5825c4e3cd7f9e
2013-08-08 13:12:29 -07:00