Electron Beam Animation (1/2 Frameworks)
libstagefright - correct casting of composition time

 - in SampleIterator, findSampleTime needs to correctly cast
    composition time to a signed integer to allow for negative
    values
 - the cast was accidentally removed with 64 bit time stamp change

Change-Id: I52994ac4be817ad771cac4f50333940af523c81f
CRs-Fixed: 360150
(cherry picked from commit 98044856c1513e4c2d7ab9ad7c5362578e66100a)
Support a new ANDROID_AAPT_IGNORE env var.

AAPT has a fixed built-in list of files and directories
to ignore when parsing resource files. Over the years we
always had developers requiring specific patterns.
If the env var ANDROID_AAPT_IGNORE is set, it is parsed
to find which file/directory patterns to ignore.
Otherwise a default is used that matches the current behavior.

Added a command-line option for it:
  aapt di --ignore-assets "foo*:*.blah"

SDK Bug: 5343 24067

Change-Id: Ia4caa2a8188c8c1df143f884e459b8182645995f
libstagefright: Fix Loading Video displayed even after rebuffering Issue

This change fixes the Loading Video Icon being displayed even after
rebuffering is complete.

It also fixes AV Interleaving Offset calculation which was calculated in
bits. With this change, we are calculating AV Interleaving offset as
bytes instead of bits.

CRs-Fixed: 355654
(cherry picked from commit 90d13f1ed8144cdd89c36ccb61390adcf39522be)

Change-Id: Ic8bb76668e659653b33093d5bd4728d6da13e801
stagefright avcenc: Switch tmp variables to use the right type, to avoid casting

This fixes building on platforms where int is smaller than
pointers, e.g. 64 bit platforms.

Change-Id: I3da0459bac10cbffd1db699bf4782fe926cd391f
stagefright avcenc: Use intptr_t for casting pointers to integers

This is used for doing integer arithmetic on the pointers, for
checking pointer alignment.

Change-Id: I7a7ff834dc631ac9cce90e46216f64645e1ae6e5
String on Toast notification does not aligned to center

If length of the string being showed on Toast is short (less than 8 chars),
it is aligned to left rather than to center.
Added attribute android:layout_gravity="center_horizontal" on the TextView where Toast's message are shown to fix issue.

Change-Id: I77669fd8a11d1ec8f6b082348eb818671ce158bb
Signed-off-by: Taeho Kim <jyte82@gmail.com>
Telephony: Handle Data Call List

* Check call status before validating data call state
* Remove duplicates from the list of data calls
* Add RIL_UNSOL_DATA_NETWORK_STATE_CHANGED string to RIL

Change-Id: Iea75053cb8226ec15d2a2c11a73332e5ebe8c793
Telephony: Add DORMANT state to GSM data link activity

GsmDataConnectionTracker sets its activity flag to DORMANT and notifies
LinkActivity when RIL indicates that all its data calls are in
dormant state (i.e. active is set to 1 in UNSOL_DATA_CALL_LIST_CHANGED
message for all data calls)

CRs-Fixed: 332606
(cherry picked from commit 6b57c3b68d989d6b8f114c5f87dac6fc2c13a5f5)

Change-Id: I1d4b9fd24c4049a938d62f08b7720d47400ad7e1
Telephony: Optimizations on alarms used

* Use non wakeup alarms for data stall detection
* Stop data stall alarms during dormancy

CRs-Fixed: 334349
(cherry picked from commit 3512da1c22a8bdb82d633b93a6f2de608f1b4b08)

Change-Id: I2a7654d7cf888d63bf3862d33f126218c409ffd4
surfaceflinger: Fix top-bottom UI composition with S3D.

-Fix the scissor computation for top and bottom frame in S3D.
-Fix the artifacts seen in top-bottom case by clearing the
 color buffer with scissor applied.

CRs-fixed: 346986
(cherry picked from commit 241b5b6b41fa4e1b2eca3565fd27b454a6aff262)

