GC triggering performance optimizations

Copy the correct starting heap size at process init.
Interfaces to set GC/managed heap parameters.

Change-Id: I3f3f60915e0c732436118e8e605393360c89bfe4
(cherry picked from commit a6f2e5f1162760178b8cb412c6beee6a5cbce429)
(cherry picked from commit fe9675349c1c0fe2a92e7cb2d9b8bd830f225103)
(cherry picked from commit be6f88153d8e515d9decf4274efdc5f76c87e2b9)
libcore: Do not pre-bind socket in connect method

The connect method in Java should not have to explicitly
bind to Inet4Address.ANY. For unbound sockets, the kernel's
connect function will perform an inet_autobind.

cherry picked from commit-id f4d980670fd4938a6b5ec07a5818454fc44f2a57

CRs-fixed: 370996

Change-Id: I56c4ec6215e3ae00b42c0579592628d02c9f1c9c
(cherry picked from commit c52ae135bb14a96d237e971fb01bfae30723be2a)
(cherry picked from commit adcee075eec0b2afd787d1179ccbf04c653a60b5)
(cherry picked from commit 57926ca5d077582f08d00e5d380de1fdb79384e0)
(cherry picked from commit afdcceb7ad17ab389707a0c7fb52564e92c5f47e)
Fix compilation of Enum on JDK 7

Change-Id: I2e58b6a527e4ef1fc7ed3359b8aea88d01a031fb

libcore: Better Enum fix for JDK 7

 * Jerome Pilliet suggests using a cast in the compareTo method instead of
   changing the field visibility. This is a much better fix.

Change-Id: I334105e0922225512a4d0a2d4b6c9c6ec71b9c51
GC triggering performance optimizations

Copy the correct starting heap size at process init.
Interfaces to set GC/managed heap parameters.

Change-Id: If0b1637291e77f9781ae6249c5d0257f659253ca
workaround an armv6 gcc 4.7 bug

this fixes com.android.phone getting a SIGBUS on startup due to mmap'd
tzdata reads that always crash in this libcore code.
gcc 4.8 works without issue and 4.6 worked fine with cm10.1, so this
workaround has been made specific to just gcc 4.7.

Change-Id: Ide3b33dd8bdbb1e0f1a91b65ba21c7aa8e276af5
art: Fix building under JDK7
Merge tag 'android-4.4.1_r1' into HEAD

Android 4.4.1 Release 1
Add CAP_BLOCK_SUSPEND to OS constants

Bug: 10901016
Change-Id: I162bde82bce9fca8eabc7168a172d3d8365e1578
libcore: Set CAP_LAST_CAP as CAP_BLOCK_SUSPEND

CAP_LAST_CAP was being set to CAP_ALARM_WAKE which did not allow
system processes to acquire CAP_BLOCK_SUSPEND capability.
This change correctly sets CAP_LAST_CAP to CAP_BLOCK_SUSPEND.

Change-Id: I812edf75eec8f228e2a5d49ae0d3a250e10e0994
Libcore: Add .aac MIME TYPE

Change will add support for .aac files.

CRs-Fixed: 573663
Change-Id: If2564b439fd5943396959ba1f6a2d7a5a53923ca
Fix an ASCIICharsetEncoderTest testcase.

Deal with truncated char sequences correctly.

bug: 10729779
Change-Id: I232b0ec899084270a6d621e6c7292ef8b94f8f7d
Fix a CharsetEncoder bug.

When malformed or unmappable characters span input
buffers, we'd end up setting a negative position on the
buffer.

Also fix up a few test cases which were wrong in
several ways.
- One test was simply checking for the wrong sort
  of exception (unmappable vs malformed)
- Another test was expecting encode() to throw an
  error (and ignoring flush) but the API allows flush
  to throw an error instead of encode.

bug: 10729779

Change-Id: I6560b749ca2445651d61ca651f8a5e388cf1c1b0
Finish fixing Zygote descriptor leakage problem

In order to prevent Zygote descriptors from leaking into the child
environment, they should be closed by the forked-off child process
before the child switches to the application UID.  These changes close
the descriptors via dup2(), substituting a descriptor open to
/dev/null in their place; this allows the Zygote Java code to close
the FileDescriptor objects cleanly.

This is a multi-project change: dalvik, art, libcore, frameworks/base,
and external/sepolicy are affected.  The CLs need to be approved
together, lest the build break or the software fail to boot.

Bug: 12114500
Change-Id: I8ea69de7b1cfbd811977a5629eb0af665f6dd66a
Remove old fork-and-specialize API

As promised, this is the cleanup patch-set which removes the
old native "fork and specialize" API, which has been replaced
by a slightly-enhanced one which can close the Zygote socket
descriptors in the Zygote child.

Change-Id: Icaeab730bee8638354dc664524e4118cdd946d2f
java7: Implement new Locale APIs.

Most validation and sanity checking is performed entirely
in java. We use ICU only for converting back and forth
between Locale objects and BCP-47 language tags
(toLanguageTag & forLanguageTag).

The new APIs also add support for script subtags and
manipulation of unicode locale extensions.

Note that we do not implement
IllformedLocaleException.getErrorIndex. If anyone complains
or if it proves useful somehow, we could plumb the information
through from ICU if required.

bug: 8992787
Change-Id: I9b2d7f8d17f970d1b57111dcfe92c16e68b0fa67
Locale: Retain compatibility with 4.4 APIs

Wrap the new methods from change I9b2d7f8d17f970d1b57111dcfe92c16e68b0fa67
in the previous public method.

Fixes libcore.icu.ICUTest#test_localeFromString

Change-Id: Icbffb5d5b55329f29c791b57d019817b5c298431
Revert "Fix a CharsetEncoder bug."

This reverts commit 653203d1e85f9eca7467ecab60c6000f415aae5d.

Revert "Fix an ASCIICharsetEncoderTest testcase."

This reverts commit fdd61c877cdd981789c976c2418aec0285af7233.

These patches are breaking the tests.api.java.nio.charset.* tests,
back them out. We can't change the underflow conditions without
breaking assumptions in the standard test packages.

Change-Id: I519e21cfef764b7b00fd37d22dc7509f902d3250
libcore: fix error in javdoc todo file generation

javadoc is faling to generate todo file due to
relative path and this is causing sdk build to
have spurious error. changing the path to absolute
to ensure file created and error fixed

Change-Id: I7c89942262434d9639b03f72fe886780f44bfba7
Audio: AWR-WB format playback support in email and download

- amr-wb format are not it the supported mime type
- Add amr-wb in the supported audio mime type

Change-Id: Iad721f86a9bc1eccf8c94204b7a4d47961dd1efa
CRs-Fixed: 637271
Add API to check certificate chain signatures

Add hidden API to check certificate chain signatures when needed. The
getCertificates implementation returns a list of all the certificates and
chains and would expect any caller interested in verifying actual chains
to call getCodeSigners instead.

We add this hidden constructor as a stop-gap until we can switch callers
over to getCodeSigners.

Bug: 13678484
Change-Id: I01cddef287767422454de4c5fd266c812a04d570