Binder: Make sure binder objects do not overlap

Fixes crashing part of bug 11355082.
The driver still leaks references.

Change-Id: Ibc6a63b151c1fc1f7666237f25255ba781e02071
sf: Enable swaprect optimization by default only on QCOMs

 * This is confirmed to cause problems at least on i9500.
 * Only enable it by default on QCOMs, other devices can opt
   in using the system property.

Change-Id: Ic00137201f4a5383877f4033473c1ea5ac32a3a7
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
SF: Add flag for swaprect status in HAL

We need to check in HAL whether swap rect
is enable or disable to calculate wormhole region.

Change-Id: I4fbff4119856e41694e2065141b40fdd7a15f375
SurfaceFlinger: Change to support framebuffer flip for 2D blitters

- Surfaceflinger does not flip framebuffers when there are
  no layers marked for HWC_FRAMEBUFFER
- This change checks for the HWC_BLIT flag and will request a flip
  to a new FB_TARGET buffer even if there are no FRAMEBUFFER layers

Change-Id: I1cb44389a05c9ec049d7f0d39c288feccb11a91c
Display: Define new composition type for blit composition

This change defines a new flag 'hasBlitComp' to identify
blit composition. This flag is used to enable the swap rect
feature for blit composition cases.

Change-Id: Ic523e19796a893efbfc3bff300d1f982cba5ddfa
Revert "Add sessionId metadata with every buffer queued through Surface"

This reverts commit 85743373ed7d4eb6cb58412bda6c74f9ee29f06f.
This change is no longer needed

Change-Id: Ia5612b42f081236db65ac8eef9d359dfd23f4117
surfaceflinger: Conditional compilation for swaprect feature

 * Since this now calls into the HAL, we can only support it on
   devices which use the new version.

Change-Id: I231d70ac3d17fd2198f3929057c1edb0f158c099
Do not just silently fail if surface creation fails

Some apps do not check if they actually got a surface (e.g. bootanimation)
So this helps the track crashes down to the cause.

Change-Id: I6e74bdb52ad7ebe260b0ec1777c585781f6bbd42
[2/2] Speed up booting on multicore devices.

Add multithreading support.

Change-Id: I13630de9d75d13c0368d261b3564b787067b65b1
SF: Fix invalid reduction of transparent region from a layer.

Reduce transparent region from a layer only if the transparent
region has valid intersection with the layer. Otherwise, reducing
a transparent region lying completely outside of the layer leads to
invalid sourcecrop values for the layer.

Change-Id: Iee9ba53a8072c21c9ba8a6d58cb14ca30f8600ba
CRs-Fixed: 620973
sf: Determine if virtual display can use HWC for composition

For HWC virtual display using V4L2 approach:
1. HWC virtual display implementation doesn't send output buffer
   back to Surface Flinger.
2. For non-wfd virtual displays(e.g. Simulated Secondary Displays,
   Screen Record, CTS etc..), configure VDS to use GPU for
   composition on output/sink buffer.
3. For wfd virtual display (a.k.a hybrid wfd), use
   Framebuffer surface (similar to external display mechanism).

For HWC virtual display using VDS approach:
1. HWC is allocated for first virtual display connection.
2. Subsequent virtual display sessions will be composed by GLES driver.
ToDo: Modify VDS component to allocate hwcDisplayId based on
mForceHwcCopy (which is based on Usage Flags)

Change-Id: Ib7d2c00ca5fa07908b2eac8085654f8d2cd9af0b
Ignore flush complete events when recording last value for a sensor.

Bug: 11822806
Change-Id: I1402d6684ed71ed413aef6a7be3aad945b331ec2
Bug fix for SensorFusion data rate.

SensorFusion is always returning data at the slowest possible sampling rate (5 Hz). batch() is getting called twice, first time with the requested rate and second time with the slowest rate (which overwrites the requested rate). Fix batch call in SensorFusion::activate()

Bug: 12064319
Change-Id: If62f3e514233f69810336fd22b136b4395b667d3
(cherry picked from commit 88509090387eeb400771a786171866710cca230c)
Add support for writing byte arrays to parcels

b/13418320

Change-Id: I2285df9e9d3dc8a6a54055b13b352b81660bf45d
Add support for writing byte arrays to parcels

b/13418320

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

Change-Id: I2285df9e9d3dc8a6a54055b13b352b81660bf45d
Check the padded size of the read byte array

Bug: 13509200
Change-Id: Id93894fcc617ec1cd4ce66921c6e1f1c3cf40b09
am 37b44969: Add support for writing byte arrays to parcels

* commit '37b44969c0ca1d00e213da685dfbb2807f2bab30':
  Add support for writing byte arrays to parcels
am 1f70863d: am 37b44969: Add support for writing byte arrays to parcels

* commit '1f70863d13668dc97047df15cce547ebc8435ff2':
  Add support for writing byte arrays to parcels
am e23f8b8f: am 1f70863d: am 37b44969: Add support for writing byte arrays to parcels

* commit 'e23f8b8f0bf32e79c1d0f9183c064ab61354c452':
  Add support for writing byte arrays to parcels