Change-Id: I8fb98007f67351009762c4494e260142b998ddb5
Add a new API on DRM Framework for streaming

In case of DRM streaming, decrypt session can start just after
receiving the header, and it doesn't need to wait for the entire
content. However, current API of DRM framework only accepts file
handle or URI. With this new API, DRM session can start
without waiting for the entire content.

Changes are made by SEMC and Sony.

Change-Id: I74375fe127df636067f1c300ea91654ba3d1aa3c
libmedia: Fix build with gcc 4.7
libstagefright/matroska: Fix build with gcc 4.7
libstagefright: Fix for seek before end of clip issue

- When the clip is seeked to just before the end of the clip,
  the control skips to next track instead of the remaining part
  of the clip being played.
- When the clip is seeked, in LPAPlayerALSA, fillBuffer() is
  called which sets mReachedEOS to true when the last buffer
  is reached. AwesomePlayer on the other hand calls
  onCheckAudioStatus() after seek complete which in turn
  checks if reachedEOS() returns true in LPAPlayerALSA and
  calls postStreamDoneEvent(). Currently, reachedEOS() returns
  mReachedEOS which is incorrect because there still are
  buffers to be written to the DSP.
- Before postAudioEOS() is called, mReachedOutputEOS is set to
  true and is returned by reachedEOS().

CRs-Fixed: 339602 359591
(cherry picked from commit fe2345716be459f38088df2af79b53b1acf71d36)

Change-Id: I1334c8b0ab1e1d6cc386cc770c73ddc50af25c2e
libstagefright: Fix for ASSERT failures while Playing Unsupported Conent in HLS

When we play unsupported content, the Setup  Video
Decoder fails. This results in a Check failure in ConfigureCodec.
The change allows graceful exit whenever we try to play unsupported
content.

CRs-Fixed: 349549
(cherry picked from commit c54e2ae2b87be8dd0a846017ac5884fcb9a2dbf2)

Change-Id: I1de49369988fb2638146551c93ed467f65a3c040
libstagefright: Fix timestamp for MP3 frames in TS container.

- No AV sync and video playback is not smooth for URL's which
  are having mp3 audio.
- Issue is that all the mp3 frames in the TS packets are assigned
  same timestamp.
- Solution is to incrementally add frame time with the PES time stamp
  from 2nd frame onward

CRs-fixed: 331478
(cherry picked from commit 40d2d824f819d055aa825cc3778f0ec3d6f3d844)

Conflicts:

	media/libstagefright/mpeg2ts/ESQueue.cpp

Change-Id: I85ae1b62989e09dd23e791ea55598334dd33cec5
FileInputStream is not closed in "UserManager.java : readUserList()"

Change-Id: I50f54c70c8b6bc808fa59ce589b0480780cc811b
Wipe the user data out in any case.

When the external storage is not mounted, the android system won't
wipe out the user data (i.e. "/data") if wipeData() is called with
the flag WIPE_EXTERNAL_STORAGE.

We think that the user data should be wiped out in any options and
also wipeData(int) method currently supports also for a external
storage. So we will also change the API reference comment.

If we should care about backward compatibility of this method behavior
with the option WIPE_EXTERNAL_STORAGE, then we would add an another
bitmask something like a ALWAYS_RESET.

Change-Id: Id7bf673c722bacc0480d32e46553b9a348513879
libstagefright: LPAPlayer: Fix choppy playback on BT.

-Music playback on BT A2DP device is choppy/glitchy
-Decoder thread hogs the CPU this starves A2DP thread from data.
-Fix is to use small buffer(64k) only in the case of A2DP playback.

CRs-Fixed: 33353851
(cherry picked from commit e64bb36f81b22c93d3af156451b1236966c99ea4)

Conflicts:

	media/libstagefright/LPAPlayer.cpp

Change-Id: I2e9450a2be6f9e79e68d525d2119d33154d132b7