SurfaceFlinger: Add support for extendedMode

- Displays only video with full screen on External with no UI controls
- Primary will show only UI controls
- Similar to presentation class, but will be used by a third
  party app, which does not use presentation class
- To enable this set sys.extended_mode to 1

Change-Id: I9a66c770e1c1a7471cb50690514497dae8dad4b3
Sensor: Add RotationVectorSensor2

(ported from 4.1)

Some ICS apps (namely, Google Maps) expects a rotation vector to be
available. Newer devices, this is provided by either Android's
sensor fusion (requires Gyro) or by hardware sensor fusion (MPL).

Older devices will lack this virtual sensor and compass in Google
Maps will not work. To fix this, we can provide our own rotation
vector sensor by converting the values from the orientation sensor.
(They are basically the same information in different formats.)

Thanks to Unhelpful for the help with related math.

Change-Id: I39489b3a5ce7c7d890768614357f32cc491bd6d9
DisplayDevice: Backwards compatibility with old EGL

From 4.1 to 4.2, the display subsystem was reworked to
use SurfaceTextureClient/BufferQueue instead of
FramebufferNativeWindow for the framebuffer itself.

Unfortunately, some legacy EGL libraries make assumptions
that any framebuffer device will be FramebufferNativeWindow.

These EGL libraries will fail when used in 4.2 as if the
framebuffer is not FramebufferNativeWindow, they will
try to dequeue more than one buffer at a time, which
will cause a hang of the graphics subsystem.

This allows use of FramebufferNativeWindow to keep
legacy EGL implementations happy.  Confirmed EGL
implementations that need this include but are
not limited to:

Set BOARD_EGL_NEEDS_LEGACY_FB to use

Tegra2/3 ICS EGL
Mali400 ICS EGL (Allwinner A10)
Mali400 Jellybean (4.1) EGL (Samsung Exynos4)

Original implementation by OndraOrg of XDA:
http://forum.xda-developers.com/showpost.php?p=34469675&postcount=19

Change-Id: I74005cf6753b3c9bfb4c1e32fb641f5167787917
sensors: Add dummy light sensor

Some devices have a sysfs toggle for the lightsensor instead of
passing the LUX values for userspace processing; for those,
use BOARD_SYSFS_LIGHT_SENSOR:=<sysfs path>

This is necessary for the rest of userspace to recognize its existence
and toggle it for auto-brightness. It doesn't generate actual light
values, though; all backlight adjustments are made in-kernel.

Change-Id: I0e546b4740720bd34d1e1d85a96b295fcc697106

sensors: dummy ls: set unique handle

handles and types are usually the same, but it's not mandatory.
Sony DASH use custom handles, and the previous assumption broke
Proximity sensor on Sony devices.

Change-Id: I954e13765f42341e6b5393a12556f6a007c4e494
sensordevice: Dummy ALS: Solve fortified libc warning

convert sprint to snprintf, the size of the writes is always known

Change-Id: I53ee36b67544ac25de7e5c05ce90b6817c8a9c92
sf: virtual display clean up

  Since HAL allows Virtual devices, remove virtual display id
  check during setup of virtual display.

Change-Id: I6ec93c0f06842b69e6677f05ae8b45fb1f4225f6
surfaceflinger: enable EGL_NEEDS_FNW for qcom legacy

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>

Change-Id: Ia6df94e8380062d646e29f293e5dc768e8a138e7
frameworks_native: Add back PixelFormatInfo

Change-Id: Id911a534c038311b69438c4171a523ccb1b29d99
SensorEventQueue: Allow setRate on sensor enable

4.3 and earlier would set the sensor rate on activation and then set it again
when setRate was called.

Some sensor HALs assume this will happen and ignore the first setRate

Conditionally the first one back in for such broken HALs

Change-Id: If1c259b0fd5517a1272cdad0a1abf1fe0fb5a7d1
binder: add another compat symbol

- Extend https://gerrit.omnirom.org/#/c/2324/
- Some old blobs, mainly LGE libs need this

Change-Id: Ia0370fecff24348aefa17aa7de2609535323e9b0
C++11 Fixes.
fix hardware issues in capri based devices

[PATCH 1/4] binder: add compat symbols

Required for libtvservice_binder.so on I9082

[PATCH 2/4] SurfaceFlinger: ifdef EVENT_ORIENTATION

Some HWC implementation spam the log on unknown event

[PATCH 3/4] sf: add CAPRI_HWC compatibility

[PATCH 4/4] sf: CAPRI_HWC: fix rotation artifact

All this required for capri based devices.

Change-Id: Ib6b6a4563c6d6c5e142aa987889553772fcec891
C++11 string literal fixes.

GCC 4.9 now just throws errors on these rather than warning like previous GCCs.
sensorservice: Build with Clang.
Add libpng include path

 Forward compatibility change

Change-Id: Iae792715d9a9aea34f53cd6383981371835c4a31