Fix graphics corruption caused by non-uniqueness of a resource address

Some caches(PatchCache, TextureCache, PathCache) for HWUI uses deferred
removal for their cache entries even though actual resource objects
are already freed by ResourceCache.
For this reason, the uniqueness of a resource address is not guaranteed
in specific cases. (When malloc() and free() are called very frequently,
malloc() can return the same address.)

For example, it can be possible that a cache have two cache entries
for two different resources but the same memory address.
(Of course one of the resources is already freed.)
It also can be possible mGarbage vector in PatchCache has duplicated
addresses and this can lead to duplicated free blocks in the free
block list and graphics corruption.

So this patch makes sure resource objects are freed after the resources
are removed from the caches to guarantee the uniqueness of a resource
address.

Change-Id: I040f033a4fc783d2c4bc04b113589657c36fb15b
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Fixed issue 55781: OS restart when uninstall app.

OS restart when uninstalling after calling PackageManager.setComponentEnabledSettings().
A broadcast with action android.intent.action.ACTION_PACKAGE_CHANGED will be sent after
10 seconds when setComponentEnabledSetting is called. Within this 10 seconds, if the app
is uninstalled, a IllegalArgumentException with message "Unknown package: xx" will throw
in Settings.getApplicationEnabledSettingLPr. This IllegalArgumentException will catch in
LoadedApk.ReceiverDispatcher.Args.run() and throw RuntimeException. That cause the system
restart. Now I add logic to check if package exists to avoid such exception.

Change-Id: Ib5589ddcf6d9ff4362cff492d114aa5046a447b0
Fix one and hide the other warnings from core/jni

Most of the warnings are unused parameter from skia functions.

Change-Id: I9df57718d117c26b96163f751ccb056ca86ac072

Conflicts:
	core/jni/Android.mk
Fix to fatal exception caused by LockSettingsService

SQLiteException is thrown when attempting to read stored value
from database causing fatal crash in PowerManagerService
during LockSettingsService.readFromDb function call.
Resolved by securing proper use of database reading and cursor
management by adding try-catch-finally clauses to function.

Change-Id: I5584a7b4c2f278fe845e1ffb434dc80e63a4d8ff
Signed-off-by: pcarenza <pcarenza@gmail.com>
ContentProvider: Avoid duplicate initialization of AsyncTask

AsyncTask is being initialized by ActivityThread to ensure its static
handler initilization and ContentProvider need not duplicate the logic.

Change-Id: I48bc88bdba32b56114f09c04a75480e26508f704
WiFi label is not a Quote!

Cleanup the damn quotes around the WiFi label in the
notification panel. This only removes the quotes from the first
and last positions of the string.

PS 2 : WiFi name can have quotes!

Change-Id: I90badb7b2d8160e41da2632dac79042c4be37f2a
Signed-off-by: pcarenza <pcarenza@gmail.com>
MediaScanner: delete abnormal elements in prescan procedure.

There is a race in MediaProvider's mUnmountReciver.
when it doing external storage's database clean up at power down procedure,
if the datebase is big, system may shutdown after db.update, but db.delete
not done, there will be many elements with no filename in the database.
That may cause duplicated files and folders shown in MTP.

This patch clean up these abnormal elements in MediaScanner's prescan procedure.

Change-Id: I0a3dacffd12892b1a2a892b2749a02ab3dea109b
Author: Liang Wang <liangx.wang@intel.com>
Signed-off-by: Liang Wang <liangx.wang@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 58969
Signed-off-by: pcarenza <pcarenza@gmail.com>
Mms: Fix FC issue that when tapping contact icon many times

Add protection to check the extra string info from bundle before making
the URI, to avoid null pointer exception.

CRs-Fixed: 534089

Change-Id: Ie8c78ca42c290e16afa1fefeb01ea67c8e963b06
Remove unnecessary updateSurfaceScreenOn call.

This change stops updateSurfaceScreenOn() from being called one time
right after another. It's called at the end of stayAwake(boolean awake),
which is called right before updateSurfaceScreenOn() in release().

Change-Id: I3e5db322f0abce0cd37320a103015ba72dffa64f
Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Fix for positioning of glyphs within a bitmap

For positioning of glyphs within a bitmap, roundf(int + float) is used,
where the float is the glyph position and the int is the text position.
When the text position is varied, this may lead to the sum being rounded
in different directions, due to floating point rounding, caused by that
floating point numbers have different precision in different ranges.

This may therefore lead to slightly different positioning for glyphs and
therefore slightly different widths and heights for text strings,
depending on the position they are rendered at.

The solution in this patch is to use int + (int) roundf(float), which
has consistent rounding, and also enables us to use the full range of
ints.

Change-Id: Id1143cdfcbdfa9915ced878ae04df589a3e03cee
Fix getBytesSize for YUV allocations.

bug 12134914

Change-Id: I128e75b756a5bd129077177e254f1db6c94182f1
Increasing Ringtone

Implemented Increasing ringtone, ringtone will increase
if user does not answer call.

Added setting INCREASING_RINGTONE

Change-Id: Iadfb38f7a096d6f4140fab830da40100e8bfaa3b
keyguard: fix delay lock screen sound

Change-Id: Ia4cd2c856df1573856386e1597dcc0a9600d25a5
JIRA: CYAN-3362
Issue: https://jira.cyanogenmod.org/browse/CYAN-3362
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>