GFX-3D: Hold the BufferReference of GraphicBuffer in BpGraphicBufferAlloc

BZ: 86716

In WIDI usage, BufferQueue is outside of SurfaceFlinger. If BufferQueue
allocates a GraphicBuffer from SurfaceFlinger, BnGraphicBufferAlloc will
create a BufferReference to hold a last ref to the GraphicBuffer, but
when the transction finishes, the parcel used in the transaction will be
destroyed and the BufferReference will be freed which caused the last
ref of the GraphicBuffer in SurfaceFlinger side goes away and then
destroy the GraphicBuffer. This leads to the buffer state between
BufferQueue and SurfaceFlinger out of sync, because in BufferQueue side,
the GraphicBuffer was just created and will be used later.

This patch add a sp<IBinder> of BufferReference for each GraphicBuffer
when created in BpGraphicBufferAlloc, this will make the BufferReference
in BnGraphicBufferAlloc stay still when the transaction finishes, which
also leads the GraphicBuffer be held. When BufferQueue free a
GraphicBuffer, the sp<IBinder> BufferReference will be set to 0 which
will free BufferReference and then GraphicBuffer in
BnGraphicBufferAlloc/SurfaceFlinger side, and will not lead to memory
leak.

In normal use case, since the BufferQueue and SurfaceFlinger are in the
same process, there will no Bp side exist. Thus, this patch will not
affect the normal use case.

https://code.google.com/p/android/issues/detail?id=54597

Change-Id: I812bbf046fd592a6dca1e4d157b459c9654835fb
Signed-off-by: Lingyun Zhu <lingyun.zhu@intel.com>
Revert "GFX-3D: Hold the BufferReference of GraphicBuffer in BpGraphicBufferAlloc"

This reverts commit 7a3802e7699164eb7760f354803ab59afbf42eab.

Change-Id: Ie29d5404c23ca8610f5fa3e5916fe1a124956ba0
CM11 Themes: Pipe stderr from aapt to logcat.

This will allow users to see why aapt failed when installing a
theme.

Change-Id: I74314daae9e844dce2f4c3eeb6c78a40b5ad6357
libs/gui: Release acquired buffer when createImage fails

When EGL fails to create an KHR image for an acquired buffer,
release the buffer before returning with error. This unblocks
the dequeue buffer call waiting and may succeed in the next queue.

CRs-Fixed: 624244

Change-Id: I674807f4bb1f1253cb787daaa5a7adf351caaae7
(cherry picked from commit 9e9b12d7f37a6120a705db56a4374e7141c79a41)
CM11 Themes: Common overlay for sharing resources. [2/2]

Change-Id: Ied21ede2f36ba16dd190bc1e6cec44fd8560ca90
Add OMX_AUDIO_CodingAPE and OMX_AUDIO_CodingDTS

Copied from the stagefright-plugins project.

add HEVC decoder and cleanup

Change-Id: I16342228014320161a22302a3c14df7725556cd2
Merge "CM11 Themes: Common overlay for sharing resources. [2/2]" into cm-11.0
Merge pull request #1 from CyanogenMod/cm-11.0

Sync with cyanogenmod