libhwui: Correct transform used for drawing text-shadow.

The model-view transform used for text-shadow in drawText() should
be in sync with the transform used for main text draw.

CRs-Fixed: 342161

Change-Id: I6bb36691c84809aaede65ad5fc1c4a1e90f1ecfc
(cherry picked from commit d4c8be8416c6c3064e43ed80ebacb2a177be3019)
libstagefright - increase avcc atom size allowed

 - increases buffer allowed for parsing avcc atom to 1024

CRs-Fixed: 344358
(cherry picked from commit bb882935c0fb337c674891199238f6564252e3a2)

Change-Id: I9e6b1ab676afda707632e95a083982bba4bf2cf1
libstagefright: Add member variable to save arbitrary mode value

- Add member variable in OMXCodec to save aribtrary mode
  value. (default: true)
- Avoid overwriting the value of key kKeyUseArbitraryMode in
  track metadata. OMXCodec::Create gets a const pointer to
  the track metadata.

Change-Id: I94dd24933f112109a1469b2b2a24f0b82b19a104
CRs-Fixed: 340148
(cherry picked from commit e4c000bad2e669d156c82887070c5f37f7b1c00c)
libstagefright: Fix RGB565 buffer width calculation for thumbnail generation

- The width of the RGB565 output buffer is aligned to 4 to
  match the input requirements of the Tile4x2 to RGB565 color
  convertor.
- This extra padding is unnecessary for other color conversions
  (e.g. OMX_COLOR_FormatYUV420Planar, OMX_COLOR_FormatCbYCrY to RGB565).
- This fix restricts aligned output buffer width to some color formats.

Change-Id: I4dd78143b950f793d74499220d9aaf88656e87f2
CRs-Fixed: 346285
(cherry picked from commit eecec1238bb76f5a10b3732f226b06935ff57f08)
LPAPlayerALSA: Fix for acquire/release Wake-locks.

 -Requires a wake lock to ensure that 3s timer after playback runs
 in suspend mode to get into TCXO shutdown.
 -Add support for acquiring wake locks from mediaserver process
 -PowerService is used for acquiring/releasing wakelock

Change-Id: Icb21c319eee24aa38d56afcd8eddcb6315b74558
CRs-Fixed: 338542
libstagefright: Broadcasts intent for the start and end of secure playback.

Broadcasts intent for start and end of secure
playback so that other services (Wifi-Display)
can find out whether secure or non-secure
session is going on.

Change-Id: I1179ba92851da4628068ede41fa139c5ceefa912
libstagefright: Fix concurrency issue during A2DP switch.

- When A2DP is disconnected, Pause is issued by the app.
  Sometimes, pause happens concurrently with stop, resulting a
  stuck in write.
- Fix the issue by switching the sessions, when resuming the
  playback so that above concurrency is avoided.

CRs-Fixed: 338086
(cherry picked from commit 29c0c17f53b6c945605e91da9108eea958b17bea)

Change-Id: I7ee7a3ca0569006c404cb5cca885271b53476695
libstagefright: Fix for CTS MediaRecorder test cases

The static keyword in a declaration of a local variable in an
mpeg4 writer function is causing the variable to be initialized
only the first time the function is called.

Because of this, the variable is not being re-initialized properly
when the function is called again on subsequent record attempts,
leading to a recording error.

This change removes the static keyword from the variable
declaration.

Change-Id: Ifb1348eb38377c844e2e024bface8c735271045c
CRs-Fixed: 346553
Revert "Select texture target based on pixel format"

Automatic revert was not possible.

Graphics team completed the optimizations for GL_TEXTURE_EXTERNAL,
and this change is no longer required in frameworks.

CRs-fixed: 328074, 345078, 344565

(cherry picked from commit d92e9b84416de933205d7285998baa2ab5d66816)

Change-Id: I4196021cdd70d6884eaf99bd2c1ce5adc41c3f87
services/surfaceflinger: Allow HWC to handle alpha blendng in both
                         C2D and DYNAMIC compositions

HWC can handle alpha blending in both c2d and dynamic compositions.
For rest of the types, it can fall back to GPU.

Change-Id: I8e54ff4a90e764d54d06c981a26a156cb279d071
(cherry picked from commit 81921351818ec7609fb53686b3a86b7877382b96)