Fix sluggish to launch an app

The new trace feature/code in 4.0.4, which will dump the app stack
trace every 500ms if an app can't be launched within 500ms, is
holding the global ActivityManagerService lock unnecessarily. It
slows down the app's startup.

Change-Id: I91fbb043912b4d1fcf3e80d8ac4e61cd20ad89d1
Solution: move the trace file write operations out of sync block.
Fix cursor memory leak

In current code, if an application opens a cursor to access a
provider, and doesn't close that cursor, later, when this cursor
is garbage collected, it won't get closed. This will cause a memory
leak in the provider. The leaked memory can only be reclaimed when
the application with the leaked cursor was dead.

The solution is, close the cursor when it's garbage collected.

Change-Id: I786915c46d4672b6b1b37414b3bc1ff8cea2e00b
ActivityManagerService: stay away from zombie content providers

When the lowmemorykiller kills a content provider in an unfortunate
moment, an innocent client app can become attached to a zombie provider
and be unconditionally killed moments after, when the dead provider is
being removed.
Prevent this race by addition of isAlive function to Process.java that
determines whether a process is still running and is not only a zombie,
add a check of the state of the provider process to getContentProviderImpl.

Change-Id: Id753b8dab103e4b447c4138468938ca9f5cb857d
samsung: set proper native color format if using samsung codecs

Change-Id: Ifd76d88f9f7a1947a1583322f0a675dec6d12edf

Signed-off-by: dhacker29 <davidhackerdvm@gmail.com>
Add SamsungCDMAQualcommRIL class for CDMA Galaxy S III family based on msm8960.

 * Samsung CDMA RIL doesn't send CDMA NV in RIUM infomation format which causes the CDMA RIL stack to crash and end up not being provisioned.
 * Samsung put CDMA NV in GSM format. I forced the RIL stack to process CDMA NV request as a GSM SIM in CDMA mode.

Change-Id: I733a635edc645f4e7952083008e7eca12d7af015
frameworks/base: tilerendering with fbo boundaries

WARNING TESTED WORKING ON TUNA, i know some adreno chipset
phones do not like this commit. As we have added new moto devices
I have not checked to see the chipsets they use but Im pretty sure
all of our devices should be fine, OpenGlRenderer.cpp conflict
resolved easily.

1)tilerendering support when rendertarget switches
2)removed few rendering target switches to improve performance

Change-Id: I42c76e201537bd989631e11b0227ebcdc980f38b

Conflicts:
	libs/hwui/OpenGLRenderer.cpp
Merge "ActivityManagerService: stay away from zombie content providers" into ics
Merge "samsung: set proper native color format if using samsung codecs" into ics
Merge "Add SamsungCDMAQualcommRIL class for CDMA Galaxy S III family based on msm8960." into ics
Merge "Fix cursor memory leak" into ics
Merge "frameworks/base: tilerendering with fbo boundaries" into ics
Revert "frameworks/base: tilerendering with fbo boundaries"

This reverts commit dcc0b0f4230c395ffda85d16270c5abdb63330bb.
dock compatibility tf101
Implement additional keycodes

Adds keys for

*) WLAN, Bluetooth, touchpad toggle,
*) brightness down, up, auto and
*) screenshot

as found on docks of current Asus Transformer devices.

Change-Id: I94a5a4e80e5de85db49a1044c7dcb9ef28db075c

Conflicts:

	core/java/android/view/KeyEvent.java
Load a device specific key handler

Configurable via overlay settings config_deviceKeyHandlerLib and
config_deviceKeyHandlerClass.

Change-Id: Iec99d52f4a665e59cd13939af62f9b5b3becd375
policy: Fix slide lid open state

by commit 4aed78b5056560f499e5953f659fa90a06ecc38a lidOpen was reverted.
fix to make lidOpen true when sw == 0.
and fix getStateLocked()/getState() to get UP/DOWN state correctly.

Change-Id: I22a185478be860f1c88cf56d7ef3d0b3a8617459
Dispatch keys to a device specific key handler

Injects a device key handler into the input path to handle additional
keys (as found on some docks with a hardware keyboard).

Configurable via overlay settings config_deviceKeyHandlerLib and
config_deviceKeyHandlerClass.
fix

Change-Id: Ia63c90e8086a48fae3aff95bfeda3ee6e0054c12
Implement additional keycodes

Adds keys for

*) WLAN, Bluetooth, touchpad toggle,
*) brightness down, up, auto and
*) screenshot

as found on docks of current Asus Transformer devices.

Change-Id: I94a5a4e80e5de85db49a1044c7dcb9ef28db075c

Conflicts:

	core/java/android/view/KeyEvent.java
Merge "Load a device specific key handler" into ics
Merge changes I6300e217,Ia63c90e8 into ics

* changes:
  Implement additional keycodes
  fix
Squash of 4 arm optimization committs

libagl: Enable CLZ instruction generation

Change-Id: I9d91f55b4bf06e9680f21d6c14c69ff68237c5ad

libagl: Reorder VFP optimized matrix multiply

Conflicts:
	opengl/libagl/matrix.cpp

libagl: Optimize matrix multiply using ARM VFP

We can use ARMv6 VFP to optimize matrix multiply manipulation in libagl.

Use angles as test benchmark program. Here are the reference results per
1000 times on TI OMAP3 600 MHz (Cortex A8) target:

[before]
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 1983
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 2075
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 1953
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 1922
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 1953
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 2075
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 1953
Avg = 1987.71 ns

[after]
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1739
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1892
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1739
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1770
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1739
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1892
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1739
Avg 1787.14 ns

Improvement: 10%

Conflicts:
	opengl/libagl/matrix.cpp

libagl: Optimize matrix multiply using ARM VFP

We can use ARMv6 VFP to optimize matrix multiply manipulation in libagl.

Use angles as test benchmark program. Here are the reference results per
1000 times on TI OMAP3 600 MHz (Cortex A8) target:

[before]
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 1983
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 2075
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 1953
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 1922
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 1953
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 2075
D/StopWatch( 3018): StopWatch? matrixf_t::multiply (us): 1953
Avg = 1987.71 ns

[after]
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1739
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1892
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1739
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1770
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1739
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1892
D/StopWatch( 3070): StopWatch? matrixf_t::multiply (us): 1739
Avg 1787.14 ns

Improvement: 10%

Conflicts:
	opengl/libagl/matrix.cpp

Change-Id: Ifffa0226b50eddaa9e03cdb773eef3b4c532a834