Change SQL to improve performance.

To know the number of images, use "COUNT(*)" instead of "_id" in SQL.
Using "_id" gets all result set. and when getCount() is called, CursorWindow is filled.
But using "COUNT(*)" gets just 1by1 data.
So using "COUNT(*)" is more faster than now.
And this SQL is called everytime per a file during a file transfer in MTP
The better way is by using "EXIST".
But if using "EXIST", modify MediaProvider.call() method.
So i applied just a "COUNT(*)"

Change-Id: Ic5882af0fad2304f836b7b7043a4746359391609
Signed-off-by: muzbit.kim <muzbit.kim@lge.com>
frameworks/base: Fix aliasing violations

Fix violations of strict aliasing rules

Change-Id: Ia83db6a0be18f52e8f274c581c3b42f031b39247
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

frameworks/base: Fix various aliasing violations

Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

frameworks/base: Fix compile errors

Fix ISO C++11 incompatibility in TextLayoutCache and
aliasing violation in FontRenderer

Change-Id: I19a9560737005e72f706c12c0ccfdcd0c7765b06
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

Conflicts:

	libs/hwui/FontRenderer.cpp
	libs/hwui/ShapeCache.h
	libs/hwui/TextDropShadowCache.h
	voip/jni/rtp/AudioGroup.cpp

Conflicts:
	core/jni/Android.mk
frameworks/base: vectorize Bitmap operations

Enable gcc vectorizing optimizations for Bitmap operations within
libandroid_runtime.so.  Adds -ftree-vectorize -mvectorize-with-neon-quad
-fprefetch-loop-arrays to functions and compiles Bitmap.cpp in ARM mode
(necessary to enable vectorizing optimizations) for appropriate targets.

Change-Id: I12defef6f47adf41af849df6e750097f5906d92d

Conflicts:

	core/jni/Android.mk

Change-Id: I7e19ffaf816d3cefe0d523dc4e258cfb27b90992
Vectorize bitmap operations on A15 too

 * Commit a2e20761b5ad646ce3f08ed24995799dd81acee0 enables GCC
   vectorization for bitmap operations on Krait. Enable it on A15 also.

Change-Id: I1f733f5311376deb78782931ea2b83a8d12c2171
Update the color of the expandable volume panel icon

This still retains the old settings icon since it happens to fit perfectly. Pressing it does indeed show you a bunch of sliders like the icon indicates.

Also add xhdpi and xxhdpi versions.
Add sample profiling interface to startMethodTracing.

Frameworks base side of this change. Also changed art and libcore.

Change-Id: Ib5ba0445163dca714d1ae66430750346ff8811be
Remove unused JNITest class

JNITest class is no longer actively used. This patch
removes the class (java and jni) files.

JNI interfaces and calls are extensively tested in
the art unit tests (art/tests) and in cts (see
CtsJniTestCases).

Change-Id: I62f7c72deb5d206fa3f545ae39a9cb9011110d0a
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Fix descriptor leak after accepting connections

After accepting a connection on a listening socket and
storing the resulting FileDescriptor into a newly created
LocalSocketImpl, the new impl's "descriptor was created
locally and should be closed normally" flag should be set.

(cherrypicked from 3e7305c6bf6062b5cb1e2ddcec6c6d30b4a8bc0d)

Bug: 11805817
Change-Id: I0a1a7c62ec3fbcf647a44a22110ddc778d14e5f4
Release locked buffer when it fails to acquire graphics buffer

The JNI buffer in ImageReader_imageSetup is not released when
it fails to acquire graphics buffer. After all JNI buffers are
exhausted, ACQUIRE_MAX_IMAGES will be returned and leads to
error. The JNI buffer should be released when it fails to acquire
graphics buffer.

Change-Id: I3319a58ac44e36c8593b404672a685c4b589a735
Kill logspam
Volumes in Settings/Sound is slow to start

There is a delay after pressing volume menu item
there is a delay until the Volume popup is shown.

The reason for this is that the initialization of
the different seekbars is slow and run in the main
thread. More specifically the call to get the
ringtone from the RingtoneManager is causing this
delay.

Moving the call to the ringtone manager to the
handler thread used to play ringtones to make
the launch of the volume dialog a bit snappier.

Change-Id: I76da0226592468debd542d67164b37b2b59897c7
Fix libinput to build with uapi headers.

Bug: 11559337
Change-Id: I00ca91162de7cd42e03df23bbe4208e169b2ebfe
Use index in SparseArray access properly

The original code was calling get() rather than valueAt(),
treating index as if it was a key.

Change-Id: I52539dfcb49b3d2ee3cb027d38c50b46f73b5ee7
Signed-off-by: Igor Chernyshev <igorc@google.com>
Make SurfaceView layers captured by screenshotApplications()

Since SurfaceView layers are located below application layers,
SurfaceView is not captured by screenshotApplications()
when the application is running in fullscreen.

Moreover, ws.isFullscreen(dw, dh) returns mostly true
on the devices which do not use the navigation bar.

Change-Id: Ia1036c79054950384a97504714929fd85c8147de
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Add dalvik.vm.gctype to enable switching between different GCs.

The option passes the specified GC type into the Xgc runtime
option.

Currently the three different supported GC types are MS, CMS, SS
which represent mark-sweep, concurrent mark-sweep, mark-sweep +
semi-space hybrid.

Change-Id: I6ad95c8d12c0d1158f7c861ff0c3180761619172
Minor changes to LinkAddress.

1. Simplify the parceling code. Since the InetAddress inside a
   LinkAddress can never be null, we don't need to special-case
   the case where it is.
2. Add / update method documentation.
3. Write a unit test.

Change-Id: Iba0a8cecc683d55d736419965e72ee33dd66dc22
Fix inconsistency in LoggingPrintStream.

LoggingPrintStream prints "null" for null strings from
print(String) but throws an NPE from println(String).

Fix this by delegating to the underlying builder (and avoiding
the "fast" path when the input String == null)

bug: https://code.google.com/p/android/issues/detail?id=63380
Change-Id: I89c5c12db6ed5af8037d46f67369b38c5b4cbc9f
Remove stray logging statement.

bug: https://code.google.com/p/android/issues/detail?id=66974
Change-Id: Ie34c102de143cf6aeb16c78778dda3ef5e928380
AudioService: Fix absolute volume for AVRCP

Avrcp.java uses max volume obtained by getStreamMaxVolume() when
converting to AVRCP levels and it returns non-scaled volume index.
For this reason volume index needs to be dispatched to Avrcp before
scaling as otherwise Avrcp will convert volume level incorrectly,
i.e. max volume index for music stream is 15 and any volume index
>1 (>10 after scaling) will result in setting *MAXIMUM* volume level
on headset which is not safe for listener.

Change-Id: Ia799eec578ed2326ec18b69f2ee4f2a60c664514
remove unnecessary switchUser call

If userId doesn't change, no need to do switchuser.or it will
introduce some tweak for gps modules in quick off/on because
they need cost time in off/on.

Change-Id: Ie5e408dc8be69c8a63a18bcb2cfe478cef4d70e6
Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>