Update the layer's alpha value upon composition of the layer

Fixes: This patch makes sure that the layer's alpha value is
up-to-date and does not reflect the previous view's alpha value.
It fixes the square block on marquee fading edge when text view
is applied transparency.

CRs-Fixed: 562000

Change-Id: I397308b739f5f4fe4b630cf594825f401c97e0e3
Fix a JNI local reference leak in JNIMediaPlayerListener::notify.

Bug: https://code.google.com/p/android/issues/detail?id=62137
Change-Id: I776cd83a66de37fdbbe8af367bf1b26e5e0c7247
Remove possible leak when exception occurred.

nameUtf8 is not released after exception.
In addtion, Fix code going down after ThrowException.

Change-Id: Id46e8ed55acd98e982ae532f7da2c0c48847f010
base: added screenshot delete action in notifications

allows deleting a screenshot from the notification
inspired from CarbonRom - initial from CM I guess

Change-Id: I67b7b9a7808ddb8c54ea4f3a45aad6d44833e1df
Fix NPE in ConnectivityService

Could occur when requestRouteToHostAddress is called on a network
with no associated tracker.  Code later in the method handles
this case gracefully but code introduced in JB throws an exception.

Change-Id: I6c8a0e313ecbcca120aeb5dd0802a72114749aa1
Memory leak in IInputMethodSessionWrapper executeMessage

In some cases the executeMessage is called with
mInputMethodSession == null. For the messages

DO_UPDATE_SELECTION, DO_APP_PRIVATE_COMMAND

memory is leaked. This commit recycles the args freeing
the allocated memory.

Change-Id: Ic5455a993442780d43a3b0b02e84a7ab931010b1
Squash: Memory leaks, NPEs, races and optimizations for fw/base

This is a combination of 13 commits.

The first commit's message is:

Fix a programmatic smooth scroll bug

Bug: smoothScrollToPosition() stops at child view of which height is
higher than list view itself.

Signed-off-by: Yongyi Li <yongyi.li.cn@gmail.com>

This is the 2nd commit message:

Fix infinite recursive loop

There is an apparent recursive loop at IntProperty.java
in method set(Object, Integer)

This method unconditionally invokes itself. This would seem
to indicate an infinite recursive loop that will result in a stack overflow.

This was brought over from out original JB branch.  Somehow, this got
overlooked, and never made it into JB42.

This is the 3rd commit message:

Rework thumbnail handling

Since ids of media file are usually not continuous, the original file of thumbnail are
sparse. When there are big numbers files on ex\
ternal storage, the size of this file will be horrible.
Ex, when the id is 20000, then the .thumbnails/.thumbdata3-xx file will be 50000*10k = 488.28M.
Can refer http://stackoverflow.com/questions/12396715/android-huge-thumbdata4-file-in-dcim-folder
Because after 4.0, MediaProvider will scan any files, this will be a big problem. So I modify MiniThumbFile.java to avoid this.
According to the id, we now produce an index file. In this index file, one id will use BYTES_PER_MINTHUMB_INDEX(8) bytes in offset (i\
d+1)*BYTES_PER_MINTHUMB_INDEX. The data of these 8 bytes is the index of thumbnail file. The first BYTES_PER_MINTHUMB_INDEX bytes kee\
p next available index. And when you need insert a thumbnail, the index increase by 1. In this way, the block data in thumbnail file \
will be continuous. And thus unnecessary zero paddings will not be saved.

This is the 4th commit message:

frameworks/base: Fix for the race in Wallpaperservice

Wallpaperservice has a race among message handler of
DO_DETACH and service's onDestroy. In certain cases,
the engine kept track in mActiveEngines is removed by
message handler of DO_DETACH and service's onDestroy
doesn't get a entry in mActivieEngines and isn't able
to invoke detach. This keeps the broadcast receiver,
mReceiver active and is unregistered by the framework
and a corresponding leak is reported.

  Later, the message handler of DO_DETACH continues
and invokes detach on mEngine, which attempts to
unregister mReceiver and framework throws an exception
"Receiver not registered: android.service.wallpaper.
WallpaperService$Engine$1@40874580" and causes the
framework to reboot.

  In case of system_server, WindownManagerPolicy and
