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>
add gps gid to system_server

system_server hosts gps service, it should pocess gps
gid, so it can communicate with native gps daemons.

Change-Id: I59d7e99ec996891b19fa15a3ed66e055e6bccad8