InputDispatcher: Optimize count()

Count items as they are added and removed rather than iterating over the
entire list to count them.

Increases performance slightly, particularly when tracing is turned on,
which causes count to be queried more often, and when the number of
items in the queues grow large.  This can happen due to applications not
responding, for example.

Change-Id: I0f11f7edd46089612af910cdfabfeb3ee685d7d9
SF: Add support for inverse mounted panels

Add 180 rotation in SF to account for inverse mounted panels.
The framework will be unaffected and use policies for a 0 mounted
panel. SF changes the global transform and silently induces the H,V
flips. Similar flips are added to screenshots as well.

Change-Id: I6e9576ee734ee85097491eaa1e8e94cfb3731e0f
libgui: Handle createGraphicBuffer binder transcation failure

Return proper error value if remote binder transaction of
createGraphicBuffer fails.

Change-Id: Ia77f8379121b109ff4bc023a95e058d6f5c60208
Add missing glFlush call

According to EGL_ANDROID_native_fence_sync specification,
glFlush should be called to make a new native fence object created
after eglCreateSyncKHR is called.

Change-Id: Ifea69d3c3bca27aef246e1b7baaae6e962257f1e
libgui: fix test after compatibility patches

Change-Id: Iae7333f025bb0271f008e4cc0356cf704800f1b7
surfaceflinger: Add ifdefs for secure display query

 * The HWC_SECURE feature is only implemented for devices using
   QC-CAF hwcomposers.

Change-Id: I1aa72864ba6a0e62fd7cee74631b57200db3db4f
Revert "omx: Add nBitsPerSample parameter for FLAC"

This reverts commit 5fa201c9919d22b3470ae64e4952df2221ba5b16.

Change-Id: I800c9c057de4d42d19bf95ff07fa382616dfff6d
inputflinger: disable touch input while using a stylus

Android 5.0 cannot form multitouch events from multiple input
devices. So it is not possible to report one touchpoint from the
stylus position and, at the same time, another touchpoint from a
finger touch. Instead, when a new input device starts up the currently
active input is cancelled. This is highly undesirable while writing
with the pen.

The easiest solution is to ignore non-stylus touch events while the
stylus is within range (hovering) of the touchscreen. For example,
N-trig digitizers implement this in hardware. But wacom digitizers do
report pen data simultaneously with touch data. This patch disables
(non-stylus) touch input within 50ms of stylus data. On my Galaxy
Note this is necessary to make stylus input usable.

Original commit by vbraun:
https://github.com/CyanogenMod/android_frameworks_base/commit/b9cb2961309c829586ae24ce432bb1fdb5610ba6

Change-Id: I97f26369826e96c97461c8ae188f1c64dec1b4d3
binder: Squashed commit of MemoryHeapBaseIon

Source:
http://git.insignal.co.kr/samsung/exynos/android/platform/frameworks/native/commit/?h=exynos-jb&id=dc4cd25cc41e4358debd0c7d1a2706d208a58df6

Change-Id: Ib06cc37a2a25c78a061ee2bad48eec2d01b07833

binder: update MemoryHeapIon

* Update from ODROID-XU 09232013 BSP release

Change-Id: I5245c8a9f783e8902bf91a0ee23e60ebeb335b27

binder: update MemoryHeapIon

* Update from ODROID-XU 04212014 BSP

Change-Id: Ifc2664bcde37a71d855e05e7c9e50288a4508892

Change-Id: Icfff592cf705af660c7318b08fce75dbbf42103c
binder: MemoryHeapIon: fix unused parameters

Using the __attribute__((unused)) preprocessor directive

Change-Id: I29d27fd7eacb962ffa06ccd81ee48b48f3743243
frameworks/native: Add support for transparent layers

Add support for marking layers transparent, which SurfaceFlinger
can drop from composition. This is meant to be set by apps, in
situations where the window above a surfaceview is fully transparent.

Change-Id: Ide979d47489a6fc4c6f47f6dd026853d83d484c0
atrace: fix duplicate tag 'sync'

Recent AOSP commit added a tag 'sync' for ATRACE_TAG_SYNC_MANAGER but
the tag 'sync' was already being used for "Synchronization" events.

Due to this conflict, the Synchronization events are not enabled
anymore with the name duplication. To avoid this,'sync' for
sync_manager is renamed to 'sm'

Change-Id: Ieb7b504e63f0eadc8d889af9cfed217287c75a6b