Add math library for renderscript native type

This commit adds an rsMath class that mirrors
the Renderscript math functions into the Android
system using the exposed native types.

Change-Id: I8af275e4f7afefc0dbcd90f73653e3263792c8a2
Expose more renderscript native type

Currently, Renderscript only expose a subset of its
datatype within the Android system. For instance, the unsigned
versions of the vector types for bytes, int, long and short are
not defined. In addition, while the signed scalar types for
renderscript have an elementary type equivalent, there is no such
equivalence for unsigned values.

This commit defines these missing classes and defines operations
for these types.

Change-Id: I45353a3b3f304051c072472284e7aefac60d127d
Extend Rs Math library to unsigned types

The RsMath library was created to support mathematical
operations defined upon reflected data type into Java.
Additional reflected types have been introduced but the
math library has not been updated at that time.

This commit extends the math library with new operations
defined for the new reflected types.

Change-Id: I8025976b449f96dcaea90648a8114ee6d5b98e1c
CompoundButton: Let text can be changed by config

Because CompoundButton freezes text inside onSaveInstanceState, the text
can't be changed automatically after locale of device changed.
Bug from such a case reported via url below:
https://code.google.com/p/android/issues/detail?id=24013

It would be better to don't freeze text for default case and let users
to freeze text if they need manually.

Change-Id: I2d6a192b6ff05a95b21487c2362cbc14691c68cf
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
p2p: Fix for discovery failure until STA is connected to AP.

The station when connecting to AP (wifi state is either
connecting or obtaining ip address) shall stop the already
issued p2p_find on the DHCP start and start the same after
the DHCP handshake. p2p service manager shall return a failure
for any p2p_find operation during these period resulting in a
discover failure.
Address this by deferring the p2p_find issued during this period
(set mDiscoveryPostponed to true) rather than returning a failure.

Change-Id: Icd54ecc57ea4cd8d5387794d34c0b422bc9d8509
Change the way to calculate the native heap size

Previously the native heap size returned by android.os.Debug's
getNativeHeapSize() is mallinfo.usmblks, which is the maximum
total allocated space. But this value is greater than current
total if trimming has occurred. In the output of 'dumpsys meminfo',
as a result, the native heap size dose not equal to the sum of
the allocated native heap size and the free native heap size.

I think this is misleading because actual and current footprint
of the native heap is usually smaller than the max footprint,
a peak number of bytes allocated to the heap.

This commit makes the native heap size returned by
getNativeHeapSize() to be the current footprint, which is the sum
of the allocated and free native heap size.

Change-Id: Ie5eec4ac43b82c8f8d7dcf9c6d7785fd9b4526eb
Signed-off-by: Kyungmin Lee <snailee@gmail.com>
UsbDebuggingManager: Fix possible multiple NPEs toggling USB debugging

This patch fixes two NPEs when toggling fast USB debugging many times.

Change-Id: I7ac039fe51a32d35ef00eaa71accb85cd57d4d8a
Signed-off-by: atl4ntis <atl4ntis@gmail.com>