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
Merge remote-tracking branch 'cm/cm-11.0' into kk4.4