android.server.ServerThread contest for access of
shared members, mActiveEngines and mEgine. Fix is to
protect the critical section via synchronized block.

This is the 5th commit message:

Make EntropyMixer mix in output of Hardware RNG into Linux RNG.

On devices with Hardware RNG (HW RNG), this makes EntropyMixer
periodically (every three hours) read 512 bytes from HW RNG and mix
them into the Linux RNG.

This is done without increasing Linux RNG's entropy estimates to
avoid having to trust the quality of the HW RNG. This approach cannot
reduce the quality of the Linux RNG output, but may increase it.

This is the 6th commit message:

build core/jni with fstrict

This is the 7th commit message:

Reduce EntropyMixer seed size from 4096 to 512 bytes.

The suggested seed size from Linux drivers/char/random.c is 512 bytes
rather than the 4096 bytes currently used.

This is the 8th commit message:

frameworks/base/: Fix black wallpaper issue when home pressed.

In the specified usecase, there is a completely new set of
windows that appear on the screen during rotation. And the
existing code in the framework ignores the drawstate of the
hidden windows.

Wait till the drawState is ready for the hidden windows also.

CRs-Fixed: 521758

This is the 9th commit message:

Fix to NullPointerException when activity is relaunched

When ChooseTypeAndAccountActivity is relaunched and resumed
by ActivityManager a call is made to onActivityResult without
first triggering onResume. This leads to mAccounts object
still being null.

Fixed by properly setting mAccounts object if it is null prior
to use after function onCreate has been called.

This is the 10th commit message:

Remove possible leak when exception occurred.

nameUtf8 is not released after exception.
In addtion, Fix code going down after ThrowException.

This is the 11th commit message:

frameworks/base: Fix to remove exception in tonegenerator

- Framework reboot happens, if tonegenerator fails to create
  a track in audioflinger.
- The cause for framework reboot is, an exception thrown by
  tonegenerator if fails to init.
- Fix is to remove the exception and delete the tonegenerator
  instance.
CRs-fixed:466491

This is the 12th commit message:

framework: packageinstaller :fix logical error in size calculation

fix logical error in available size calculation.

This is the 13th commit message:

frameworks/base: move the traces file to avoid data loss

If an ANR comes just after the framework reboot, the traces for
the framework reboot will get over-written with the ANR traces.
So, We are missing the traces for the framework reboot which
makes debugging the framework reboot difficult.

This patch will rename this trace file for the framework reboot
once the ActivityManager collects the traces.

Patchset 2: Made commit message easier to read

Change-Id: Iee07b13ba02d8aab9cc43567aa5df131cc43c737
systemui: turn off debugging

should be all of it

-VanirAOSP

Change-Id: Ia279a1be6968f67a4ad448cf51743f4c455af88a
remove notification panel touch debugging

by associating it with a debug tag like it should have been in
the first place WTF?

Change-Id: I409f318e78b199d9453a3deeb5f3165bfb68f0ea
Smoother Upload and Download Animation

renamed stuff version ps2: renamed download_done drawable
renamed stuff version ps3: renamed upload done to match

Change-Id: I6e6409cc85ad951019dbac10156d4aed92f4c5bc
Signed-off-by: DHOMD <DHO@dho.im>
Don't rely on gcc extensions

Variable-length arrays of non-POD data types are a gcc extension
not currently supported by clang.

Change-Id: I9cd1aed742ac70e642771ff455582727fbafaec2
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Memory leak: parseObbFile.footer

Change-Id: Ia9e005e63fad7ab364f6c2c80cb98ec98f89b470
Signed-off-by: You Kim <you.kim72@gmail.com>
fix possible buffer overrun and memory leak

Use snprintf instead of sprintf and fclose() before return.

Change-Id: I3ed193464cc0dc90e9935ae19162667ad367628b
Fix memory leak in PatchCache

Patch object should be deleted when removing its corresponding
cache entry from PatchCache.

Change-Id: I8dfd7f557f6e5c6e9a9c04ba915372790e6f34f5
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>