• Home
  • History
  • Annotate
  • only in /libcore/luni/src/main/java/libcore/
History log of /libcore/luni/src/main/java/libcore/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3cbfb6e3a3d8c50b6512df250b24dbfffbf6d3a7 30-Mar-2017 Neil Fuller <nfuller@google.com> Addition of new time zone lookup code

Introduction of libcore.util.TimeZoneFinder for
resolving time zones by country / by country + offset
information.

This code is intended to be a work-a-like replacement
for code currently residing in android.util.TimeUtils
and using time_zones_by_country.xml in the plaform.

android.util.TimeUtils and
com.android.internal.telephony.ServiceStateTracker will
be switched over to using it in a follow up change.

At present, the algorithm should return the same
logical results as the code it is intended to replace.

A notable difference is that it uses ICU's TimeZone class
instead of java.util.TimeZone because
it has more convenient methods and the ability to
freeze timezones. More care has been taken to return
immutable data structures than the code it replaces.

This change also changes the TimeZoneDistroInstaller
and associated classes / tests to be aware of and
require the new file.

Bug: 25338903
Test: vogar luni/src/test/java/libcore/util/TimeZoneFinderTest.java
Test: CTS: run cts -m CtsLibcoreTestCases -t libcore.tzdata.shared2
Test: CTS: run cts -m CtsLibcoreTestCases -t libcore.tzdata.update2
Test: CTS: run cts -m CtsLibcoreTestCases -t
libcore.util.TimeZoneFinderTest
Test: Manual testing after install using prepareTzDataUpdates.sh /
update test app and reboot

(cherry picked from commit 085fbffe1a9fd2d53bc1959a189b0289302c67b3)

Change-Id: I6541b84d0e6e289cb2495e5ae045fd0356145d47
til/TimeZoneDataFiles.java
til/TimeZoneFinder.java
31406a8d85bdf948c5a1913a06e064707cc566ce 03-Apr-2017 Neil Fuller <nfuller@google.com> Revert "Add strictmode check for getaddrinfo"

This reverts commit b729adc9926ce70f48229b3a40193214e57c8efc.

Change-Id: I4f9d6aba68211aab925c7e21a534975c0fb1a848
o/BlockGuardOs.java
b729adc9926ce70f48229b3a40193214e57c8efc 01-Apr-2017 Yi Kong <yikong@google.com> Add strictmode check for getaddrinfo

Main thread should not call getaddrinfo unless AI_NUMERICHOST flag is
set, to prevent potentially lengthy network address lookup.

Test: CtsLibcoreTestCases
Bug: 12077632
Change-Id: I5c55ec5c651afdbe0a1267525ae4d988b357db72
(cherry picked from commit 2ace53c104d483d8a696129237cf2907a130acd9)
o/BlockGuardOs.java
1b9bccee24ea4d2545bda74ac1e399d789fbb798 09-Jan-2017 Yi Kong <yikong@google.com> Move PlainSocketImpl away from JNI (part 1)

Rewrites all JNI methods apart from socket{Get,Set}Option on top of
IoBridge and Libcore.os.

Test: CtsLibcoreTestCases
Bug: 28609551
Change-Id: Ia14e09eae372355f5e12bc38f3ba5b06f979c807
(cherry picked from commit 32c780f411b1fe3dec80c28a79fc5442fa8304eb)
o/IoBridge.java
f996d6958851e14c1965a0783e5b4512769997b9 24-Mar-2017 Neil Fuller <nfuller@google.com> Centralize knowledge of time zone file paths

Centralize the knowledge of time zone file paths. The
knowledge is in a couple of places and there is some
file name duplication. A new file will be
added if time_zones_by_country.xml is made
updateable outside of an OTA.

Test: make / boot (to confirm the new System class dependency is ok)
Test: run cts -m CtsLibcoreTestCases -t libcore.java.lang.SystemTest
Test: run cts -m CtsLibcoreTestCases -t libcore.util.TimeZoneDataFilesTest
Test: run cts -m CtsLibcoreTestCases -t libcore.util.ZoneInfoDBTest
Bug: 25338903
Change-Id: Iaf9afc148faee8db7839513270a621a8149fd5fa
(cherry picked from commit bab90fe9bc8cd53373d0881b3f0b97f24bc61b21)
til/TimeZoneDataFiles.java
til/ZoneInfoDB.java
5744e4a762ca12243b47dd8aed24d87d963b4d3b 17-Mar-2017 Andreas Gampe <agampe@google.com> Libcore: Add support for capabilities

Add support for capget and capset, as well as related prctl constants,
to android.system.Os.

Bug: 36232535
Test: m
Test: manual
Change-Id: I28c741bef2f9e047400dae83b69fc22fd3527498
o/ForwardingOs.java
o/Linux.java
o/Os.java
0965ac3ceff49f3c090c417c0e30ea51c6f294a7 15-Mar-2017 Andreas Gampe <agampe@google.com> Libcore: Rename Posix to Linux

We refer in Os to Linux manpages. Future changes will add Linux-specific
APIs to Os. Be honest and rename the class.

Bug: 36232535
Test: m
Test: m test-art-host
Test: Device boots
Change-Id: Ie9d4536d03499a75efaf2bcf16d41bacc97ac943
o/Libcore.java
o/Linux.java
o/Posix.java
618f713d43d6ff13b88118e9af8f0f40d6eb8ce5 12-Mar-2017 Jeff Sharkey <jsharkey@android.com> Use "raw" syscalls in NetworkInterface.

Libcore.os offers a bunch of nice checks/guards, but sometimes they
can be too aggressive, such as requiring that all network sockets be
tagged, even when code in NetworkInterface knows that its sockets
will never be used to send/receive data.

To avoid these false-positive warnings, add new "rawOs" field and
switch some NetworkInterface calls over to using it.

Test: builds, boots, no longer seeing tagging warnings
Bug: 34610007
Change-Id: I13c12fb7221ede4712f8faa82c627d966083d9d1
o/Libcore.java
d855ca544016bdea6b41a374aaa482c464ba4781 24-Feb-2017 Jeff Sharkey <jsharkey@android.com> StrictMode for open() should check "flags".

The values it's interested in checking are in flags, not mode.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.StrictModeTest
Bug: 35727400
Change-Id: I7c74b149abfa5bfabe36566aae5c978e30eb11b4
o/BlockGuardOs.java
fa5b565a3f6c6d7cbd6106ee8d360304c3a939a3 17-Feb-2017 Igor Murashkin <iam@google.com> jni: Switch to @FastNative for all JNI functions.

Switches all (248) methods that previously used !bang JNI in art/libcore
to all use @FastNative.

As a nice benefit, this should be about 1.5x faster than before for those method calls.
This measures out to a 3% startup time improvement for system_server.

Test: make test-art-host
Bug: 34955272
Change-Id: I0881f401c7660c79f275235362777bfa58241deb
o/Memory.java
til/CharsetUtils.java
89499ee5c148080458b58c6e0dbe5dda39460396 19-Jan-2017 Jeff Sharkey <jsharkey@android.com> Only tag/untag AF_INET and AF_INET6 sockets.

Socket tagging only actually works for real network sockets, so skip
tagging all other socket families like AF_LOCAL.

For calls like accept() and close() that don't readily have family
information, use the Linux-specific SO_DOMAIN option to pull it from
the kernel. Define both SO_DOMAIN and SO_PROTOCOL for anyone to use
in the future.

Test: builds, boots, only tags internet sockets
Bug: 30414041
Change-Id: I17fc935a7bef2c8f4a1f44eb2cf907b41283afde
o/BlockGuardOs.java
ba17b532f644b7caed6d08671d492edfee8b6f37 13-Jan-2017 Yi Kong <yikong@google.com> Revert "Revert "Move PlainDatagramSocketImpl away from JNI""

Fixed a issue introduced as part of Libcore change 5e0df135, that caused
calling DatagramSocket.receive() with a reused DatagramPacket to fail.
This was due to calling system recvfrom(2) with packet's content length
instead of its buffer length.

This reverts commit fba26224db3ed354a0b42c4bee5ed4ddc4d52f9a and fixes
the above issue.

org.apache.harmony.tests.java.net.DatagramSocketTest#testReceiveTwice is
a regression test.

Test: Manual testing
Test: org.apache.harmony.tests.java.net.DatagramSocketTest#testReceiveTwice
Test: CtsLibcoreTestCases
Bug: 33957878
Change-Id: I64daaf6cf099e9af6bdee56f29da48627111ae25
o/IoBridge.java
fba26224db3ed354a0b42c4bee5ed4ddc4d52f9a 11-Jan-2017 Yi Kong <yikong@google.com> Revert "Move PlainDatagramSocketImpl away from JNI"

The PlainDatagramSocketImpl rewrite change set caused a regression in
casting device discovery mechanism. Revert these changes while
investigating the root cause.

This reverts the following commits:
77110aac1821ca512c3d2b05f2f6b1f5ab7091f6 DatagramSocket should set IP_MULTICAST_ALL to 0
0c38d180ead8b6d9bf3268979ac0967cb7e29283 Move PlainDatagramSocketImpl away from JNI (part 3)
0cda0594094f792c4ff923ea55311e0bd51a37c1 Move PlainDatagramSocketImpl away from JNI (part 2)
5e0df13532a902abc72c267a92bf3d83e71b0b1c Move PlainDatagramSocketImpl away from JNI (part 1)

Test: Manual testing
Bug: 33957878
Change-Id: I3d27e642ab77cb01ba6f1eb619847f67b47e44d8
o/IoBridge.java
0cda0594094f792c4ff923ea55311e0bd51a37c1 19-Dec-2016 Yi Kong <yikong@google.com> Move PlainDatagramSocketImpl away from JNI (part 2)

Rewrites remaining JNI methods in PlainDatagramSocketImpl
(socket{Get,Set}Option) on top of IoBridge.

Adapted IoBridge behaviour to work with OpenJDK code. Since the only
other user of the affected method does not depend on the changed
behaviour, this won't introduce any side effect.

Test: CtsLibcoreTestCases
Bug: 28609551
Change-Id: I6310edd9ec3b48bb51a8cc86ecbe757d1096f5a1
o/IoBridge.java
5e0df13532a902abc72c267a92bf3d83e71b0b1c 14-Dec-2016 Yi Kong <yikong@google.com> Move PlainDatagramSocketImpl away from JNI (part 1)

Rewrites all JNI methods in PlainDatagramSocketImpl apart from
socket{Get,Set}Option on top of IoBridge.

There are some differences comparing to JNI code:
bind:
* We don't set setDefaultScopeID, since that's not necessary for
Linux.
send:
* OpenJDK sets sin6_flowinfo field, but this is against RFC3493 and is
not used by the kernel. We don't set this field.
peek:
* Temporary DatagramPacket object has zero length instead of one in
original implementation. These is no need to have that one byte and
has better performance by avoid allocating a buffer.
datagramSocketCreate:
* We don't need to explicitly setsockopt IP_MULTICAST_ALL to 0, as
this is default for AF_INET6 sockets and we always create sockets
with AF_INET6 in Android libcore.
* We also don't explicitly setsockopt IPV6_MULTICAST_HOPS, since this
is to workaround a bug in old Linux kernels (< 2.4) and no longer
relevant.

Also while rewriting, several behaviour changes from M were found and
the rewrite keeps the N behaviour:
send:
* If sendto(2) sets errno as ECONNREFUSED, we now throw
PortUnreachableException instead of ignoring, and if it set errno
as ECONNRESET, we throw IOException instead of ignoring.
In all the other cases, we throw IOException instead of
SocketException.
recv/peek:
* packet.address should only be updated if source address is
different, and should be the same object if address is the same.

Test: CtsLibcoreTestCases
Bug: 28609551
Change-Id: I9a5c65cce8dee9695966012f8f2e3ddf9d84bae4
o/IoBridge.java
c262e2d9dfb2d3892c57bdf10d03a358a8c2e2f9 15-Dec-2016 Yi Kong <yikong@google.com> Merge "IoBridge.recvfrom: fill in the srcAddr for connected sockets"
37de57c8de0b23248f30b951e200f1dc847443ac 12-Dec-2016 Yi Kong <yikong@google.com> IoBridge.recvfrom: fill in the srcAddr for connected sockets

Ensure that recvfrom() always sets the srcAddress on the DatagramPacket,
not just when isConnected == false.

recvfrom() is currently not widely used and it needs to work in a
different way to support the rewrite of PlainDatagramSocketImpl. The
change will not substantially affect the one existing use case,
Inet6AddressImpl, because it always passes "false" for isConnected.


Test: CtsLibcoreTestCases
Bug: 28609551
Change-Id: Iabb5a258a55578d13fedd299f060c52c5485f9b7
o/IoBridge.java
b03ea1194e84efad9b77b102c826a8be2d941106 06-Dec-2016 Neil Fuller <nfuller@google.com> Improved zoneinfo file validation

Improved checks on zoneinfo load and addition of CTS
tests to make sure the checks are working. Improved
validation and CTS testing is desirable if timezone data
is to be pushed to devices outside of an OTA and without
substantial per-image testing (and given possible OEM
changes).

Some changes in ZoneInfoDB are to remove logic that
created a large char[] to encourage Strings to share the
underlying array. Strings on Android created this way no
longer share a char[] so it can be dropped; it also makes
checking that the index is sorted correctly easier.

Bug: 31008728
Test: CtsLiboreTestCases
Change-Id: Ieb033a24de91d1e0121dd0264a4e6a787d4b19f1
til/ZoneInfo.java
til/ZoneInfoDB.java
d443d10a1a95b3020cba24b0940b3e1ea3e8ce7d 01-Dec-2016 Neil Fuller <nfuller@google.com> Boundary checks / synchronization / tests for MemoryMappedFile

Hardening MemoryMappedFile against boundary conditions and
edge cases. Many tests added.

Thread safety has been dropped entirely as part of this change:
expected usage is single threaded. It was previously possible
to unmap the file, but the BufferIterator would carry on
attempting to read from the address space.

Motivation: The ZoneInfoDB code will soon be modified to expect
exceptions if reads / writes are out of bounds and it's more
appropriate to make the exceptions part of the MemoryMappedFile
contract.

Bug: 31008728
Test: CtsLibcoreTestCases
Change-Id: I58cba7498c5fcd074054b13dbd6b313d6c1bfbe6
o/BufferIterator.java
o/MemoryMappedFile.java
o/NioBufferIterator.java
d880e69f88b68996b19385d55bcdfe7796f95e02 05-Dec-2016 Yi Kong <yikong@google.com> Move blockUntilAvailableOrTimeout method to IoBridge

... so that we can reuse this method in other classes.

Test: java.nio.channels.DatagramChannelMulticastTest
Change-Id: Ibf6c1a6bef3cc1d0f76387331159f0c9a383a919
o/IoBridge.java
92929ee38d838ec47130c8e37c353dc6522b0114 01-Dec-2016 Tobias Thierer <tobiast@google.com> Drop deprecated libcore.io.Base64 in favor of java.util.Base64

Move the last last remaining user (DropBox) of l.i.Base64.encode()
to j.u.Base64.getEncoder().encodeToString() which produces exactly
the same result.

The decoding behavior of the two implementations differ:
- in case of error, l.i.Base64 returns null vs. j.u.Base64 throws
- j.u.Base64 is more strict about forbidding extra in-stream or
trailing characters
- the two implementations differ in how many bytes they decode if
the encoded data ends prematurely.
To document the behavior change, the old libcore.io.Base64Test was
kept with updated expectations and under a new name.

Bug: 31292683
Test: libcore.java.util.LibcoreIoDerivedBase64Test

Change-Id: I62d4731d38619629d72549430c57e07f8ea4aa1e
o/Base64.java
o/DropBox.java
7e0ee09d14b21b767699e151e681202902bc7a06 29-Nov-2016 Neil Fuller <nfuller@google.com> Refactoring before adding stricter validity checking

Refactoring before adding stricter validity checking.
The tz update behavior needs a way to validate tzdata
files and the current code structure doesn't make that
easy. This commit is mostly rearranging the existing
code to provide a mechanism for loading a single file.
The only functional change intended is to add a
close() call to close the MemoryMappedFile when a file
has been found to be invalid.

Bug: 31008728
Test: CtsLibcoreTestCases
Change-Id: I3c016f0a489319d93d5621ed3de2763f46ea534c
til/ZoneInfoDB.java
c949b536bb1970c55a8a3edc911d9fb7f31c484a 29-Nov-2016 Neil Fuller <nfuller@google.com> Merge "Modify version checks for the TzDataBundleInstaller"
2c0c75bb3c933b4cc03e9fbe0c30df1e4be1cc48 23-Nov-2016 Yi Kong <yikong@google.com> Include source IP address in socket timeout exceptions

... to help debuggability.

Bug: 25488386
Test: CtsLibcoreTestCases
Change-Id: I2e9844ad9a3895f6c1463f32f1318146a8f8c468
o/IoBridge.java
64a979bfdb64e1ad95da9a0954fd522fb3337927 25-Nov-2016 Neil Fuller <nfuller@google.com> Modify version checks for the TzDataBundleInstaller

Modify version checks for the TzDataBundleInstaller:
A new version will be installed from any valid bundle providing
it is not older than the one found in /system.

Bug: 31008728
Test: make / vogar testing
Change-Id: Iadcf8f8e3df03c54339443e95de0d34e30d28bd8
til/ZoneInfoDB.java
fbd8f0c85dc95734d2332698d3f51df7df64f65c 22-Nov-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Add StrictMode checks to BlockGuardOs"
34999397fa4e3a660add5b46821160eabb626098 17-Nov-2016 Shubham Ajmera <shubhamajmera@google.com> Add StrictMode checks to BlockGuardOs

Add StrictMode checks to BlockGuardOs
A test is also added to make sure that when a new method is added in
libcore.io.Posix, then an informed decision should be taken whether
to include it in the BlockGuardOs. The test maintains a list of methods
which don't need any BlockGuard checks. If any new method is added to
libcore.io.Os class, then the test will fail if it is not overridden in
libcore.io.BlockGuardOs. To overcome this, one should either add the
test into the list of methods not require blockguard checks, or else
override the method.

Bug: 30977855
Test: `make`
Change-Id: I220707f20562f5b013ba3483d62ed72664743f1c
o/BlockGuardOs.java
15060bea5cae5e84a06f55c5f897127834a080ab 21-Nov-2016 Jeff Sharkey <jsharkey@android.com> Merge "StrictMode to detect untagged network traffic."
e95f5760213bc2097b64e864a703b4096badb914 19-Nov-2016 Jeff Sharkey <jsharkey@android.com> StrictMode to detect untagged network traffic.

We don't need to tag sockets that will be used for strictly local
communication, since they'll never hit the network.

Test: builds, boots, all common traffic tagged
Bug: 30943431
Change-Id: Ia792fc9bbe216fa4557216255b338d08d6a59ed0
o/BlockGuardOs.java
fe872e2ac54d4032d7c16f3e01b114956cc5171c 09-Nov-2016 Neil Fuller <nfuller@google.com> Comment updates to make lifecycle concerns clearer

Fix / improve comments around JarFile sharing.

Bug: 32758243
Test: None - comment only change
Change-Id: Id264b4ca7d4f9116143760d4f9e4cd1f3c5ae6da
o/ClassPathURLStreamHandler.java
48e205e5e0bc55b5c7b11df445da39c5be890623 11-Oct-2016 Yi Kong <yikong@google.com> Implement root-less ICMP for InetAddress#isReachable

IPPROTO_ICMP socket kind allows sending and receiving ICMP Echo
messages without priviledges.

Test: libcore.java.net.InetAddressTest
Bug: 31926888
Bug: http://code.google.com/p/android/issues/detail?id=20106
Change-Id: I97e908695a3e04ac11841acbe2c887f26e6b8910
o/IoBridge.java
64cd9ffc01b1d9c55e1148bc1845cc2a8ea7e6a8 11-Oct-2016 Yi Kong <yikong@google.com> Merge "Remove workaround for kernel IPV6_MULTICAST_HOPS bug"
e9f5ba11a31be62d9921d8f13d37fcd283304a63 11-Oct-2016 Yi Kong <yikong@google.com> Implement IPV6_UNICAST_HOPS/IP_TTL option in IoBridge

Test: Build
Bug: 31926888
Change-Id: Ib7cf92cb386cb09d192ae94527b98a590d530706
o/IoBridge.java
518b11c8a332604c334d1d91b52c4d679bc18ca8 11-Oct-2016 Yi Kong <yikong@google.com> Remove workaround for kernel IPV6_MULTICAST_HOPS bug

This has been fixed since Linux 2.6.

ipv6: Fix default multicast hops setting.

As per RFC 3493 the default multicast hops setting
for a socket should be "1" just like ipv4.

Ironically we have a IPV6_DEFAULT_MCASTHOPS macro
it just wasn't being used.

Reported-by: Elliot Hughes <enh@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable/+/f935aa9e99d6ec74a50871c120e6b21de7256efb

Test: CTS
Bug: 32071916
Change-Id: I0e25a86a2ff12a7e77074636bc99a281cfb57dbe
o/IoBridge.java
118de16ee0529955eaca8cc5ce864cac49598c86 29-Sep-2016 Shubham Ajmera <shubhamajmera@google.com> Set warnings for unbuffered I/O

The change introduces a new BlockGuard policy to track unbuffered
I/O. Policy can be set in the following way:
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectUnbufferedIO().build());

IoTracker generates warnings for unbuffered I/O if the operation
could be replaced with a buffered I/O.

The change also removes IoTrace class which was called each time an I/O
operation was invoked.

Bug: 3018772
Test: vogar BlockGuardTest
Change-Id: I18d42c3b3ceaf0b4b98cf15914716b20a48e50c8
(cherry picked from commit 7b05c367448843d7e62db4e87a1ac8fae9b0176c
)
o/IoTracker.java
43953a0c281b6dd4c354b2a670512eee4b105f3e 08-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Add java.util.Base64 from OpenJDK8u60"
55dd377d62cf780df94d8e0198b66e99456b6f50 07-Sep-2016 Yi Kong <yikong@google.com> Revert "Revert "Implement Libcore.os.listxattr""

This reverts commit a422a96e49e2cad1d0a78ac8bf7b41b3fb9b1759.

Relax the test, some devices reports "security.selinux" even if the
filesystem does not actually supports extended attributes.

Bug: 31175927
Test: Libcore.os.listxattr
Change-Id: I9732ac22c6aead00f989d5c156b92bf2bc7eb8ab
o/ForwardingOs.java
o/Os.java
o/Posix.java
a422a96e49e2cad1d0a78ac8bf7b41b3fb9b1759 07-Sep-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Implement Libcore.os.listxattr"

Bug: 31175927

Fails with:
libcore.io.OsTest#test_xattr_Errno
junit.framework.AssertionFailedError: expected:<0> but was:<1>
at junit.framework.Assert.assertEquals(Assert.java:205)
at libcore.io.OsTest.test_xattr_Errno(OsTest.java:640)
libcore.io.OsTest#test_xattr_Errno FAIL (EXEC_FAILED)

This reverts commit 2e408060cfa6ac19d44d7cddfe2a9f7c28ecbe85.

Change-Id: I273f690ee9bc3c536f6486c74470dcb4e784c335
o/ForwardingOs.java
o/Os.java
o/Posix.java
2e408060cfa6ac19d44d7cddfe2a9f7c28ecbe85 30-Aug-2016 Yi Kong <yikong@google.com> Implement Libcore.os.listxattr

which mirrors listxattr(2).

Bug: 31175927
Test: Libcore.os.listxattr
Change-Id: I589ee42bb8cdc377f333c8cdf35065e5b5edc7c2
o/ForwardingOs.java
o/Os.java
o/Posix.java
88bb8a43d0c963be515d6e1768d4a3418c910bc0 01-Sep-2016 Tobias Thierer <tobiast@google.com> Add java.util.Base64 from OpenJDK8u60

The test was resurrected from abandoned CL http://r.android.com/93059
but was expanded and refactored.

libcore.os.Base64 should not be used for new code so it was marked
deprecated.

Test: vogar libcore/luni/src/test/java/libcore/java/util/Base64Test.java
Bug: 29935305

Change-Id: I37fa256a50f7ee8bae21cccf6a0db04dd0a117de
o/Base64.java
261f9eeef1d1b4e575aefde1e107b8463e3c1dea 20-Aug-2016 Garfield, Tan <xutan@google.com> Make video mime type default for 3GPP and 3GPP2 formats.

Bug: 30793548
Change-Id: I854dac7e5f638502d8184986ffd5f6918eefe063
(cherry picked from commit 4a2b94a98213fcf628f6d4de034a109695d908cc)
et/MimeUtils.java
40afa6bcd4652a16fe461a59f205dd0d65652118 26-Aug-2016 Yi Kong <yikong@google.com> Fix getxattr API

getxattr API was a mirror of its C API:
int getxattr(String path, String name, byte[] outValue)

This is cumbersome to use. This patch changes it to a more sensible API
of:
byte[] getxattr(String path, String name)

Bug: 30992227
Test: libcore.io.OsTest
Change-Id: I358a09fe3c82c7d4fd9ee1844f1537de308465a3
o/ForwardingOs.java
o/Os.java
o/Posix.java
20938c5ed2bc8f5de8047a47caddb146f730868f 18-Aug-2016 Neil Fuller <nfuller@google.com> Pulling in the OpenJDK 8 Executable class and related changes

This change restructures the existing code to accept Executable.
This change involves changes to java.lang /
java.lang.reflect Java code and ART internals.

The Parameter code associated with Executable has been excluded
and will be added as a follow up.

Many of the upstream JavaDoc changes to some of the pre-existing files
will also be handled as a follow-up to make this change smaller /
easier to review. This contains the parts that would be hard to split
out.

The only intentional public API change is the addition of
Executable/Method/Constructor getParameterCount() and
Type.getTypeName(). Tests have been added for these.

Some additional tests have been added to cover existing methods
and cases like toString().

The changes to Modifier result in a change to Method.toString()
which was previously not outputting "default" for default
interface methods. Associated test lines confirming this behavior
have now been uncommented.

Bug: 28666126
Test: cts ran for libcore (libcore, harmony_java_lang, org)
Change-Id: If94f2723b1ac28c08e52921c9860f54da04e168d
eflect/AnnotatedElements.java
e6cb1cfa5c321f08c1e460ba69d88d4ec9974e78 09-Aug-2016 Chad Brubaker <cbrubaker@google.com> Merge "Expose CT enforcement through NetworkSecurityPolicy"
6d1649c5b37b21ef2b690bc0f86306e19a32db02 05-Aug-2016 Yi Kong <yikong@google.com> Move NetworkInterface logic away from JNI

OpenJDK implementation of NetworkInterface keeps a lot of logic inside
JNI in order to support multiple platforms. The code is unmaintainable
and has low performance.

This patch moves NetworkInterface away from native implementation, and
use libcore.io as the interface to underlying system call. It uses
getifaddrs(3) to fetch all necessary network information and processes
them within Java.

Bug: 28609551
Test: Passes CTS tests
Change-Id: If8466a18cbc3318219cb04122b1afa8712beb2bc
o/ForwardingOs.java
o/Os.java
o/Posix.java
7d60ae13c1300a8bcfb3aa41c773a9eb2e92c310 08-Aug-2016 Joachim Sauer <jsauer@google.com> Fix script selection in locales for TZ names.

Fix how we pass the locale ID to ICU4C. Previously we incorrectly passed
the result of Locale.toString() (which is a hybrid, legacy-based value)
instead of Locale.toLanguageTag() (which is well-specified by BCP 47 and
what ICU4C actually expects).

The only known case where this actually leads to an observable
difference is when the Locale includes an explicit script identifier.

For example the (BCP 47) locale id sr-Latn-RS would be represented by
Locale.toString as "sr_RS_#Latn". When parsing that string in ICU4C, the
last part will be ignored, as it's not well-formed.

Bug: 30527513
Tested: libcore.java.text.SimpleDateFormatTest
libcore.java.util.TimeZoneTest libcore.icu.TimeZoneNamesTest

Change-Id: I9fbfdff8b896662d71576fe33f03eb660ecacaaf
cu/TimeZoneNames.java
88e73140702b45b792f91edddfe41ca3e9310c04 26-Apr-2016 Chad Brubaker <cbrubaker@google.com> Expose CT enforcement through NetworkSecurityPolicy

Bug: 28746284
Change-Id: I8b7f567554ea2ceec012b75220ab5487d347b565
et/NetworkSecurityPolicy.java
fde01e06d8aacfc18c2d4bf1930e271ae5c812d1 02-Aug-2016 Yi Kong <yikong@google.com> Remove unnecessary +x flag

Source code files and serialized resource files should not have x flag set.

This is a follow up to commit 49965c1d, where native codes and some Java
source files are left out.

Bug: 29977629
Test: Build, CTS tests
Change-Id: I475491284cf5784ed499daa434c2845cdadea3a0
et/MimeUtils.java
eec769da1a170d0c0431fd92accd8976f104502a 26-Jul-2016 min.yun <min.yun@lge.com> Convert to lower case before search a item in map

To search a item in map case insensitively,
convert extension and MIME type
to lower case before search.

Bug: 30207891
Change-Id: If42993c7f41268771e58874953f8a5f7da4af71a
et/MimeUtils.java
5bb82ccce151adca8965db28a572eb04e684a34e 10-Jun-2016 Joachim Sauer <jsauer@google.com> Remove libcore.icu.LocaleData.shortDateFormat4.

shortDateFormat4 was used to support "Choose date format" which was
removed in commit f91f06a5991451e4af3cf99eba791cb3009810d2 (bug
18322220).

It is now completely unused.

Bug: 18407262
Change-Id: I753ff0d1aaed0a8e2c0815974e0e0326b878ff69
cu/LocaleData.java
45348e170536651c0e5f8d5cb0319ba232a1b833 18-May-2016 Yi Kong <yikong@google.com> Rewrite NetworkInterface#{getFlags,getMTU}

Replace JNI with libcore ioctl syscall interface.

Bug: 28609551
Change-Id: Ic7bdadb0f490892a014efbff26cb33717bc2e2e4
o/ForwardingOs.java
o/Os.java
o/Posix.java
5d45c289afe04d12f41612e33e8df83e5db650d8 16-May-2016 Narayan Kamath <narayan@google.com> Add Libcore.os.realpath.

bug: 28740848

(cherry picked from commit aafa6aa2a65bd0780a5c335e6d616a8d660b5a12)

Change-Id: If436e5afc6ee2b04a3d8f41eaab240c5a2d530aa
o/BlockGuardOs.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
17d9d335a92b93da440e19d07c935c5f9e9e16fc 03-May-2016 Richard Uhler <ruhler@google.com> Hold a ClassLoader reference in NativeAllocationRegistry.

So that the native library isn't unloaded before we have a chance to
call the freeFunction.

Bug: 28406866

(cherry picked from commit 111fdf10801861427f59e42c34c40d5df484053b)

Change-Id: I80c15400335edfc31de0bb6e06ed514ac4ea1d4d
cu/NativeConverter.java
til/NativeAllocationRegistry.java
c672ce800bbc27cb79f78d9204a51ec06ef1ec3d 22-Apr-2016 Narayan Kamath <narayan@google.com> CharsetEncoder/Decoder: Use NativeAllocationRegistry.

Works around issues with finalizer ordering.

bug: 26076560
Change-Id: I4977ff9e2f6234283bd23dfc39a574d4854f6655
cu/NativeConverter.java
d890de26ec16f7fc32b58a00725aff1b2a79a169 05-Apr-2016 Jeff Hao <jeffhao@google.com> Remove AnnotationAccess and its remaining uses.

Libcore side of this change. Adds a libcore test that retention
annotations are handled properly.

Change-Id: I5aade3be674a83d71fa0c7bb33342a154f2c11ab
eflect/AnnotationAccess.java
eflect/TypeVariableImpl.java
cd77f9a8fcd09ecd642141ae8d22eb005aec3333 23-Feb-2016 Jeff Hao <jeffhao@google.com> Change ListOfTypes.resolveTypes to use instanceof.

Previously it would try to cast and catch an exception.

Change-Id: I57e0e29b5c6243654634e7d329ed8cdaa4784c3b
eflect/ListOfTypes.java
9599ec54b164da29db4e3386a9839aca73caf8ee 01-Feb-2016 Igor Murashkin <iam@google.com> Revert "Revert "reflection: Add new AnnotatedElement 1.8 methods.""

This reverts commit ac6e7a426c30abe6de4361c95755ff759845265f.

Runtest failure has been fixed in I28c3707e38c1f69ea9d3660f68136f688122ac4e

Change-Id: I1749dc89b790d44b5e40bc8b20aa62885bda792b
eflect/AnnotatedElements.java
3af4662f6f624863e2cf72cfb8ab56b70a1e0355 29-Jan-2016 Paul Duffin <paulduffin@google.com> Restore ZoneInfo specific code in GregorianCalendar

During removal of the sun.util.calendar.ZoneInfo class from
OpenJDK some code was removed from GregorianCalendar that cast
the TimeZone to ZoneInfo in order to call a special method in
ZoneInfo to get the raw and DST offset. The removed code was
necessary because the package private method in TimeZone
getOffsets(long, int[]) that provided them separately could not
be overridden by ZoneInfo, the public method getOffset(long) did
not support providing them separately, and attempts to calculate
the DST offset (by subtracting getRawOffset()) from the total
offset did not work properly with ZoneInfo when it had historic
changes to the DST and raw offset.

The result of the removal was that GregorianCalendar had an
inconsistent view of TimeZone which lead to the time calculated
by GregorianCalendar being out by a couple of hours either way
depending on the difference between the applicable offset and
the 'default' offset.

This adds a method in ZoneInfo to return the raw and DST offsets
separately and then adds back in the special code to call that
method in GregorianCalendar. This fixes a number of CalendarTest
failures, including testSetHourOfDayInEuropeLondon. It should
also fix some reported bugs in a number of apps, including
Calendar.

Bug: 26869497
Change-Id: Ia780b628ef951aec6fd08de1cebc7b6e904f77b0
til/ZoneInfo.java
b3e502d6cee23d24bfc3717f385effa7b7d250b8 25-Jan-2016 Paul Duffin <paulduffin@google.com> Add tests for libcore.util.ZoneInfo, document and fix issues

The investigation of bug 26022884 revealed some issues with
ZoneInfo, in terms of the code structure, the documentation and
the tests (there weren't any). This change fixes those issues
in preparation for additional changes to address the problems
with GregorianCalendar.

The tests were run on a pre-OpenJDK version of AOSP and the
following tests failed - as expected:

testMakeTimeZone_HasPastDST_NoFutureDST_PositiveTransitions
This failed because System.currentTimeMillis() / 1000 does
not handle rounding properly when current time is positive.

testMakeTimeZone_LotsOfOffsets
It failed with an index out of bounds exception rather than an
explicit exception.

testMakeTimeZone_NegativeTransition
This failed because getOffset(long) and inDaylightTime(Date)
did not handle rounding properly for negative times.

testMakeTimeZone_NoOffsets
The test failed with an ArrayIndexOutOfBoundsException.

testMakeTimeZone_OneDstTransition
The test failed because the constructor did not fail. However,
the code makes no sense if there are no non-DST transitions
and the existing data doesn't require it.

testMakeTimeZone_TooManyOffsets
The test failed because the constructor did not fail. However,
the code makes no sense if there are more than 256 offsets
and the existing data doesn't require it.

Bug: 26734751
Change-Id: I5b2a64c99e0fd98aec4fea430397110c1102fd2e
til/ZoneInfo.java
til/ZoneInfoDB.java
ac6e7a426c30abe6de4361c95755ff759845265f 29-Jan-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "reflection: Add new AnnotatedElement 1.8 methods."

Fails interpreter access checks.

This reverts commit 4d4ff5e7b929a404fc9f16232c639b7a11969489.

Change-Id: Ie3b7f44b653dacc5a6d18eae5bff34fe2cb2cdfc
eflect/AnnotatedElements.java
4d4ff5e7b929a404fc9f16232c639b7a11969489 15-Jan-2016 Igor Murashkin <iam@google.com> reflection: Add new AnnotatedElement 1.8 methods.

Methods are currently @hide 1.8 and default is commented out.
Needs corresponding runtime change to run.

Change-Id: I8420a4d208bb60874a9cf996766313c7d5058c45
eflect/AnnotatedElements.java
d7d09b549bfa4a37786747db4ad5aec2762791de 23-Jan-2016 Jaesung Chung <jaesung@google.com> Merge "Add RAW image mimetypes"
9b83a5f6fd4d29b626e3a103eded30e6d7471c97 22-Jan-2016 Neil Fuller <nfuller@google.com> Merge "Fix ZoneInfo.WallTime.mktime"
d7145a97260f0a28710e31c12cc8ff5a6ee27f06 21-Jan-2016 Andreas Gampe <agampe@google.com> Enum: Fix potential deadlocks caused by BasicLruCache usage.

Don't hold a lock while initializing classes.

bug: 26552570
Change-Id: Id3ca3446af4ffc01044e213b77e13b3713025feb
til/BasicLruCache.java
4a174c447f5d39e52370b91de29d902de48aa503 22-Jan-2016 Jaesung Chung <jaesung@google.com> Add RAW image mimetypes

Bug: 26731125
Change-Id: Ic7a6cef9e08499d984c5d9c7243ee22087866586
et/MimeUtils.java
60fc8ca2faef91fa76e577a9a38e3f1e018377df 21-Jan-2016 Neil Fuller <nfuller@google.com> Fix ZoneInfo.WallTime.mktime

The code was a assuming a zero millisecond field on the
GregorianCalendar used internally. This assumption was broken
by commit 9c853c5b9ebbb0ef60a013ae10ee411d70dfa832 which
modified how the GregorianCalendar was created. An
alternative public constructor will be used instead.
To be defensive the millisecond field is also now set
explicitly to zero.

This change will break LayoutLib: the need for the layoutlib
hack has gone away now the code uses a public GregorianCalendar
constructor.

Bug: 25993843
Change-Id: Iae9210576ba87a5e30ea9ec77d19a8a5b28b2b0b
til/ZoneInfo.java
14343cd1e690aacebc33864b267cf8f18310361e 20-Jan-2016 Narayan Kamath <narayan@google.com> Remove unnecessary subclass of BasicLruCache.

Change-Id: I15faa2d01f7665d5df04aedff0d873d42f22d16b
cu/DateIntervalFormat.java
b50fb2065844a002c3ad0a7484eaf6c6b8de769f 15-Jan-2016 Richard Coles <torne@google.com> Merge "Fix setreuid wrapper in ForwardingOs."
33fc9556dfda6298fcd7c119f68a7375e13cbed9 28-Dec-2015 Richard Uhler <ruhler@google.com> Introduce NativeAllocationRegistry API.

The NativeAllocationRegistry API provides a way to associate native
allocations with Java objects. The native allocations will
automatically be freed when the correspondong Java object becomes
unreachable.

Use NativeAllocationRegistry for BigInt.

Bug: 23130675
Change-Id: If89dc03f0668afdecf1086280d16d2803e07a62a
til/NativeAllocationRegistry.java
9a6d7a1528e9f9bd8025fe4f2ae4f6d144045e95 13-Jan-2016 Torne (Richard Coles) <torne@google.com> Fix setreuid wrapper in ForwardingOs.

Fix typo.

Bug: 26533792
Change-Id: Ibbe907b3eeb38a1a0d8f0ce6150c89dd352b8489
o/ForwardingOs.java
4b5d41bd8c89adc45b428f7cfdb26047f06a0ba4 22-Dec-2015 Paul Duffin <paulduffin@google.com> Merge "Encode entry name before creating URL"
d14e2be81c33eedf9522ae800ce43df52ff5786d 21-Dec-2015 Chad Brubaker <cbrubaker@google.com> Merge "Add hostname aware isCleartextTrafficPermitted" am: 46c7d0482e
am: 051f3cf8ab

* commit '051f3cf8ab965e9e1b2e1a23737d405695ab9c2b':
Add hostname aware isCleartextTrafficPermitted
3c2b8eefe80d00b3ba54d27fed375886217e8778 21-Dec-2015 Paul Duffin <paulduffin@google.com> Encode entry name before creating URL

During retrieving a resource from the class path a URL is
constructed from the resource name. If the resource name
contains characters that are special in the file part of a URL,
e.g. # or ? then they need to be encoded (e.g. into %23 and %3f
respectively) before passing to the URL in order to ensure that
the name survives intact through to the JarURLConnection which
decodes the URL to extract the file part which it uses to scan
the JAR.

This ensures that the entry/resource name is encoded properly
and adds tests to verify that for resources whose names contain
either # or ?.

Bug: 26137833
Change-Id: I8f31c35e42c0070a0ee78e0cd58b67ebd001fffe
o/ClassPathURLStreamHandler.java
59cd43352e5fd4907303d06f9b92f01c943375f7 18-Dec-2015 Narayan Kamath <narayan@google.com> Remove unused collation and formatting code.

Change-Id: I154d59e4ccff1d899530aebf27cf444f15f674ab
cu/CollationElementIteratorICU.java
cu/NativeCollation.java
cu/NativeDecimalFormat.java
b80fefa18b3a185422222cfad3c7210c4903c37f 09-Dec-2015 Chad Brubaker <cbrubaker@google.com> Add hostname aware isCleartextTrafficPermitted

By default it is equivalent to the non-hostname aware version.

Change-Id: I22b9ea277407846f9c333ce0cc37c25a2be1381e
et/NetworkSecurityPolicy.java
1ee1fbedc2e3f810a69d7a73a07f3f9a8388b488 15-Dec-2015 Shubham Ajmera <shubhamajmera@google.com> java.text.Collator implemented using icu4j

Implemented java.text.Collator, java.text.CollationElementIterator,
java.text.RuleBasedCollationKey using icu4j.

Removed unused classes - libcore.icu.RuleBasedCollatorICU,
java.text.RuleBasedCollationKeys, java.text.CollationRules.

Bug: 25860873
Bug: 26140420

Change-Id: I8a78db9a4d0d1c04a8a1e18408c54234db43cfd8
cu/CollationKeyICU.java
cu/RuleBasedCollatorICU.java
4320ad12c5bb04819088e436a3537f46c59f9caf 08-Dec-2015 Chad Brubaker <cbrubaker@google.com> Refactor NetworkSecurityPolicy to be pluggable

This allows us to keep the logic for the NetworkSecurityPolicy in the
framework instead of in libcore.

(cherry-picked from commit 7a6f1687cfa0929e68ac7813b7432259b8088b4d)

Change-Id: I4bf494f79c27729cb17d93d90a91319492270ce9
et/NetworkSecurityPolicy.java
7a6f1687cfa0929e68ac7813b7432259b8088b4d 08-Dec-2015 Chad Brubaker <cbrubaker@google.com> Refactor NetworkSecurityPolicy to be pluggable

This allows us to keep the logic for the NetworkSecurityPolicy in the
framework instead of in libcore.

Change-Id: I4bf494f79c27729cb17d93d90a91319492270ce9
et/NetworkSecurityPolicy.java
et/url/FtpURLConnection.java
6c0e55c2bbd4cf2798d6642a259f9983f69c979e 03-Dec-2015 Narayan Kamath <narayan@google.com> Scripted removal of unused libcore files.

All files that do not appear in non_openjdk_java_files.mk and
are present in a top level dir (luni, libart..) that *does* appear
in that file have been deleted.

Change-Id: Id831184333216c229a53398a93bd3d804332041e
o/DeleteOnExit.java
o/HeapBufferIterator.java
o/StrictLineReader.java
et/url/FileHandler.java
et/url/FileURLConnection.java
et/url/FtpHandler.java
et/url/FtpURLConnection.java
et/url/FtpURLInputStream.java
et/url/JarHandler.java
et/url/JarURLConnectionImpl.java
et/url/UrlUtils.java
til/CountingOutputStream.java
e8e4da2f84da30bbc11a63b7a87a153f62b1ce65 27-Nov-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Remove StrictJarFile from ClassPathURLStreamHandler

StrictJarFile was moved from libcore to framework/base
(licensing reasons) and in no longer accessible in
the ClassPathURLStreamHandler. I replaced it using
JarFile class.

+ ZipFile compatibility fix, openjdk ZipFile#getInputStream
was not fine with directory entries without "/" suffix (returning null),
fixed a flag to deal with them like in previous impl.

Bug: 25337946
Change-Id: I9832b34664bd331a96cd06aabb4cbf834c58f208
o/ClassPathURLStreamHandler.java
2b80a43ff0490526e1ac35bc0492753e96c22020 25-Nov-2015 Sergio Giro <sgiro@google.com> Merge "UriCodec: use replacement character for malformed input" am: 4d1321f4e5 am: e98a1e37fe
am: c824aa9b65

* commit 'c824aa9b656b83ead6ca9191559a8e3f114bccec':
UriCodec: use replacement character for malformed input
e3101cdcd024a26212f73604e0a48b96422be9ec 24-Nov-2015 Sergio Giro <sgiro@google.com> UriCodec: use replacement character for malformed input

Bug: 25851902
Change-Id: I2eafa056b4f946f380fd4f56b3ef5135daae2293
et/UriCodec.java
70b617fe562806bc3e15452a2792fec4355bd54f 20-Nov-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge mnc-dr-enso-dev into master

OpenJDK adjustments for master.
- Restored removed libcore.icu.* classes (needed
by the openjdk java.text.* classes). This will be
undone in short future.
- Adjusted java.lang.* and java.lang.reflect.* classes
for native reflection and other changes in master.

Bug: 25758743
Change-Id: Ifbbe5b1e8661138fc32ad24127f76f711dd585b7
aefddf2c08c6758a154dd7ae0c9ef53ecb3ed7a9 17-Nov-2015 Sergio Giro <sgiro@google.com> libcore: new implementation of libcore.io.Base64
am: 5a0ae3e0db

* commit '5a0ae3e0dba473691f6ca909a786dec7d6968c8a':
libcore: new implementation of libcore.io.Base64
79fc0903ef4c7df8f5bffc4f667534f77c30f9e5 28-Sep-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Remove reference to a class that doesn't exist.

Change-Id: I1be9ea381696f04f8df6670db0f9ca95f34508f2
et/NetworkSecurityPolicy.java
bf07204bff37fa34dbdb32e0a9d790d97ef46a81 12-Nov-2015 Narayan Kamath <narayan@google.com> Merge lmp changes into mnc.

Change-Id: I8f49c58f39dc5f4268c6b5718cab18ed26ac930a
5a0ae3e0dba473691f6ca909a786dec7d6968c8a 01-Sep-2015 Sergio Giro <sgiro@google.com> libcore: new implementation of libcore.io.Base64

Second attempt, this time with fixed tests.

(cherry picked from commit 8a5101a29ce850e12bba14022dcdc0f500c9ad25)

Change-Id: I76703df5610510a7adaa6cfd562338a40966bef6
o/Base64.java
27ba86dcb59cbf8ac5bac3475672cdfd719c240b 23-Oct-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Revert "libcore: new implementation of libcore.io.Base64"

This reverts commit 4154da489f49711a9a5e8623cff712dca84ef2b1.

Causing trouble in mnc and mnc-dr, will resubmit next week

Change-Id: I062b9720aecb93d949e9c029f1a92e20e24a4b03
o/Base64.java
87f37c1c6535e9bbde75b438ef68187748eb772d 13-Oct-2015 Sergio Giro <sgiro@google.com> libcore: fix errors in UriCodec

- don't assume that percent is retained
- handle ' ' -> '+' correctly

Bug: 24806835
Bug: 24602226
Change-Id: Ide7af5a79b801177010eb5e14ccd7cfd298c08be
(cherry picked from commit 595904f2798b24d16b7b180a278ee964dcefd637)
et/UriCodec.java
e45feb1c752ce50450dd6584ef9b8380411d17c2 09-Sep-2015 Sergio Giro <sgiro@google.com> libcore: rewrite of UriCodec

Added unit tests

Change-Id: Idd575564076299f648919e243a1cce79401eb1cf
(cherry picked from commit fda56554dbf5caf1af1982cad020a8dca5632244)
et/UriCodec.java
7dffb1956f8f92d01ad2b30e4da1353608c3f08e 01-Sep-2015 Sergio Giro <sgiro@google.com> libcore: new implementation of libcore.util.SneakyThrow

Change-Id: I7c8bd6777a83d1e5260278704d2a6299c3a5299b
(cherry picked from commit 50481869a2e67cfdfc102202878caa5bad1c70d5)
til/SneakyThrow.java
2991631f3e631ad7df8716d63b0dddbabb5fa96a 01-Sep-2015 Sergio Giro <sgiro@google.com> libcore: new implementation of libcore.io.Base64

Change-Id: I2ebdaf5dda37911db4827899eb722dd20c44da73
(cherry picked from commit 8a5101a29ce850e12bba14022dcdc0f500c9ad25)
o/Base64.java
082643a27088b8dbae15c0e084ce319d0346636a 29-Sep-2015 Narayan Kamath <narayan@google.com> Add libcore.util.RecoverySystem

Hides libcore implementation details and lets us avoid applying
libcore's obfuscation map to the frameworks.

bug: 24308618
Change-Id: I9958c034c58b9c6163adb8a857ab72817cb8540f
til/RecoverySystem.java
02b43bf44cb8bf8653baf8d951943a907310c3a2 02-Mar-2015 Neil Fuller <nfuller@google.com> Changes to enable timezone data overrides for ICU and libcore

Bug: 19941636

(cherry picked from commit 317d6e12782e069e4fde06ed0f9a976a7c49f580)

Change-Id: Ie6ac94ea8b819bed7b95585dd63267b21a5c6f53
til/ZoneInfoDB.java
9c853c5b9ebbb0ef60a013ae10ee411d70dfa832 18-Feb-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementations of java.text.*

- LocaleInternalsTest has been disabled since it depends on
internal implementation details.
- Collator: Use libcore's RuleBasedCollatorICU to fetch collator
rules instead of sun.misc.resources.LocaleData & friends.
- DateFormat: Add support for set24HourTimePref (not wired up
yet).
- DateFormatSymbols : Use libcore's LocaleData & TimeZoneNames
classes internally.
- NumberFormat: Use libcore's LocaleData.
- Drop support for SCIENTIFICSTYLE (we should re-enable this at
some point ?).
- SimpleDateFormat : Don't reject the format specifiers for
standalone weekday and friends. We'll need to switch over to
using ICU4J formatters at some point.
- Calendar : Use GregorianCalendar only.
- TimeZone : Use TimeZoneNames to access time zone names.

Change-Id: I4a2866904d4f2f39f0793154d9aad7f109da3b5a
cu/ICU.java
til/ZoneInfo.java
728029941ba340aeb8e4098b7ad12d3a30e38aa9 05-Oct-2015 Neil Fuller <nfuller@google.com> Switch from jarjar to generated source for ICU4J

Future changes will include ICU4J classes as public APIs
(still beneath android.icu). To generate these docs source
code will be needed under the expected package (android.icu),
as well as the ability to apply changes to the javadoc
comments programatically so ICU can be upgraded easily.

A consequence of this change is that libcore code can now
depend on icu in the android.icu package and not the
com.ibm.icu package as was the case previously. A nice
side effect is that the source code is available for use
during debugging as well.

Bug: 22023363
Change-Id: Icba5668fae53e2dc98ccc74e2f1ad1ca226e5feb
cu/CollationKeyICU.java
cu/DateIntervalFormat.java
cu/DateTimeFormat.java
cu/DateUtilsBridge.java
cu/RelativeDateTimeFormatter.java
595904f2798b24d16b7b180a278ee964dcefd637 13-Oct-2015 Sergio Giro <sgiro@google.com> libcore: fix errors in UriCodec

- don't assume that percent is retained
- handle ' ' -> '+' correctly

Bug: 24806835
Bug: 24602226
Change-Id: Ide7af5a79b801177010eb5e14ccd7cfd298c08be
et/UriCodec.java
0bb49368c73f9ff216993c469d842e83f43c0aaa 24-Sep-2015 Neil Fuller <nfuller@google.com> am 69f37702: Merge "Fix JarURLConnection.getJarFile() caching behavior"

* commit '69f3770205faf2fd0112bf63e662fde491a2cfad':
Fix JarURLConnection.getJarFile() caching behavior
69f3770205faf2fd0112bf63e662fde491a2cfad 24-Sep-2015 Neil Fuller <nfuller@google.com> Merge "Fix JarURLConnection.getJarFile() caching behavior"
37403580a5a070c7213506e636cb09a91af740a4 22-Sep-2015 Sergio Giro <sgiro@google.com> am 6d6f574e: Merge "libcore: rewrite of UriCodec"

* commit '6d6f574e762052ccc8ed6791f2a267c66b0288d5':
libcore: rewrite of UriCodec
6d6f574e762052ccc8ed6791f2a267c66b0288d5 22-Sep-2015 Sergio Giro <sgiro@google.com> Merge "libcore: rewrite of UriCodec"
fda56554dbf5caf1af1982cad020a8dca5632244 09-Sep-2015 Sergio Giro <sgiro@google.com> libcore: rewrite of UriCodec

Added unit tests

Change-Id: Idd575564076299f648919e243a1cce79401eb1cf
et/UriCodec.java
ef411e4b8932bf0519ebf509817fac8506e44aa5 10-Sep-2015 Neil Fuller <nfuller@google.com> Fix JarURLConnection.getJarFile() caching behavior

Commits 05a5c2f and 2ce899f introduced alternative
handling for resources found in jars to reduce memory
usage.

There are a couple of issues fixed here to retain
behavior found on older Android releases (and still
implemented in libcore.net.url.JarURLConnecitonImpl):

1) There is an implicit contract on JarURLConnection that,
by default, any caller of JarURLConnection.getJarFile()
must not close the jar file. This is because
the default behavior is to use a VM-level cache of open
JarFile objects (see URLConnection.getUseCaches()).

In ClassPathURLStreamHandler, a JarFile was being
created on demand each time, regardless of the cache
setting. It was causing garbage collection warnings when
the caller abandoned it.

The exposure of the shared JarFile instance is
dangerous, but it is the way 3rd party code like ICU4J
assumes things work. It would be incorrect for the
caller to close the JarFile: to do so on earlier versions
of Android would cause problems for other users of the
classloader / jar.

2) There was an implicit contract on the InputStream
behavior when caching was switched off: closing the stream
should close the URLConnection and any associated JarFile.
This has now been implemented.

Bug: 20685844
Change-Id: I42e78fb74b40380fe1232e54876e75df1f434f1e
o/ClassPathURLStreamHandler.java
3658ace87a3efbf0fede1c38d3c548e55dcb832c 15-Sep-2015 Neil Fuller <nfuller@google.com> am 37bd81af: Merge "Fix for boot classpath handling of directory entries"

* commit '37bd81afbc146ab0f6b2c5c58c67853284d59c2e':
Fix for boot classpath handling of directory entries
37bd81afbc146ab0f6b2c5c58c67853284d59c2e 15-Sep-2015 Neil Fuller <nfuller@google.com> Merge "Fix for boot classpath handling of directory entries"
7cd7527ab01b87fced3855e5ed91dbaab708b017 09-Sep-2015 Neil Fuller <nfuller@google.com> Fix for boot classpath handling of directory entries

When finding resources, directory entries should be found
even if the trailing "/" is omitted.

Required by ICU4J when loading resources from jar files.
Thanks to Fredrik Roubert for the report.

Bug: 22527772
Change-Id: I2a1c20df98c7b284dab06214d308a9bfbd272824
o/ClassPathURLStreamHandler.java
f13aa2ce1850c90e5705298bc5a21095b82c7eb8 04-Sep-2015 Neil Fuller <nfuller@google.com> am b8fcb81f: Merge "Revert "Revert "Migrate Collator classes to use ICU4J."""

* commit 'b8fcb81f03613bd18c6a64ff17ef01f17dbe3c57':
Revert "Revert "Migrate Collator classes to use ICU4J.""
b8fcb81f03613bd18c6a64ff17ef01f17dbe3c57 04-Sep-2015 Neil Fuller <nfuller@google.com> Merge "Revert "Revert "Migrate Collator classes to use ICU4J."""
429453cfea196d9090512dfef78c23a2495ebff0 02-Sep-2015 Sergio Giro <sgiro@google.com> am 7ad1d752: Merge "libcore: new implementation of libcore.io.Base64"

* commit '7ad1d752ba4a1a19c401e5ff1ec1e64fbe95b5a1':
libcore: new implementation of libcore.io.Base64
7ad1d752ba4a1a19c401e5ff1ec1e64fbe95b5a1 02-Sep-2015 Sergio Giro <sgiro@google.com> Merge "libcore: new implementation of libcore.io.Base64"
8a5101a29ce850e12bba14022dcdc0f500c9ad25 01-Sep-2015 Sergio Giro <sgiro@google.com> libcore: new implementation of libcore.io.Base64

Change-Id: I2ebdaf5dda37911db4827899eb722dd20c44da73
o/Base64.java
ca8865ea2d10dc0a0d73d42d51bd2c0396267a4d 01-Sep-2015 Sergio Giro <sgiro@google.com> am 7026e099: Merge "libcore: new implementation of libcore.util.SneakyThrow"

* commit '7026e09969ed40adae870b86f346822f6f93abd7':
libcore: new implementation of libcore.util.SneakyThrow
50481869a2e67cfdfc102202878caa5bad1c70d5 01-Sep-2015 Sergio Giro <sgiro@google.com> libcore: new implementation of libcore.util.SneakyThrow

Change-Id: I7c8bd6777a83d1e5260278704d2a6299c3a5299b
til/SneakyThrow.java
3df3bfcbad6f4da20964424c4772985d1b1586a1 26-Aug-2015 Rayhaan Jaufeerally <rayhaan@google.com> Revert "Revert "Migrate Collator classes to use ICU4J.""

The SDK build is now fixed by adding icu4j as a dependency of docs.

This reverts commit 5fc822e7ef47448adccd73ca2ebbd28a068f5136.

Change-Id: Ibac9b40189a83323e5175e8ea26c973eb07bc34f
cu/CollationElementIteratorICU.java
cu/CollationKeyICU.java
cu/NativeCollation.java
cu/RuleBasedCollatorICU.java
9ace41efcb1f7b5b78576563e7495b228a26ee07 20-Aug-2015 Neil Fuller <nfuller@google.com> am 07af2d08: Merge "Use System.nanoTime() for timeouts and durations"

* commit '07af2d08434b9166ec0d127c8b17d1fd550429df':
Use System.nanoTime() for timeouts and durations
07af2d08434b9166ec0d127c8b17d1fd550429df 20-Aug-2015 Neil Fuller <nfuller@google.com> Merge "Use System.nanoTime() for timeouts and durations"
8c36c45d9746cf2143d9d708103bbf3fbb0062e8 18-Aug-2015 Neil Fuller <nfuller@google.com> am 4fd38444: Merge "Revert "Migrate Collator classes to use ICU4J.""

* commit '4fd38444c4cc0fb0b529d4e9e3d7fd05e8edfac6':
Revert "Migrate Collator classes to use ICU4J."
5fc822e7ef47448adccd73ca2ebbd28a068f5136 18-Aug-2015 Neil Fuller <nfuller@google.com> Revert "Migrate Collator classes to use ICU4J."

This reverts commit bf7bbff3a512b3350911d129aba5503dcfde9311.

Change-Id: I5e3d3481d1df11d31871d63fd1575cbf46698dee
cu/CollationElementIteratorICU.java
cu/CollationKeyICU.java
cu/NativeCollation.java
cu/RuleBasedCollatorICU.java
8ada31a6212ab1974134d5f8a190ed9f8518646d 18-Aug-2015 Neil Fuller <nfuller@google.com> am 1a48afbe: Merge "Migrate Collator classes to use ICU4J."

* commit '1a48afbeed4601ab60845a20f985800474db16a0':
Migrate Collator classes to use ICU4J.
bf7bbff3a512b3350911d129aba5503dcfde9311 23-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> Migrate Collator classes to use ICU4J.

The following benchmarks have been run and show the performance
gains from calling ICU4J.

----- ICU4J -----
benchmark us linear runtime
CollatorIdentical 6.90 ==============================
CollatorPrimary 3.20 =============
CollatorSecondary 3.79 ================
CollatorTertiary 4.28 ==================
vm: app_process

----- ICU4C -----
benchmark us linear runtime
CollatorIdentical 11.75 ==============================
CollatorPrimary 10.01 =========================
CollatorSecondary 9.88 =========================
CollatorTertiary 10.26 ==========================
vm: app_process

All tests relating to Collation pass after this change.

With respect to CJK character loading time, tests were done on a
Nexus 6 running this change, in the US locale and TRADITIONAL_CHINESE
locale.

In EN-US:
Time to load Traditional Chinese collator after boot: 76ms, 76ms
Time to load again: (39ms, 36ms, 36ms), (36ms, 36ms, 48ms)
In ZH-TW:
Time to load Traditional Chinese collator after boot: 37ms, 36ms
Time to load again: (36ms, 36ms, 36ms), (35ms, 37ms, 35ms)

This seems to indicate the system is creating a Collator on boot meaning
that ICU is caching it after the first creation. So if a device is in the
Traditional Chinese locale, the cost of creating Traditional Chinese
collators should have been absorbed at boot time.

Loading up the CJK ideographs uses up around ~500k of memory. From the
above findings, if the device is in a language requiring those characters
then they should be loaded up on boot in the Zygote, which may mean the
memory is shared across processes wishing to use the data.

Change-Id: I98a1c32c8f58e03d16d694b8a4fca4ced961af8e
cu/CollationElementIteratorICU.java
cu/CollationKeyICU.java
cu/NativeCollation.java
cu/RuleBasedCollatorICU.java
d596f01c1431deaf028aa168de6492dc670c5aac 11-Aug-2015 Neil Fuller <nfuller@google.com> am a53c58dd: Merge "Migrate IDNA2003 implementation to ICU4J."

* commit 'a53c58dded9dd21716f2e3c66a8991aba00772f5':
Migrate IDNA2003 implementation to ICU4J.
654ec92a7bcd53944f7ebca64bf3e6bef855ebe5 11-Aug-2015 Neil Fuller <nfuller@google.com> am 001231c8: Merge "Remove libcore AlphabeticIndex and references. This has been replaced by ICU4J\'s library."

* commit '001231c8d362437f7b6c014b1097663eed5ef500':
Remove libcore AlphabeticIndex and references. This has been replaced by ICU4J's library.
a53c58dded9dd21716f2e3c66a8991aba00772f5 11-Aug-2015 Neil Fuller <nfuller@google.com> Merge "Migrate IDNA2003 implementation to ICU4J."
0517aff14a14236d4714634d9affe4f5b320984d 06-Aug-2015 Craig Cornelius <ccornelius@google.com> Remove libcore AlphabeticIndex and references. This has
been replaced by ICU4J's library.

Change-Id: I1365a18609b3d5bf45ae8341792a01f4e995f5bb
cu/AlphabeticIndex.java
9dcac8229f1efd676f3e3b7e8a2f9a2c3eda04d2 30-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> Migrate IDNA2003 implementation to ICU4J.

Although this migration uses the deprecated methods in ICU4J's
IDNA implementation, this has to be done to maintain complete
compatibility with the current implementation. This is because
the android API is explicitly documented as implementing the
IDNA2003 standard.

UTS46 is a new standard which aims to ease the transition to
IDNA2008 which is the latest specification for internationalized
domain names. Unfortunately this standard cannot be used in this
instance and will need to be introduced as part of another API.

The following benchmarks show the change in performance this
CL will cause. This seems acceptable for a string conversion.

--- Java ---
benchmark us linear runtime
ToAscii 804 ==============================
ToUnicode 323 ============
vm: app_process

--- Native ---
benchmark us linear runtime
ToAscii 134.0 ==============================
ToUnicode 89.5 ====================
vm: app_process

Change-Id: I96440d338ceeaea63eec490f49e9a35cfa5dc1f2
cu/NativeIDN.java
802f8393640db9889fb18faf3a0ea47d82157742 31-Jul-2015 Narayan Kamath <narayan@google.com> am 14c118f9: Merge "Remove Transliterator wrapper class."

* commit '14c118f904655ce63533cc34382946aa07a2109a':
Remove Transliterator wrapper class.
17552b6592aeaaa564725a07e10e8c4b1c8163cb 14-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> Remove Transliterator wrapper class.

This change removes the wrapper class in Java which was used for
proxying requests to ICU4c. Now ICU4J is called directly at the
call sites. See: https://android-review.googlesource.com/#/c/162002/

This is done by replacing instantiations of the old Transliterator
class with calls to a static factory in ICU4J which returns a cached
transliterator if available, otherwise creates it on demand.

This change requires that the transliterator resource directories
and source files are added to our java libraries, which increases
the size of core-libart.jar from 2.289 MB to 2.332 MB. Maybe it's
possible to wait until dependencies on ICU4c have been removed to
see if we can save space there.

Change-Id: I2b2f84a051ba9815ba6d346dfe7fb764e39032c4
cu/Transliterator.java
2b2745ef12b61d9f959a4f9e787130bcfda038b3 24-Jul-2015 Narayan Kamath <narayan@google.com> am 03fcecb1: Merge "Revert "Convert IDN to use ICU4j instead of ICU4c.""

* commit '03fcecb113010cd8963353de25ac2d6c0efbc153':
Revert "Convert IDN to use ICU4j instead of ICU4c."
2bb6745a5d77cc873fa4bb71deb0315ce445cbad 24-Jul-2015 Narayan Kamath <narayan@google.com> am 0409b675: Merge "Convert IDN to use ICU4j instead of ICU4c."

* commit '0409b675acc48309f8b20f2eeca345d5f5e22ac6':
Convert IDN to use ICU4j instead of ICU4c.
8d7307aed3c02fc9549c15f4bf14ad0a9587cd9d 24-Jul-2015 Narayan Kamath <narayan@google.com> Revert "Convert IDN to use ICU4j instead of ICU4c."

This reverts commit 9fe44362752f86af1d34eed6dca2b6a27ffa7ad8.

Change-Id: I22bd7819c20817be6444ccd11b903ae68f8e7745
cu/NativeIDN.java
9fe44362752f86af1d34eed6dca2b6a27ffa7ad8 16-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> Convert IDN to use ICU4j instead of ICU4c.

Apache harmony tests still pass after this change, and
new tests have been added to verify that this meets the
specification defined in http://unicode.org/reports/tr46/.

The benchmarks below show the performance penalty from not doing
this natively.
benchmark us linear runtime
JavaToAscii 59.6 =========================
JavaToUnicode 68.9 ==============================
NativeToAscii 11.2 ====
NativeToUnicode 13.8 ======

Change-Id: Ie3fd1d439d9fc2651f5f1773676d12409c430c83
cu/NativeIDN.java
c40ab79a5099bd9723b0798ff2881b5657b6cc1e 21-Jul-2015 Narayan Kamath <narayan@google.com> am 83b2235f: Merge "Remove NativePluralRules since we are using ICU4J directly."

* commit '83b2235fb8ecd33af368b0f3948dbdb8455f2358':
Remove NativePluralRules since we are using ICU4J directly.
011e5d211ac55099709bdf34bf3eae069b6e9e8e 21-Jul-2015 Narayan Kamath <narayan@google.com> am eed9cb15: Merge "Transition the Normalizer class to call ICU4j."

* commit 'eed9cb152b69d6e0b7c6fb892187af656bb6a955':
Transition the Normalizer class to call ICU4j.
32563bc5c9df70a52cfb5c2a9d6ab865e8200092 14-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> Remove NativePluralRules since we are using ICU4J directly.

The following benchmark shows the time taken for ICU4C to
run quantityForInt(5) on the US locale as _native, and _java
shows the time taken for the ICU4J PluralRules.select(5)
method to be run on the US locale.

benchmark us linear runtime
_java 2.27 ==============================
_native 1.89 =========================
vm: app_process

Change-Id: I2ca9a6636ea48bf922eceedce1cf3ef357cc4b99
cu/NativePluralRules.java
37dd239f099f1d1b2aca030a2fe458669718cd78 14-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> Transition the Normalizer class to call ICU4j.

The following benchmarks were obtained by running parts of NormalizerTest
through caliper.
benchmark us linear runtime
ICU4cIsNormalized 5.09 ======
ICU4jIsNormalized 5.22 ======
ICU4cNormalize 22.56 ==============================
ICU4jNormalize 21.97 =============================

NormalizerTest still passes after this change on Shamu. This change also
removes the JNI calls and their associated C++ wrappers.

Change-Id: I9081c899a76fdb3a341ca5ecd54c32cd6e6a0387
cu/NativeNormalizer.java
8ccce6c06fbd0342dc27c962a79ede91dea37ea4 10-Jul-2015 Neil Fuller <nfuller@google.com> am ba956108: Merge "Add Os.unlink"

* commit 'ba956108c05b923b20d6b31b4d491c9263fa1231':
Add Os.unlink
b3697ef2fcef7f054e8468b2f009ae9781f7450a 09-Jul-2015 Neil Fuller <nfuller@google.com> am d30aac6c: Merge "Rearrange how AF_UNIX sockets are handled for accept()"

* commit 'd30aac6cafe07baaa84efcf82f9c5108e7a5c0b7':
Rearrange how AF_UNIX sockets are handled for accept()
5e8f82f2592498e75ac4685ccd0d31d601d37bdc 09-Jul-2015 Neil Fuller <nfuller@google.com> Add Os.unlink

Add the unlink method to Os/Posix.

Bug: 3106438
Change-Id: I86f2d7b6aa98e355ec3220b6a1230033b79f0176
o/ForwardingOs.java
o/Os.java
o/Posix.java
0ab1a26ca767ae36fbbe27b62893670b208fa494 07-Jul-2015 Neil Fuller <nfuller@google.com> Rearrange how AF_UNIX sockets are handled for accept()

Contains the following changes:
1) Introduction of UnixSocketAddress / removal of InetUnixAddress.
2) Os/Posix classes now take SocketAddress instead of InetSocketAddress.
3) Removal of native code that dealt with InetUnixAddress.
4) Introduction of OsConstants.UNIX_PATH_MAX to hold the maximum sun_path
size.
5) Update tests.

Bug: 3106438
Change-Id: I47a3618387f21599bfbfd0dc9a821839bf47b39b
o/BlockGuardOs.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
90246a0ae7117d780e077c9e84cdb73ff5b44af7 02-Jul-2015 Jeff Sharkey <jsharkey@android.com> Add getxattr/setxattr/removexattr syscalls.

Bug: 20275572

(cherry picked from commit 82d076b51f6fe7c1cbd1f37414be36eaaa9b0e56)

Change-Id: Ifb808e69dddb88eba253ddf4273013828eab16f6
o/ForwardingOs.java
o/Os.java
o/Posix.java
f6634641d7f1889e902d6b71c8c993e2880fa20f 02-Jul-2015 Jeff Sharkey <jsharkey@android.com> am be80d883: Merge "Add getxattr/setxattr/removexattr syscalls." into mnc-dev

* commit 'be80d8833a8058eba9e510a29b84dfac711cf5db':
Add getxattr/setxattr/removexattr syscalls.
82d076b51f6fe7c1cbd1f37414be36eaaa9b0e56 02-Jul-2015 Jeff Sharkey <jsharkey@android.com> Add getxattr/setxattr/removexattr syscalls.

Bug: 20275572
Change-Id: I958056f757f095ad6278624e293a5583d9cee822
o/ForwardingOs.java
o/Os.java
o/Posix.java
a7417af2d873df5cf79c64e790b3bd64666aac5d 01-Jul-2015 Neil Fuller <nfuller@google.com> Use System.nanoTime() for timeouts and durations

System.currentTimeMillis() is affected by abrupt system clock
changes (which happen due to network time changes, etc.).

System.nanoTime() is the recommended alternative.

Bug: 4367611
Change-Id: I27fb855bb4330da6856520819c9fc355f9a46aa2
cu/TimeZoneNames.java
o/IoBridge.java
22e2d41ff2ca9879835cf66a41b0637d435e5581 13-Jun-2015 Dmitriy Ivanov <dimitry@google.com> am a4fafb89: Merge "Fix lookup order when opening directly from APK"

* commit 'a4fafb890a53640e859f4ee82b6d87a41edae61a':
Fix lookup order when opening directly from APK
384730cb57f41235f09829355d7ce67132625f7f 06-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Fix lookup order when opening directly from APK

The order should be as follows:
1. Uncompressed native library dir (if any)
2. Directly from apk (<apk>!/lib/<abi>)
3. vendor/lib:/system/lib

Bug: http://b/21647354
Bug: http://b/21667767
Bug: http://b/21726698
Bug: http://b/8076853
Change-Id: I62cd76b7e4ae927d865d7d0ee81ceb91caa54e99
o/ClassPathURLStreamHandler.java
378401df38027e707859755912e4d660091b94c9 04-Jun-2015 Neil Fuller <nfuller@google.com> am 3db17f7f: Merge "Revert "Revert "Modification to the way boot classpath resources are loaded"""

* commit '3db17f7fcd2a93cfeead9874696a8901423aba6d':
Revert "Revert "Modification to the way boot classpath resources are loaded""
3db17f7fcd2a93cfeead9874696a8901423aba6d 04-Jun-2015 Neil Fuller <nfuller@google.com> Merge "Revert "Revert "Modification to the way boot classpath resources are loaded"""
2ce899fcb81707dd5447a15c29c2c137697f2f5e 04-Jun-2015 Neil Fuller <nfuller@google.com> Revert "Revert "Modification to the way boot classpath resources are loaded""

This reverts commit 0c2e3c7fcb6754a2116c6226fe6480b3f6fa691f.

Change-Id: I37abbb83f6091f252c90645b8a088cf361fa6a7a
o/ClassPathURLStreamHandler.java
2a9ffd276edd0eeff3dd0af79a5c3ec1a337784c 03-Jun-2015 Neil Fuller <nfuller@google.com> am 049862d6: Merge "Revert "Modification to the way boot classpath resources are loaded""

* commit '049862d6692e4b2eafc140e8389848c4ac182517':
Revert "Modification to the way boot classpath resources are loaded"
7a75a7d6c27841c8e31a9d2d799c75d7958470da 03-Jun-2015 Neil Fuller <nfuller@google.com> am e41d5b91: Merge "Modification to the way boot classpath resources are loaded"

* commit 'e41d5b91fc53a5116584845b4ec6373588e77789':
Modification to the way boot classpath resources are loaded
049862d6692e4b2eafc140e8389848c4ac182517 03-Jun-2015 Neil Fuller <nfuller@google.com> Merge "Revert "Modification to the way boot classpath resources are loaded""
0c2e3c7fcb6754a2116c6226fe6480b3f6fa691f 03-Jun-2015 Neil Fuller <nfuller@google.com> Revert "Modification to the way boot classpath resources are loaded"

This reverts commit 05a5c2f89e12e27db69f24165a05bdfd0476c73a.

Change-Id: I07cc3841df40d20e2c09b0bf282bf213f422effe
o/ClassPathURLStreamHandler.java
e41d5b91fc53a5116584845b4ec6373588e77789 03-Jun-2015 Neil Fuller <nfuller@google.com> Merge "Modification to the way boot classpath resources are loaded"
5c659dc1f1ec4fbcd4b6fcd9bd5e3ecbab3a0231 01-Jun-2015 Neil Fuller <nfuller@google.com> am e20cd5b3: Merge "Correct docs based on recent behavior change"

* commit 'e20cd5b3b0049d5cefc80be4785bad42dc29b214':
Correct docs based on recent behavior change
e20cd5b3b0049d5cefc80be4785bad42dc29b214 01-Jun-2015 Neil Fuller <nfuller@google.com> Merge "Correct docs based on recent behavior change"
05a5c2f89e12e27db69f24165a05bdfd0476c73a 19-May-2015 Neil Fuller <nfuller@google.com> Modification to the way boot classpath resources are loaded

VMClassLoader.getResource(), used by the Android boot classloader
was more expensive than it needed to be.

Context:

Checking each classpath entry for a resource involved opening a
zip file, checking for the resource and closing it again.

Because classloaders are arranged in a hierarchy, and parent
classloaders are checked first, this change should have a positive
performance impact for every call to ClassLoader.getResource(),
getResources() and getResourceAsStream(), regardless of the
classloader being used.

Details of change:

This change builds on an earlier commit for BaseDexClassLoader.
See commit 1a796cbc5dfb263511f2f4e5213adbc1d396a813 for the
earlier change. Unlike the BaseDexClassLoader change, we did
not have the zip file already open so this does impact the amount
of reported heap memory being used at rest in the zygote. It may
increase the amount of heap memory in use generally for jars
that have no resources because all jar files are opened, not
just the ones found to have requested resources. The heap memory
should consist of the entry metadata. The zip file itself is
mapped into non-heap/native memory.

Any resources loaded from the boot classloader previously
would have caused the JarURLConnection cache to hold the
associated zip file open anyway. See
https://code.google.com/p/android/issues/detail?id=60071 for
context. This change avoids the use of that cache for bootclass
path resources. Most other usages of jar: urls should now be
within the control of apps, and their can call setUseCache() to
prevent caching.

Performance:

Measured on a Nexus 5. All values in microseconds.

Benchmark (not real app):

GetBootResource_hit - looks for a resource known to be in the
boot classpath in core-libart: java/util/logging/logging.properties
GetBootResource_miss - looks for a resource known to be missing.

Before:
GetBootResource_hit 237
GetBootResource_miss 3034

After:
GetBootResource_hit 23.8
GetBootResource_miss 22.5

App (using vogar --mode activity):

Before:
Hit: 236-446
Miss: 3042-3555

After:
Hit: 65-180
Miss: 88-120

Memory usage:

The use of StrictJarFile keeps the memory usage down to low levels
levels: An initial implementation of this change that used JarFile
was showing up as expensive because the heap memory usage is
dependent on the number of entries in the jar. ext.jar was taking
up 275k due to a large number of resources associated with
libphonenumber. By using StrictJarFile, Java heap usage is now < 2k
per jar. The JarFile cost would previous have been paid anyway
if an app read a resource out of ext.jar (because of the
JarURLConnectionImpl cache) so this change should also produce savings
there. It does mean that we map all the class path jars into memory
natively, but the kernel should be managing that for us and sharing
the expense across all apps.

Given the runtime may be mapping the files for its own purposes
elsewhere the additional cost may even be nil.

Bug: https://code.google.com/p/android/issues/detail?id=60071
Bug: 20685844
Change-Id: Ic3dc4a655c46cc67bfe9b9e254036c6651869c92
o/ClassPathURLStreamHandler.java
be5d952f05f6d1c5a45ab2c96f43fc2048d0d7ae 28-May-2015 Neil Fuller <nfuller@google.com> Correct docs based on recent behavior change

Commit a40d2447b6f516116135ee7f126579771ba98a2c made
the behavior consistently "upper case".

Bug: 20247811
Change-Id: I86bcc32e1be210f7ff581c3ba7377ca2a60c0999
cu/RelativeDateTimeFormatter.java
b0e8b0be0de7f3b44d6bba92944e6a376163a580 27-May-2015 Neil Fuller <nfuller@google.com> am 7389bd09: Merge "munmap the tzdata file if ZoneInfoDB.TzData is ever collected"

* commit '7389bd09f1d60771bd36f1ddbef84c9b9f09dd60':
munmap the tzdata file if ZoneInfoDB.TzData is ever collected
c93108e864969819bdc9a453b585c547aadfef12 22-May-2015 Neil Fuller <nfuller@google.com> munmap the tzdata file if ZoneInfoDB.TzData is ever collected

In the unusual / unexpected case that the runtime is shut down
cleanly but the process remains we should be munmapping the
MappedFile explicitly. MappedFile does not have a finalizer
that unmaps automatically.

Change-Id: I51c364cbe0f356798dbb73755277da34d97bf452
til/ZoneInfoDB.java
45190381fe84506d16b72daa64aa8160952068ea 12-May-2015 Travis Keep <rocketman@google.com> Fix bug in formatting intervals at month boundaries.

In formatting date intervals, we subtract one day from the end time
if it falls on midnight the next day so that both times are in the
same day, thereby avoiding the date appearing in the formatted
interval. We did this by calling endCalendar.roll(Calendar.DAY_OF_MONTH, false).
However, if endCalendar was 1 May 2015 (say), the date rolls over
to 31 May 2015 (this is the documented behaviour of roll).

We now use endCalendar.add(Calendar.DAY_OF_MONTH, -1) which always
subtracts a day so that 1 May 2015 becomes 30 April 2015, this is
the desired behavior.

bug: 20708022

(cherry picked from commit 13faecd3105c23f8a60ce3a5847056489fd2d037)

Change-Id: Ic947c7c65008d23d1cb1b9bde6af35972ac6acd7
cu/DateIntervalFormat.java
13faecd3105c23f8a60ce3a5847056489fd2d037 12-May-2015 Travis Keep <rocketman@google.com> Fix bug in formatting intervals at month boundaries.

In formatting date intervals, we subtract one day from the end time
if it falls on midnight the next day so that both times are in the
same day, thereby avoiding the date appearing in the formatted
interval. We did this by calling endCalendar.roll(Calendar.DAY_OF_MONTH, false).
However, if endCalendar was 1 May 2015 (say), the date rolls over
to 31 May 2015 (this is the documented behaviour of roll).

We now use endCalendar.add(Calendar.DAY_OF_MONTH, -1) which always
subtracts a day so that 1 May 2015 becomes 30 April 2015, this is
the desired behavior.

bug: 20708022

Change-Id: Id222582b26170a91a4ce2f4b5ebef3c15bce7c92
cu/DateIntervalFormat.java
d2237f8e76817df5c8f2493740af3ee96ef4033b 30-Apr-2015 Narayan Kamath <narayan@google.com> am 3bb83381: Add a ZoneInfoDB.hasTimeZone API.

* commit '3bb833819dba8d530620ad6d43dc53c3fd54763b':
Add a ZoneInfoDB.hasTimeZone API.
8ac094531caac4c2b1126f8630211603813c97fb 24-Apr-2015 Narayan Kamath <narayan@google.com> Add a ZoneInfoDB.hasTimeZone API.

Allows us to query the DB without having to clone an object or
an entire strings array.

bug: 19106773
bug: 19987403

(cherry picked from commit 3bb833819dba8d530620ad6d43dc53c3fd54763b)

Change-Id: Ic100bc3bb0b985ca49a04ccf6a09306c758b78ef
til/ZoneInfoDB.java
3bb833819dba8d530620ad6d43dc53c3fd54763b 24-Apr-2015 Narayan Kamath <narayan@google.com> Add a ZoneInfoDB.hasTimeZone API.

Allows us to query the DB without having to clone an object or
an entire strings array.

bug: 19106773
bug: 19987403
Change-Id: I66d466e414972b02a75bcfe68263e74de8b9a768
til/ZoneInfoDB.java
9267e25e4cf72daabe079e4a764a513c7bdf8b71 28-Apr-2015 Jeff Hao <jeffhao@google.com> am 39f72b16: Merge "Removed offset and value from String and added StringFactory."

* commit '39f72b16952fbe4aff5c2e080ce9f7f6dbb1b93d':
Removed offset and value from String and added StringFactory.
83c7414449bc406b581f0cb81ae06e7bce91403c 15-Jan-2014 Jeff Hao <jeffhao@google.com> Removed offset and value from String and added StringFactory.

Change-Id: I55314ceb906d0bf7e78545dcd9bc3489a5baf03f
til/CharsetUtils.java
acd9b0b85150feff5a4be4e696f411aa98fb4da1 24-Apr-2015 Neil Fuller <nfuller@google.com> am bd7c7451: am 726db7ae: Merge "Ensure consistency of capitalization in RelativeDateTimeFormatter"

* commit 'bd7c7451634fa46aef554dd6e09421ce2d6033a6':
Ensure consistency of capitalization in RelativeDateTimeFormatter
726db7aea4817a43a1fd094d18e57de5b244ee39 23-Apr-2015 Neil Fuller <nfuller@google.com> Merge "Ensure consistency of capitalization in RelativeDateTimeFormatter"
f0bed5bdac27e52228aca563d701d9ef47976f01 22-Apr-2015 Narayan Kamath <narayan@google.com> am ccb61deb: am 97ca5855: Merge "Move java.nio.Charsets to libcore.util."

* commit 'ccb61deb8f478f91404b75cbe19cb7b9cbcb4f76':
Move java.nio.Charsets to libcore.util.
3f7c674bd1d220d1a8c149b5658145171c28094f 22-Apr-2015 Narayan Kamath <narayan@google.com> Move java.nio.Charsets to libcore.util.

This isn't public API, and isn't related to NIO. It's only ever
used by java.lang.String.

bug: 10898787
Change-Id: I4e194406746b88ba7268c2553e467e7e05400b40
til/CharsetUtils.java
a40d2447b6f516116135ee7f126579771ba98a2c 17-Apr-2015 Neil Fuller <nfuller@google.com> Ensure consistency of capitalization in RelativeDateTimeFormatter

Contains refactoring. Benchmarks below to show no appreciable
negative performance impact to formatters. We do now cache a new
type of formatter.

Benchmarks measured in microseconds on mako.

Before:
DateIntervalFormat_formatDateRange_DATE 244
DateIntervalFormat_formatDateRange_DATE_TIME 256
DateIntervalFormat_formatDateRange_TIME 208

RelativeDateTimeFormatter_getRelativeDateTimeString 207.2
RelativeDateTimeFormatter_getRelativeDateTimeString_ABBREV 218.2
RelativeDateTimeFormatter_getRelativeTimeSpanString 70.5
RelativeDateTimeFormatter_getRelativeTimeSpanString_ABBREV 67.4

After:
DateIntervalFormat_formatDateRange_DATE 237
DateIntervalFormat_formatDateRange_DATE_TIME 241
DateIntervalFormat_formatDateRange_TIME 200

RelativeDateTimeFormatter_getRelativeDateTimeString 149.4
RelativeDateTimeFormatter_getRelativeDateTimeString_ABBREV 161.8
RelativeDateTimeFormatter_getRelativeTimeSpanString 71.7
RelativeDateTimeFormatter_getRelativeTimeSpanString_ABBREV 69.0

Bug: 20247811
Change-Id: I51075f89ca6b1d8862335e0e5a4d67a5624edfa6
cu/DateIntervalFormat.java
cu/DateTimeFormat.java
cu/DateUtilsBridge.java
cu/RelativeDateTimeFormatter.java
7761a6006e15e8a1b38ada29ec804a0fb3b4f73f 21-Apr-2015 Narayan Kamath <narayan@google.com> am 69773bd2: am 21a0e54a: Merge "Remove support for reading mime types from property files."

* commit '69773bd217466a536c9317073a184d3907f58100':
Remove support for reading mime types from property files.
db4d0bd54407d4f6116e51ba0668869f3f790b40 20-Apr-2015 Narayan Kamath <narayan@google.com> Remove support for reading mime types from property files.

This support was untested and unused and of very limited utility,
given that this class is initialized in the zygote. It also discourages
arbitrary changes to the priority order of mappings.

Change-Id: I2a7f91d2956627cd59f948561c37678bc45d118d
et/MimeUtils.java
3f893b2b815903fde8af0be8b04da6b3556b2d92 16-Apr-2015 Neil Fuller <nfuller@google.com> am b059489d: am 83f2b5f3: Merge "Use ICU4J more in DateIntervalFormat and RelativeDateTimeFormatter"

* commit 'b059489d9b120279eff706efda839ff719e722e0':
Use ICU4J more in DateIntervalFormat and RelativeDateTimeFormatter
12fbbc16959d078dde23b3b15c8d3d127ef33507 15-Apr-2015 Neil Fuller <nfuller@google.com> Use ICU4J more in DateIntervalFormat and RelativeDateTimeFormatter

General strategy: Switch to ICU classes for Calendar, and generally
use ICU classes earlier to avoid multiple creations.

This also incorporates some feedback from narayan@ from
https://android-review.googlesource.com/#/c/145662/

Some small optimizations applied but the goal was not to make it
much faster, just to confirm it wasn't much slower. It has sped up
some methods, and slowed down others, but not much difference in
absolute terms.

All times in microseconds measured on a mako.

Original:
RelativeDateTimeFormatter_getRelativeDateTimeString 582.4
RelativeDateTimeFormatter_getRelativeDateTimeString_ABBREV 603.2
RelativeDateTimeFormatter_getRelativeTimeSpanString 39.9
RelativeDateTimeFormatter_getRelativeTimeSpanString_ABBREV 39.1

After:
RelativeDateTimeFormatter_getRelativeDateTimeString 207.2
RelativeDateTimeFormatter_getRelativeDateTimeString_ABBREV 218.2
RelativeDateTimeFormatter_getRelativeTimeSpanString 70.5
RelativeDateTimeFormatter_getRelativeTimeSpanString_ABBREV 67.4

Original:
DateIntervalFormat_formatDateRange_DATE 290
DateIntervalFormat_formatDateRange_DATE_TIME 298
DateIntervalFormat_formatDateRange_TIME 276

After:
DateIntervalFormat_formatDateRange_DATE 244
DateIntervalFormat_formatDateRange_DATE_TIME 256
DateIntervalFormat_formatDateRange_TIME 208

Change-Id: If043bd55ffec37ed2735aa1593f327b38749218c
cu/DateIntervalFormat.java
cu/RelativeDateTimeFormatter.java
425c18c1fa2631450fdd0e0cab64983658bc531d 14-Apr-2015 Neil Fuller <nfuller@google.com> am c5546c4c: am 0ed6c7db: Merge "Switch DateIntervalFormat/RelativeDateTimeFormatter to ICU4J"

* commit 'c5546c4c0812bba9d9a6b0611839465b9fd4eab6':
Switch DateIntervalFormat/RelativeDateTimeFormatter to ICU4J
f7d3d845d1db889060262cfb7a9f73a2c4fdb7f3 07-Apr-2015 Travis Keep <rocketman@google.com> Switch DateIntervalFormat/RelativeDateTimeFormatter to ICU4J

Information below from the existing benchmarks on a hammerhead. All
times given in microseconds. Note that the new version is slower,
but this is a small difference in absolute terms and means less
maintenance for libcore.

The ICU team is rewriting some of the underlying code in ICU4J
for a future ICU release which may alter performance.

ICU4C + JNI
DateIntervalFormat_formatDateRange_DATE 67.8
DateIntervalFormat_formatDateRange_DATE_TIME 76.0
DateIntervalFormat_formatDateRange_TIME 54.8
ICU4J
DateIntervalFormat_formatDateRange_DATE 179
DateIntervalFormat_formatDateRange_DATE_TIME 181
DateIntervalFormat_formatDateRange_TIME 167

ICU4C + JNI
RelativeDateTimeFormatter_getRelativeDateTimeString 151.6
RelativeDateTimeFormatter_getRelativeDateTimeString_ABBREV 169.0
RelativeDateTimeFormatter_getRelativeTimeSpanString 27.8
RelativeDateTimeFormatter_getRelativeTimeSpanString_ABBREV 27.7
ICU4J
RelativeDateTimeFormatter_getRelativeDateTimeString 366.5
RelativeDateTimeFormatter_getRelativeDateTimeString_ABBREV 377.6
RelativeDateTimeFormatter_getRelativeTimeSpanString 23.2
RelativeDateTimeFormatter_getRelativeTimeSpanString_ABBREV 22.9

Bug: 20127691
Change-Id: I1ebc08fd9c974743026ae1e6c848fb4de8aa0e48
cu/DateIntervalFormat.java
cu/RelativeDateTimeFormatter.java
ee5e33710062acfa55dffd3095752315cd696934 07-Apr-2015 Neil Fuller <nfuller@google.com> am 8426170b: am 345d118d: Merge "Changes to enable timezone data overrides for ICU and libcore"

* commit '8426170b2440ce9d9857f8b63e5de5f77d7ee393':
Changes to enable timezone data overrides for ICU and libcore
345d118df6eef599a1ad0ea18022ad1f74633f10 07-Apr-2015 Neil Fuller <nfuller@google.com> Merge "Changes to enable timezone data overrides for ICU and libcore"
de5d497faaf9dbe88b7362774f9aa1b56045fadb 02-Apr-2015 Narayan Kamath <narayan@google.com> am ff1e2b45: am 6696f19d: Merge "Implement BreakIterator in terms of icu4j."

* commit 'ff1e2b45293d883fbff3d58f1d88746fbe126836':
Implement BreakIterator in terms of icu4j.
d0ef6d8b070d2892caf59d1f7501ff05667be6cc 27-Mar-2015 Narayan Kamath <narayan@google.com> Implement BreakIterator in terms of icu4j.

Note that we need manual range checks in our wrapper because
the ICU4J implementation will clamp offsets to either end of
the input text.

benchmark results :

text benchmark us linear runtime
LIPSUM BreakIterator 326.02 =====
LIPSUM IcuBreakIterator 333.47 ======
LONGPARA BreakIterator 227.67 ====
LONGPARA IcuBreakIterator 228.68 ====
GERMAN BreakIterator 79.09 =
GERMAN IcuBreakIterator 81.30 =
THAI BreakIterator 1654.11 ==============================
THAI IcuBreakIterator 1646.75 =============================
THAI2 BreakIterator 44.28 =
THAI2 IcuBreakIterator 42.67 =
TABS BreakIterator 12.79 =
TABS IcuBreakIterator 12.53 =
ACCENT BreakIterator 16.26 =
ACCENT IcuBreakIterator 15.37 =
EMOJI BreakIterator 17.71 =
EMOJI IcuBreakIterator 18.34 =
SPACES BreakIterator 16.86 =
SPACES IcuBreakIterator 15.78 =
EMPTY BreakIterator 9.22 =
EMPTY IcuBreakIterator 9.96 =
NEWLINE BreakIterator 11.08 =
NEWLINE IcuBreakIterator 9.96 =
BIDI BreakIterator 19.54 =
BIDI IcuBreakIterator 18.96 =

Change-Id: I72023dd605da8e33974aa3181506f0d9c7bc180e
cu/NativeBreakIterator.java
9fcb768540b0ae3c507cb5ac037edb59ba7376b4 30-Mar-2015 Neil Fuller <nfuller@google.com> am 1b29afea: am fc62e635: Merge "Add a test to confirm that TZ data is in sync"

* commit '1b29afea69c76a7ed73c60d35d84b515097b25a0':
Add a test to confirm that TZ data is in sync
cf14cc4ee0de8c3e4f9a1dab7a5a91d09264dee9 27-Mar-2015 Neil Fuller <nfuller@google.com> Add a test to confirm that TZ data is in sync

Android has two sources of timezone data: one used by
bionic / libcore code, and one used by ICU.

When ICU4J is added more tests can be added to confirm
that ICU4C and ICU4J agree on time zone and other sources
of data like CLDR and the ICU version itself.

Bug: 19941636
Change-Id: I614392a876e19a55e362489f142eec71beaf5547
cu/ICU.java
317d6e12782e069e4fde06ed0f9a976a7c49f580 02-Mar-2015 Neil Fuller <nfuller@google.com> Changes to enable timezone data overrides for ICU and libcore

Bug: 19941636
Change-Id: Id587be99f645978c2e1067c9f8eef26d6d63ec27
til/ZoneInfoDB.java
0ef094df66003f6409d9e43f9087922367a7f10f 25-Mar-2015 Alex Klyubin <klyubin@google.com> am d92eaa4a: am 1e342670: Merge "Add libcore.net.NetworkSecurityPolicy."

* commit 'd92eaa4a580d86051f8174b1992c40f55df6e56a':
Add libcore.net.NetworkSecurityPolicy.
1e342670cc46445bd51d53f7a28f95d1eb879c9f 25-Mar-2015 Alex Klyubin <klyubin@google.com> Merge "Add libcore.net.NetworkSecurityPolicy."
ab33a6ecad274f7d52ab8c9b1292083a1d60d452 25-Mar-2015 Neil Fuller <nfuller@google.com> am fc23db65: am 74b6f466: Merge "Fix for ftp:// invalid urls with ProxySelector"

* commit 'fc23db65f41c887963ce754e3a2cd350d5dad8e8':
Fix for ftp:// invalid urls with ProxySelector
74b6f466628962e30e54dd4ead69ffe2a1ef8ee2 25-Mar-2015 Neil Fuller <nfuller@google.com> Merge "Fix for ftp:// invalid urls with ProxySelector"
2fcad83e4077f80ff710fba33d2ff18dfe3a027e 23-Mar-2015 Neil Fuller <nfuller@google.com> Fix for ftp:// invalid urls with ProxySelector

There are currently no tests for FtpURLConnection. Future
commits are planned that add tests that are based on the
MockFTPServer open-source project.

Thanks to pk.samson@ for the report.

Bug: https://code.google.com/p/android/issues/detail?id=160725
Change-Id: I54fc2d5825f4e1b9681d537dd2c92b90659be5b5
et/url/FtpURLConnection.java
2f4d25190a7d2cc8328a202417ca9077a02e6d9a 23-Mar-2015 Alex Klyubin <klyubin@google.com> Add libcore.net.NetworkSecurityPolicy.

This hidden libcore API is to be used by bundled network stacks to
determine whether cleartext network traffic is permitted. These stacks
cannot directly use the public Android framework API
android.security.NetworkSecurityPolicy because the framework package
typically compile-time depends on the packages offering these bundled
network stacks.

As an example, this CL makes java.util.logging.SocketHandler and
platform-provided URLConnection instances for the FTP protocol honor
this new flag.

To avoid duplication, the intention is that framework's
android.security.NetworkSecurityPolicy implementaion will switch to
this new libcore API to store/retrive the state of framework's
NetworkSecurityPolicy class.

Bug: 19215516
Change-Id: I78e348458975d69c52918582a43db25df87e2a15
et/NetworkSecurityPolicy.java
et/url/FtpURLConnection.java
f7671fb02097a4610b03a4b045b54d8f06053e56 24-Mar-2015 Tao Bao <tbao@google.com> am 94cc3faf: am 61ac7408: Merge "Fix the year display when formatting absolute date string"

* commit '94cc3fafd50df1d5ab0fdb141db2e260efdc7831':
Fix the year display when formatting absolute date string
af695ad46bc26b306dc1c1640663c358adeb430f 23-Mar-2015 Tao Bao <tbao@google.com> Fix the year display when formatting absolute date string

In getRelativeDateTimeString(), when formatting the absolute date string
with formatDateRange(), we need to explicitly specify the option to
show / hide the year display based on the given arguments. Otherwise it
would determine based on the current time and may gave wrong results.

In getRelativeTimeSpanString(), it follows the same logic when user
doesn't supply any option.

Bug: 19822016
Change-Id: I0d4f01b7d15e0b8ea44f21b77309b1fc370b365b
cu/RelativeDateTimeFormatter.java
f32af0622e86f019f630e6a592204afc025336f7 16-Mar-2015 Narayan Kamath <narayan@google.com> Merge "Use uppercase for hex encoded strings."
8c704b4fa9f072cc074897b99ea8f71a02757f33 16-Mar-2015 Narayan Kamath <narayan@google.com> Use uppercase for hex encoded strings.

For backwards compatibility with the apache code this is replacing.
Several callers compare encoded strings for byte equality.

bug: 19731588
Change-Id: I2e96abcabd69ba6d48d341eafe1f8075fff880ee
til/HexEncoding.java
a8b7587c5001db3489c64ac1d16c254a683f76bd 11-Mar-2015 Lorenzo Colitti <lorenzo@google.com> Add a version of sendto that takes a SocketAddress.

Only the byte[] version for now. The ByteBuffer version will be
added later.

Bug: 19704592
Change-Id: I35c5f305b5828ff3315e42aae72aa4b01839e2fc
o/ForwardingOs.java
o/Os.java
o/Posix.java
8f5b46d72e5c1b1b1dd4357580c4fb5a60e3f4de 26-Jan-2015 Erik Kline <ek@google.com> Add support for netlink sockets and addresses.

Additionally:
- support bind and connect calls with SocketAddresses
- getsockname and getpeername can return a NetlinkSocketAddress

Developed in conjunction with:
https://android-review.googlesource.com/135490

Bug: 18581716
Change-Id: I760a06cdb9bdb26c734fb02cf668a94de982e2b6
o/ForwardingOs.java
o/Os.java
o/Posix.java
12f5c69e074d6ef012706068416f0a61b70b4e52 27-Jan-2015 Narayan Kamath <narayan@google.com> Implement zip64 support for ZipFile/ZipInputStream/ZipOutputStream.

There are several open questions that I hope to resolve in future
changes :

- Our heuristics for detecting whether a zip outputstream should
switch over to zip64 or not are imprecise.

- Also, given that we now officially support zip64, we have to assume
new entries whose size is unknown need the zip64 header / footer.
This will make output files slightly larger and less compatible with
older tools. If we don't do this, we'll have to go back and rewrite &
compact parts of the stream we'd already flushed, which isn't always
possible. The other option is to assume zip32 for streams of unknown
length and throw if more than 4G of data is written to them.

Change-Id: Ibb4a97b5f83fd3ab850d7c407ecfda663968a6b9
til/CountingOutputStream.java
7bcff480531c1aa18de118c6f36dd397d5e1ad86 07-Feb-2015 Tao Bao <tbao@google.com> Use ICU for relative time formatting

Rewrite the DateUtils' relative time formatting APIs
(getRelativeTimeSpanString, getRelativeDateTimeString) to use ICU ones.
Two APIs that take withPreposition parameter are not changed. Because
(a) ICU doesn't provide functionality to format preposition; (b) They
are not really computing relative time but instead calling
formatDateRange() to get the absolute time/date string.

Benchmark results on aosp_hammerhead-userdebug:

before:
benchmark us linear runtime
DateUtils_getRelativeDateTimeString 127.1 ==========================
DateUtils_getRelativeDateTimeString_ABBREV 145.0 ==============================
DateUtils_getRelativeTimeSpanString 28.0 =====
DateUtils_getRelativeTimeSpanString_ABBREV 27.9 =====

now:
benchmark us linear runtime
RelativeDateTimeFormatter_getRelativeDateTimeString 119.2 ==========================
RelativeDateTimeFormatter_getRelativeDateTimeString_ABBREV 133.8 ==============================
RelativeDateTimeFormatter_getRelativeTimeSpanString 24.6 =====
RelativeDateTimeFormatter_getRelativeTimeSpanString_ABBREV 24.7 =====

Bug: 19146457
Bug: 5252772
Change-Id: Ief74608354964a17e42191d7b1a58964f3a9acfd
cu/DateIntervalFormat.java
cu/RelativeDateTimeFormatter.java
30c669166d86d0bd133edfb67909665fb41d29b6 16-Jan-2015 Narayan Kamath <narayan@google.com> Remove fcntlLong, use fcntlInt for F_SETFD instead.

fcntlLong works too, but only because of the syscall conventions
happen to place the lower 32 bits of our jlong in the right register.

This change also gets rid of fcntlLong because there aren't any
documented fcntl calls that take a 64 bit integer argument.

Change-Id: I8d187d5b906195fc663675a07a5f116dcd210d16
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
c8d9ea662de6f4856b28907b4119087cfc5a44d2 16-Jan-2015 Narayan Kamath <narayan@google.com> Add fcntlInt.

Hidden for now, for use from the frameworks.

Change-Id: I30d95b28ecbc422aaa5bf28fb2f288c3ca026493
o/ForwardingOs.java
o/Os.java
o/Posix.java
160fad7d429f32c4a6b9f1ac6bb028f59e736f46 09-Jan-2015 Elliott Hughes <enh@google.com> More FileDescriptor.isSocket cleanup.

Rename isSocket to isSocket$ since it's public @hide.

Make isSocket$ final, even though the class is final, so it's obvious from
grep that you can't accidentally override this. (The other public @hide
methods in this class were already explicitly marked final.)

Change-Id: I90563ca567857fa7d38b7ee8006f8abe6ca2db9a
o/BlockGuardOs.java
139d9d8617b95e00c8628379ed7c405f7a316152 06-Jan-2015 Neil Fuller <nfuller@google.com> Avoid a type conversion during comparison

Tiny change after commit 2237a9d0ea59928f8852c9f599bdd9a6930e727d
to compare a long with a long.

Change-Id: Iaba2d7246295f3f23c760fe72195136208a95933
til/ZoneInfo.java
2237a9d0ea59928f8852c9f599bdd9a6930e727d 29-Dec-2014 Narayan Kamath <narayan@google.com> Fix integer overflow issue in ZoneInfo.

The least messy fix is to change mTransitions to long[] despite
the underlying tzdata being ints. This leads to neater code than
comparing the unix time (as a long) against the first and last
element of the transitions array.

bug: 18839557

Change-Id: Ife562749e8b2160f664d566a0a2aae14a0aea36e
til/ZoneInfo.java
787a462136f0789b4fb523c10b9ea4e582aab736 27-Dec-2014 Miklos Vajna <vmiklos@vmiklos.hu> MimeUtils: add ODF presentation (template)

If ODF text, spreadsheet and graphics is there, then leaving out
presentation makes little sense.

Change-Id: Ice81f480a751537d757a33bae4de94c0b6097daf
Signed-off-by: Miklos Vajna <vmiklos@vmiklos.hu>
et/MimeUtils.java
b5997f4ae09a2bef28cea85cac69897a252ec38c 21-Nov-2014 Deepanshu Gupta <deepanshu@google.com> Create GregorianCalendar via a delegate.

GregorianCalendar has a minimum-cost constructor that is not available
on the host. This change wraps the call to that constructor in a static
method that LayoutLib can replace.

Bug: http://b.android.com/79160

(cherry picked from commit 8edeef21e47c2fd104fc6e1c8b26fc913945e0b9)

Change-Id: I6cfdf2e4401dfb02efca3a41d61cd474b58da850
til/ZoneInfo.java
35b10b445782451536ced17fc77c21f852313f3f 18-Dec-2014 Elliott Hughes <enh@google.com> Merge "Add various system calls needed by the zygote."
76856264805ab780ed1437a900c84983b2008805 17-Dec-2014 Sungmin Choi <sungmin.choi@lge.com> Add hwp to MimeUtils map.

Bug: 18788282
Change-Id: I9e28278eae3812387440dbfce196a20c32e24b30
et/MimeUtils.java
8f0f2ac7fcd8f366a78cc51181d065ab93385e46 17-Dec-2014 Elliott Hughes <enh@google.com> Add various system calls needed by the zygote.

Bug: 18719692
Change-Id: I91a943369bc3b331e7e06e758f729b008c3c041c
o/ForwardingOs.java
o/Os.java
o/Posix.java
9620c65214b3dd47cf9fc73aa332050ea9f4bcc9 17-Dec-2014 Elliott Hughes <enh@google.com> Merge "Fix poll to never return EINTR."
fa542091e45db699a937c5ac0191194405107827 16-Dec-2014 Elliott Hughes <enh@google.com> Fix poll to never return EINTR.

Bug: 18759467
Change-Id: Ia5b97a55318b5990ad6b80d15641223aa4fb06f5
o/IoBridge.java
a11b70d5ec690dbedd9087fb3b25d7d65d865eb4 16-Dec-2014 Narayan Kamath <narayan@google.com> Add a hidden API for detecting response charsets.

This is meant to be a partial replacement for apache's
EntityUtils.toString for internal callers. Providing a stand
in replacement seems like a bad idea because that API tries
to coerce all responses into strings, even those that are
binary.

I'm torn about EntityUtils. It was a useful "utility" in some
cases, but dangerous in others.

bug: 18027885
Change-Id: Ia02ffe86b5ef5caecbe86069967a549ff09335e5
et/http/ResponseUtils.java
8f090052bdddc1312fe9238eca702c4e8eafff11 16-Dec-2014 Narayan Kamath <narayan@google.com> Merge "Repurpose "HexEncoding" for internal users."
11f82d1a94ebe1becb7e7d09dd3343ce117bdd46 15-Dec-2014 Narayan Kamath <narayan@google.com> Repurpose "HexEncoding" for internal users.

Frameworks callers either roll their own or use an internal apache
class. Given that apache is going away, we need to provide them with
an alternative.

bug: 18027885
Change-Id: Iec01cba9f3d2027828457c0b450eac0dd08fcaf6
til/HexEncoding.java
d9f7e57f5d09b587d8c8d1bd42b895f7de8fbf54 09-Dec-2014 Narayan Kamath <narayan@google.com> Update ByteBuffer positions in Posix.* functions.

Also add tests in libcore.io.OsTest and update (and simplify)
callers that were updating the position themselves.

bug: 18641009

(cherry picked from commit f3b61eaf1931ae8393e54202a717334a4971ebdf)

Change-Id: I8a810b2dfde7c13278807381bdfe7f532a3481a0
o/Posix.java
0d8b5c3692c36837d22c4e7d9c4d7d95f6a10235 12-Dec-2014 Elliott Hughes <enh@google.com> Add pipe2 and O_CLOEXEC to the libcore POSIX API.

@hide right now, but we should expose these at some point.

Bug: 18719692
Change-Id: I0a73606cf089ed307d1ab2916a7df28b3c45aaf0
o/ForwardingOs.java
o/Os.java
o/Posix.java
7da22a29061da1553687258af71373417f2ae196 11-Dec-2014 Ben Murdoch <benm@google.com> Add epub to MimeUtils map.

Bug: 18414102
Change-Id: Ie36f33e0cef04133ddb521d1672d3061cc2197bd
et/MimeUtils.java
f3b61eaf1931ae8393e54202a717334a4971ebdf 09-Dec-2014 Narayan Kamath <narayan@google.com> Update ByteBuffer positions in Posix.* functions.

Also add tests in libcore.io.OsTest and update (and simplify)
callers that were updating the position themselves.

bug: 18641009

Change-Id: Ie0bbde767489eec1a6ef0158f2b14853d4612f18
o/Posix.java
03b79550c467db9def68ac68244082ff1f242e93 04-Dec-2014 Deepanshu Gupta <deepanshu@google.com> am 04704e37: am 8edeef21: Create GregorianCalendar via a delegate.

* commit '04704e37a20e6992e64583822b91d325d83aee48':
Create GregorianCalendar via a delegate.
99a0c82619a88c6aea038757cf14090f5d33afeb 27-Nov-2014 Neil Fuller <nfuller@google.com> Fix crash in selector.wakeup() with closed selector

Selector.wakeup() can throw an undeclared IOException
(from native code).

This is not compatible with the signature of wakeup(). In prior
Android releases no exception is thrown in this case.

This change reverts the behavior to the same as prior Android
releases.

Many thanks to diddysbestbud@ for the report.

Bug: https://code.google.com/p/android/issues/detail?id=80785
Bug: 18548071
(cherry picked from commit 1791f6be1bd2733babb0c862ad8509f4c847b48f)

Change-Id: I19ee879dcd783655d8a402e12855a5fa1f1eb90c
o/ForwardingOs.java
o/Os.java
o/Posix.java
1791f6be1bd2733babb0c862ad8509f4c847b48f 27-Nov-2014 Neil Fuller <nfuller@google.com> Fix crash in selector.wakeup() with closed selector

Selector.wakeup() can throw an undeclared IOException
(from native code).

This is not compatible with the signature of wakeup(). In prior
Android releases no exception is thrown in this case.

This change reverts the behavior to the same as prior Android
releases.

Many thanks to diddysbestbud@ for the report.

Bug: https://code.google.com/p/android/issues/detail?id=80785
Bug: 18548071
Change-Id: I5421e8a0ae1fdf2cde9cb635dae56b4fd02b6ac4
o/ForwardingOs.java
o/Os.java
o/Posix.java
8edeef21e47c2fd104fc6e1c8b26fc913945e0b9 21-Nov-2014 Deepanshu Gupta <deepanshu@google.com> Create GregorianCalendar via a delegate.

GregorianCalendar has a minimum-cost constructor that is not available
on the host. This change wraps the call to that constructor in a static
method that LayoutLib can replace.

Bug: http://b.android.com/79160
Change-Id: I44a6557a048d1239a514eac38634cd0a887302c9
til/ZoneInfo.java
a553773d208f874df5f94a79eec1e3a9d3fa3407 19-Nov-2014 Elliott Hughes <enh@google.com> Improve backward compatibility of plurals formatting.

icu4c's behavior changed such that it now looks at the absolute value of the
input. For now, preserve compatibility by treating all negative numbers as
being case OTHER.

Bug: 18429565
Bug: https://code.google.com/p/android/issues/detail?id=78962

(cherry picked from commit 099eddad18ef2fff2b995f661b8abde2d35fd539)

Change-Id: I230210bb875cdc3c393db45fbdc347bc3486338b
cu/NativePluralRules.java
099eddad18ef2fff2b995f661b8abde2d35fd539 19-Nov-2014 Elliott Hughes <enh@google.com> Improve backward compatibility of plurals formatting.

icu4c's behavior changed such that it now looks at the absolute value of the
input. For now, preserve compatibility by treating all negative numbers as
being case OTHER.

Bug: 18429565
Bug: https://code.google.com/p/android/issues/detail?id=78962
Change-Id: I1e98af973f408c8809071c15d07d4fd585d77e4c
cu/NativePluralRules.java
47f356d012543f359b0a23d3838337d9c457de34 17-Nov-2014 Elliott Hughes <enh@google.com> Merge "Prefer "jpg" over "jpeg" as the extension for "image/jpeg"."
9a9c59af7f1003f6e35ce060482eefda40b380f1 15-Nov-2014 Elliott Hughes <enh@google.com> Prefer "jpg" over "jpeg" as the extension for "image/jpeg".

Bug: 18390752

(cherry picked from commit 2a63032eb1c020ad3e73177951142735e11e044e)

Change-Id: I713930b8ad8d8a1353d289c1f9268159c3ad862d
et/MimeUtils.java
7c22337691326a03386e42a32becbeb2c2dc7f06 14-Nov-2014 Narayan Kamath <narayan@google.com> Set random seeds post fork.

Gets rid of static Random objects from various classes and
makes them use Math.random instead. Also add hidden APIs to
set the random seed post fork (where we're single threaded).

This has the nice side effect of fixing a performance bug
related to linpack (11388705) where threads were serializing
on Math.class while calling Math.random.

bug: https://code.google.com/p/android/issues/detail?id=79143
bug: 11388705
Change-Id: Ide3a7d17fe855a8086601348be87a890e4c42ab4
o/IoUtils.java
2a63032eb1c020ad3e73177951142735e11e044e 15-Nov-2014 Elliott Hughes <enh@google.com> Prefer "jpg" over "jpeg" as the extension for "image/jpeg".

Bug: 18390752
Change-Id: Iaffa75629a7b618dd8809416934733e7314bf820
et/MimeUtils.java
a4403d98e8aba592195fe2558fa945110d0ed052 29-Oct-2014 Elliott Hughes <enh@google.com> am 1cb912c5: Merge "Disable tzdata in ."

* commit '1cb912c53ccaeaa886e6838c5e45aec233777932':
Disable tzdata in $ANDROID_DATA.
7983bf0702c7029120ffe4ac4dc6194388098722 27-Oct-2014 Elliott Hughes <enh@google.com> Disable tzdata in $ANDROID_DATA.

(cherry picked from b0edf66dfcb330e64ae50b8430a0849d4a819774.)

Bug: 18139284
Change-Id: I87d52e4f5bf18692a47c762fb4155ba68beffae2
til/ZoneInfoDB.java
2d506ea5df7d7acc7aa6d13db07b63fc2a4ed15c 28-Oct-2014 Elliott Hughes <enh@google.com> am 026194b8: Merge "Remove no-longer used timeFormat12 and timeFormat24."

* commit '026194b8948b75b70fe035e3008cd5288e62badb':
Remove no-longer used timeFormat12 and timeFormat24.
aefa568bcd74855edd0d5998107d2402582c5f31 28-Oct-2014 Elliott Hughes <enh@google.com> am fbcc49e3: Merge "Wire up frameworks notifications of 12/24 hour preferences."

* commit 'fbcc49e3f15856bfcf8965772151161671443b7e':
Wire up frameworks notifications of 12/24 hour preferences.
b0edf66dfcb330e64ae50b8430a0849d4a819774 27-Oct-2014 Elliott Hughes <enh@google.com> Disable tzdata in $ANDROID_DATA.

Bug: 18139284
Change-Id: I87d52e4f5bf18692a47c762fb4155ba68beffae2
til/ZoneInfoDB.java
d8aa6c7b03fdb0247ae5cce6dd0e876346276a73 23-Oct-2014 Elliott Hughes <enh@google.com> Remove no-longer used timeFormat12 and timeFormat24.

Bug: 10361358
Change-Id: I500318537b503d6ffbbd18a4aa772527c4b96e74
cu/LocaleData.java
0836eb6118ddedbfe420b5d6ff98f07adf5a5d23 22-Oct-2014 Elliott Hughes <enh@google.com> Wire up frameworks notifications of 12/24 hour preferences.

Bug: 10361358

(cherry picked from commit cafe1a748caf89091d2f1c3956a43daf23b9403b)

Change-Id: I2629bbad0737bc5836afa7cfe4a9667095df0357
cu/LocaleData.java
cafe1a748caf89091d2f1c3956a43daf23b9403b 22-Oct-2014 Elliott Hughes <enh@google.com> Wire up frameworks notifications of 12/24 hour preferences.

Bug: 10361358
Change-Id: I62ffdc987e55bca70889f611c2e5c5c91a650bd9
cu/LocaleData.java
fa1ab1d7aaa558994815d217d4eeca7e07ff57b3 09-Oct-2014 Elliott Hughes <enh@google.com> Support DecimalFormatSymbols' percent symbol being a string.

Bug: 15476051

(cherry picked from commit a68116c0d8ff9cd517d6b765bf2b8930ed9a3e12)

Change-Id: I70ff647dd20b263596685598186ee2f55e1ef8fa
cu/LocaleData.java
cu/NativeDecimalFormat.java
fcc19aa354bd202f1c7064b8ceb5e56f30c12162 09-Oct-2014 Elliott Hughes <enh@google.com> am a96d6871: Merge "Support DecimalFormatSymbols\' percent symbol being a string."

* commit 'a96d6871503966e8589ee8d929acc68ee1e4d59c':
Support DecimalFormatSymbols' percent symbol being a string.
a68116c0d8ff9cd517d6b765bf2b8930ed9a3e12 09-Oct-2014 Elliott Hughes <enh@google.com> Support DecimalFormatSymbols' percent symbol being a string.

Bug: 15476051
Change-Id: I75514c497f18366b2e1320ea6a62df025a50114f
cu/LocaleData.java
cu/NativeDecimalFormat.java
7c7be268b915c9bbc8c483e309a12708dd63643f 03-Sep-2014 Neil Fuller <nfuller@google.com> libcore changes to support ConnectionPool cache flushing

A set of observer / listener components for network
events.

Party A, e.g. the Android ConnectivityManager, can make
changes to network configuration that impacts the java
network objects (e.g. connection pools, caches, etc.).

Party B, e.g. Android libcore network components are
interested in network configuration changes.

The NetworkEventDispatcher enables Party A to communicate
with Party B without hardcoding their details. Additional
parties like B can be added.

Bug: 17314604
(cherry-picked from commit b1e60e2015b81c285938ca569b66edda63d6533d)

Change-Id: Ie0d0a8afe14e6a15253ce72f1abf9b996176e02f
et/event/NetworkEventDispatcher.java
et/event/NetworkEventListener.java
788b5e43bc025b6aaa144e6483c744729528e79b 12-Sep-2014 Neil Fuller <nfuller@google.com> Fix ZoneInfo.useDaylightTime()

Currently implemented is "are there any offset transitions
in the future?".
This is wrong: Transitions may occur in the future because
of DST, but can also occur for other reasons (e.g. if the
raw offset for a zone changes).

We should be implementing: Is the currently active transition,
or any transition in the future, one that has
isDst == true.

This was causing a test failure in
libcore.java.util.TimeZoneTest#testDisplayNames
for Asia/Novokuznetsk and Europe/Simferopol for
tzdata2014g. This is because they have a transition entry
for October 26, 2014 (i.e. in the future).

For each, the existance of the transition entry is not
due to an offset change at all:
For Asia/Novokuznetsk it is because the abbreviation
for the zone changes on that date (information we don't
curently use).
For Europe/Simferopol it is because the offset from
UTC changes on that date (but there is no actual DST
transtion).

Bug: 17377276

(cherry-picked from commit d42af6ed0fec3cfca52912b0d8b3b459e72be4b4)

Change-Id: I148503280b8dee653bac32eec3aa58d232102628
til/ZoneInfo.java
d42af6ed0fec3cfca52912b0d8b3b459e72be4b4 12-Sep-2014 Neil Fuller <nfuller@google.com> Fix ZoneInfo.useDaylightTime()

Currently implemented is "are there any offset transitions
in the future?".
This is wrong: Transitions may occur in the future because
of DST, but can also occur for other reasons (e.g. if the
raw offset for a zone changes).

We should be implementing: Is the currently active transition,
or any transition in the future, one that has
isDst == true.

This was causing a test failure in
libcore.java.util.TimeZoneTest#testDisplayNames
for Asia/Novokuznetsk and Europe/Simferopol for
tzdata2014g. This is because they have a transition entry
for October 26, 2014 (i.e. in the future).

For each, the existance of the transition entry is not
due to an offset change at all:
For Asia/Novokuznetsk it is because the abbreviation
for the zone changes on that date (information we don't
curently use).
For Europe/Simferopol it is because the offset from
UTC changes on that date (but there is no actual DST
transtion).

Bug: 17377276
Change-Id: Ie81bae91baf38e99516bafed39028842af03c07a
til/ZoneInfo.java
1aec38412faac75e65e65ea6a128768a8e513ebe 09-Sep-2014 Neil Fuller <nfuller@google.com> Merge "libcore changes to support ConnectionPool cache flushing" into lmp-dev
b1e60e2015b81c285938ca569b66edda63d6533d 03-Sep-2014 Neil Fuller <nfuller@google.com> libcore changes to support ConnectionPool cache flushing

A set of observer / listener components for network
events.

Party A, e.g. the Android ConnectivityManager, can make
changes to network configuration that impacts the java
network objects (e.g. connection pools, caches, etc.).

Party B, e.g. Android libcore network components are
interested in network configuration changes.

The NetworkEventDispatcher enables Party A to communicate
with Party B without hardcoding their details. Additional
parties like B can be added.

Bug: 17314604
Change-Id: I175bdf28662bafcf0c91acb51a3da5cbc2b69086
et/event/NetworkEventDispatcher.java
et/event/NetworkEventListener.java
65326f8cdeac2d85e5f714c4a01fb81a084d02f7 06-Aug-2014 Piotr Jastrzebski <haaawk@google.com> Implement equals and hashCode in ParameterizedTypeImpl

and GenericArrayTypeImpl.

Bug: 14590652
Bug: https://code.google.com/p/android/issues/detail?id=74060

(cherry picked from commit c7dede2138e5b122cb1011a355e4f9f8e6d37856)

Change-Id: I5b95f816e0596ca6f51dce5959433dc70b2c297d
eflect/GenericArrayTypeImpl.java
eflect/ParameterizedTypeImpl.java
a2d5686d00aeb79860ae4ac979ee3c1766c7e6d3 23-Aug-2014 Elliott Hughes <enh@google.com> Rearrange a few of our MIME type registrations.

Based on looking at IANA and wikipedia.

Bug: 16978217

(cherry picked from commit 93235f904ce83fe138c90a90c66d0e78f9f405b8)

Change-Id: I272436facd3c2f5dbc8c455fc340293b83f98453
et/MimeUtils.java
8f3b150cd86c2eb35229806fda6928501da27cac 26-Aug-2014 Elliott Hughes <enh@google.com> Keep qtaguid quiet by not trying to untag non-sockets.

(cherry-pick of f6cf9efb212e572dcd2e902ca461af6323793dbf.)

Bug: 17203955
Change-Id: I0999fc0ff295986b92e31568d96e321b9e7ffb2c
o/BlockGuardOs.java
f6cf9efb212e572dcd2e902ca461af6323793dbf 26-Aug-2014 Elliott Hughes <enh@google.com> Keep qtaguid quiet by not trying to untag non-sockets.

Bug: 17203955
Change-Id: I0999fc0ff295986b92e31568d96e321b9e7ffb2c
o/BlockGuardOs.java
93235f904ce83fe138c90a90c66d0e78f9f405b8 23-Aug-2014 Elliott Hughes <enh@google.com> Rearrange a few of our MIME type registrations.

Based on looking at IANA and wikipedia.

Bug: 16978217
Change-Id: I0d28c6d53ec26c7d5501f722b66dd50595e2a6b4
et/MimeUtils.java
b799123bc221b926a9f189107f2a3619a4da8874 22-Aug-2014 Elliott Hughes <enh@google.com> Support narrow am/pm markers in LocaleData.

(cherry-pick of ebe417d7808ac5bce5bc14d36d6af4c31218326d.)

Bug: 16938600
Change-Id: I7334c1ea57ea0593b3e0bd7943f8a5208c704881
cu/LocaleData.java
ebe417d7808ac5bce5bc14d36d6af4c31218326d 22-Aug-2014 Elliott Hughes <enh@google.com> Support narrow am/pm markers in LocaleData.

Bug: 16938600
Change-Id: I7334c1ea57ea0593b3e0bd7943f8a5208c704881
cu/LocaleData.java
4781e999a945a5c44778b60166cde5a8b65c1c02 15-Aug-2014 Elliott Hughes <enh@google.com> Merge "Avoid triggering StrictMode when closing a socket." into lmp-dev
d636777d624428dfc51d1181f47602f389eb4cce 15-Aug-2014 Elliott Hughes <enh@google.com> Avoid triggering StrictMode when closing a socket.

Originally, we called getsockoptLinger unconditionally, using ENOTSOCK
to recognize the non-socket case, but the cost of throwing an exception
is so high (both on dalvik and art) that we worked around that by doing
an fstat first. This was mostly fine, but fstat calls onReadFromDisk,
which isn't true for the socket case (which causes upset for threads
that are allowed to touch the network but not allowed to touch disk,
which Chrome uses, even though it's not immediately obvious to me why
that makes any sense).

Bug: 4972558
Bug: 12133112
Change-Id: Ic0b89d1f181e436b4f43c1c04c1f706883ab84c0
o/BlockGuardOs.java
88ea8271db2936989654f50af16737b2323f27ac 15-Aug-2014 Elliott Hughes <enh@google.com> Avoid triggering StrictMode when closing a socket.

Originally, we called getsockoptLinger unconditionally, using ENOTSOCK
to recognize the non-socket case, but the cost of throwing an exception
is so high (both on dalvik and art) that we worked around that by doing
an fstat first. This was mostly fine, but fstat calls onReadFromDisk,
which isn't true for the socket case (which causes upset for threads
that are allowed to touch the network but not allowed to touch disk,
which Chrome uses, even though it's not immediately obvious to me why
that makes any sense).

(cherry-pick of d636777d624428dfc51d1181f47602f389eb4cce.)

Bug: 4972558
Bug: 12133112
Change-Id: Ic0b89d1f181e436b4f43c1c04c1f706883ab84c0
o/BlockGuardOs.java
e4f01dff49442840faa828dcff0d1583a2e68530 12-Aug-2014 Narayan Kamath <narayan@google.com> Allow Calendar.getInstance to be called with a null Locale.

LocaleData.get was changed to throw for null locales instead
of falling back to the default, so we need to adjust callers
accordingly.

Turns out all other callers would've thrown anyway (for different
reasons) so this change makes those exceptions explicit and
adds tests for them.

bug: 16938922

(cherry picked from commit 148de94b69ad9ed98ebb1adf0e8eb1b1e9e33e1f)

Change-Id: Id89961c9b9524776ef13f57d97b2bb73e19b4eb1
cu/LocaleData.java
148de94b69ad9ed98ebb1adf0e8eb1b1e9e33e1f 12-Aug-2014 Narayan Kamath <narayan@google.com> Allow Calendar.getInstance to be called with a null Locale.

LocaleData.get was changed to throw for null locales instead
of falling back to the default, so we need to adjust callers
accordingly.

Turns out all other callers would've thrown anyway (for different
reasons) so this change makes those exceptions explicit and
adds tests for them.

bug: 16938922
Change-Id: I3e77435a6b414b002b96a4f8deb44b51591c5a51
cu/LocaleData.java
065d7764ac1dfe74ee94d17ca6c810de37b57d3e 11-Aug-2014 Elliott Hughes <enh@google.com> Fix TimeZone.getAvailableIDs(int).

This was broken by the removal of the pre-computed raw offsets from
the tzdata file. I think that's still the direction we want to go (with
us hopefully using more of icu4j at some point, and eventually relying
solely on the icu time zone data), so this patch adds code to lazily
evaluate all the offsets by instantiating all the time zones.

Bug: 16947622
Change-Id: I6d1dfe5ee6c99338f9807c3af5b6f04539c256c3
til/ZoneInfoDB.java
249a29f9e33e742c101ff5138ba56034ab2e5bf9 11-Aug-2014 Elliott Hughes <enh@google.com> Fix TimeZone.getAvailableIDs(int).

This was broken by the removal of the pre-computed raw offsets from
the tzdata file. I think that's still the direction we want to go (with
us hopefully using more of icu4j at some point, and eventually relying
solely on the icu time zone data), so this patch adds code to lazily
evaluate all the offsets by instantiating all the time zones.

(cherry-pick of 065d7764ac1dfe74ee94d17ca6c810de37b57d3e.)

Bug: 16947622
Change-Id: I6d1dfe5ee6c99338f9807c3af5b6f04539c256c3
til/ZoneInfoDB.java
c7dede2138e5b122cb1011a355e4f9f8e6d37856 06-Aug-2014 Piotr Jastrzebski <haaawk@google.com> Implement equals and hashCode in ParameterizedTypeImpl

and GenericArrayTypeImpl.

Bug: 14590652
Bug: https://code.google.com/p/android/issues/detail?id=74060
Change-Id: Ib9a30b741a8d5f82d21f37ca8959bf5b2893f8db
eflect/GenericArrayTypeImpl.java
eflect/ParameterizedTypeImpl.java
a551992765186ad72cebe76a63cbefc7c6b188d7 05-Aug-2014 Elliott Hughes <enh@google.com> Merge "Fix MimeUtils to treat ".flac" as "audio/flac"." into lmp-dev
77926e913a14b9541df38b6175f795f2ca6c5266 05-Aug-2014 Elliott Hughes <enh@google.com> Fix MimeUtils to treat ".flac" as "audio/flac".

Bug: 15715370
Change-Id: I2d99f070c3debea01621a172d8189951a56736b5
et/MimeUtils.java
ad257e4fe66970482f8ba391982058bada008dd6 05-Aug-2014 Elliott Hughes <enh@google.com> Fix MimeUtils to treat ".flac" as "audio/flac".

(cherry-pick of 77926e913a14b9541df38b6175f795f2ca6c5266.)

Bug: 15715370
Change-Id: I2d99f070c3debea01621a172d8189951a56736b5
et/MimeUtils.java
2e11dca269a4bf6bb2c36096b0b97d41375b9810 30-Jul-2014 Narayan Kamath <narayan@google.com> Add ICU.addLikelySubtags(Locale).

We don't need a replacement for ICU.getScript(String),
Locale.getScript() can be used instead. The old definition
of the function has been left public for the support library
to use (though we could remove it if we modify the support lib).

Note that addLikelySubtag returns a String that's language tag
like, but uses underscores instead of hyphens to separate
subtags.

bug: 15876704

(cherry picked from commit 9c4462b3d88a36c92d23d4274195e4a7f7a372e5)

Change-Id: I3d2896a94c983e636523664315d09c93839dd9ae
cu/ICU.java
e8f9ba3763c26cc78a7bbc6ea1a00ff5c35d3da7 30-Jul-2014 Michael Wright <michaelwr@google.com> Add FLOAT entry to EmptyArray

(cherry pick from 89237b598da80f7a5308bfa6201c540319ba6199)

Change-Id: I70a591093557ce3dd0471bcc7e888d630c80bb88
til/EmptyArray.java
9c4462b3d88a36c92d23d4274195e4a7f7a372e5 30-Jul-2014 Narayan Kamath <narayan@google.com> Add ICU.addLikelySubtags(Locale).

We don't need a replacement for ICU.getScript(String),
Locale.getScript() can be used instead. The old definition
of the function has been left public for the support library
to use (though we could remove it if we modify the support lib).

Note that addLikelySubtag returns a String that's language tag
like, but uses underscores instead of hyphens to separate
subtags.

bug: 15876704
Change-Id: I6c7d289c4b725a83900e38dd5bbed026afd9ac4e
cu/ICU.java
a644490941292cbd6eb651e4bacf00eaad914489 30-Jul-2014 Elliott Hughes <enh@google.com> Merge "Add FLOAT entry to EmptyArray"
89237b598da80f7a5308bfa6201c540319ba6199 30-Jul-2014 Michael Wright <michaelwr@google.com> Add FLOAT entry to EmptyArray

Change-Id: I70a591093557ce3dd0471bcc7e888d630c80bb88
til/EmptyArray.java
b7d5826277766003e36bb8e82a0c09020fc1c823 17-Jul-2014 Neil Fuller <nfuller@google.com> Support for a android.text.format.Time implemented entirely in Java

(cherry picked from commit 0785676ad838b48512fde6bef58c380daf11994f)
Bug: 15765976

Change-Id: Ic1d32743583539fa03924d1c0c122663f37ac3ac
til/ZoneInfo.java
til/ZoneInfoDB.java
df624c1cc36dc17e4051d1100a3400aeb4252511 25-Jun-2014 Narayan Kamath <narayan@google.com> Fix handling of invalid locales in Date/DecimalFormatSymbols.

For locales whose language code is "und" we use Locale.ROOT
instead. This also fixes two other corner cases :

- We were using the wrong locale to fetch timezone strings
when the input locale was null. we now use the same locale
throughout by making sure we don't perform any subsititutions
in LocaleData.get.

- Adds a clearer comment about the broken serialization
behaviour.

bug: 15849709

(cherry picked from commit 043a1424a4e3bbb5abc9d9e11c9c088b20f4ca7d)

Change-Id: I716fb421fb8643dedebb3a7797a76ed1dd86c548
cu/ICU.java
cu/LocaleData.java
ac89b307fd132d44ac55b9109833730cbc2e86fc 21-Jul-2014 Narayan Kamath <narayan@google.com> Implement Locale.forLanguageTag in java.

This prevents us from having to parse ICU locale IDs
or construct them in java. Note that the changes to
LocaleTest bring us in line with the spec (some of the
previous tests demonstrated wonky ICU4C behaviour we
didn't want).

This change includes a minor fix to unicode extension
parsing, we now accept keywords with empty values which
the spec allows.

bug: 15661724
bug: 15849709

(cherry picked from commit bf098bb6345b0917d645d809f4d703e6a0c904f4)

Change-Id: I9b5417dd32bd758655085a484db071959edb774e
cu/ICU.java
5c0472fd7c53464e526bb833707551d85dbafec1 25-Jun-2014 Narayan Kamath <narayan@google.com> Fix handling of invalid locales in Date/DecimalFormatSymbols.

For locales whose language code is "und" we use Locale.ROOT
instead. This also fixes two other corner cases :

- We were using the wrong locale to fetch timezone strings
when the input locale was null. we now use the same locale
throughout by making sure we don't perform any subsititutions
in LocaleData.get.

- Adds a clearer comment about the broken serialization
behaviour.

bug: 15849709

Change-Id: I95e7eb0ccb7458711038ce9b1c76b3279acda9d6
cu/ICU.java
cu/LocaleData.java
0785676ad838b48512fde6bef58c380daf11994f 17-Jul-2014 Neil Fuller <nfuller@google.com> Support for a android.text.format.Time implemented entirely in Java

Bug: 15765976
Change-Id: Ic743168a54ff96e5403a9c73c27eeb7d482a01dc
til/ZoneInfo.java
til/ZoneInfoDB.java
bf098bb6345b0917d645d809f4d703e6a0c904f4 21-Jul-2014 Narayan Kamath <narayan@google.com> Implement Locale.forLanguageTag in java.

This prevents us from having to parse ICU locale IDs
or construct them in java. Note that the changes to
LocaleTest bring us in line with the spec (some of the
previous tests demonstrated wonky ICU4C behaviour we
didn't want).

This change includes a minor fix to unicode extension
parsing, we now accept keywords with empty values which
the spec allows.

bug: 15661724
bug: 15849709

Change-Id: If9417ab4cb545fdb8b9a0a47a7eade6ebbe33ba8
cu/ICU.java
60226561d5af59bc47ee70a4988633050e6fc62e 17-Jul-2014 Neil Fuller <nfuller@google.com> Add a cache for ZoneInfo objects in Java

This mirrors the single-item cache in localtime.c.

This is in preparation for an upcoming change to migrate
android.format.text.Time over to Java. It will be making
use of the Java ZoneInfo instead of the native
equivalent.

The Java cache has a size of 1 like the bionic one,
though this can easily be increased.

Given the default TimeZone / ZoneInfo was always
pinned, in many cases the memory usage will not
go up noticeably. In scenarios where applications load
timezones besides the default a cache size of 1 potentially
increases pinned memory usage by one ZoneInfo plus
the overhead of the prototype object held by the cache
(which is never returned to callers).

An example ZoneInfo is "Europe/London", which has ~190
transitions (1 int + 1 byte) and ~6 types (1 int + 1 byte).
Overhead of other fields is ~ 13 bytes, plus the ID string.

190 * (4 + 1) + 6 * (4 + 1) + 13 = 993 bytes.

The prototypes held by the cache share the majority of their
memory with their clones returned from
ZoneInfo.makeTimeZone() and so the overhead of introducing
the cache itself should be in the order of a few tens of
bytes at most.

In future we may want to increase the cache size to 2 in
order to support apps that compare / switch timezones to
increase the odds of the default remaining in the cache.
Sizes above 2 look increasingly specialist.

LMP cherry-pick notes: This is a cherry-pick of the final
patch. In master, an original patch was reverted and then
the revert was reverted with an added fix. The comment
above is from the original commit. The fixed version
included:

Contains a fix for when the timezone ID is not found.
This includes a new test.

(cherry picked from d3d39ab8df5c4f6ae663613dc3617ba300282315)

Change-Id: I4c145942b6603e0e62badfd052b5716fd68769d2
til/ZoneInfo.java
til/ZoneInfoDB.java
d3d39ab8df5c4f6ae663613dc3617ba300282315 17-Jul-2014 Neil Fuller <nfuller@google.com> Revert "Revert "Add a cache for ZoneInfo objects in Java""

This reverts commit 01b6a878d10ee68db87c3d85d137e81a5257a78a.

Contains a fix for when the timezone ID is not found.
This includes a new test.

Change-Id: I2e5e669782ea6caf4e97153ed6b63ca6ee4ef50d
til/ZoneInfo.java
til/ZoneInfoDB.java
01b6a878d10ee68db87c3d85d137e81a5257a78a 17-Jul-2014 Neil Fuller <nfuller@google.com> Revert "Add a cache for ZoneInfo objects in Java"

This reverts commit a6e8689807f5a8bb9470ce7c26a47455d2d0608d.

Change-Id: I17a0262d169db3418f2f8888195381f778975dc4
til/ZoneInfo.java
til/ZoneInfoDB.java
a6e8689807f5a8bb9470ce7c26a47455d2d0608d 16-Jul-2014 Neil Fuller <nfuller@google.com> Add a cache for ZoneInfo objects in Java

This mirrors the single-item cache in localtime.c.

This is in preparation for an upcoming change to migrate
android.format.text.Time over to Java. It will be making
use of the Java ZoneInfo instead of the native
equivalent.

The Java cache has a size of 1 like the bionic one,
though this can easily be increased.

Given the default TimeZone / ZoneInfo was always
pinned, in many cases the memory usage will not
go up noticeably. In scenarios where applications load
timezones besides the default a cache size of 1 potentially
increases pinned memory usage by one ZoneInfo plus
the overhead of the prototype object held by the cache
(which is never returned to callers).

An example ZoneInfo is "Europe/London", which has ~190
transitions (1 int + 1 byte) and ~6 types (1 int + 1 byte).
Overhead of other fields is ~ 13 bytes, plus the ID string.

190 * (4 + 1) + 6 * (4 + 1) + 13 = 993 bytes.

The prototypes held by the cache share the majority of their
memory with their clones returned from
ZoneInfo.makeTimeZone() and so the overhead of introducing
the cache itself should be in the order of a few tens of
bytes at most.

In future we may want to increase the cache size to 2 in
order to support apps that compare / switch timezones to
increase the odds of the default remaining in the cache.
Sizes above 2 look increasingly specialist.

Change-Id: I0b7daa8ad5d334c8d421dfaa6e0421d3c181a915
til/ZoneInfo.java
til/ZoneInfoDB.java
d45744281bc05a21aec647fbd2cccdaedf9e1ff1 17-Jun-2014 Elliott Hughes <enh@google.com> Remove more.

(cherry-pick of f39b5ca3c6378c3c36c63889577004b9693ea9c6.)

Change-Id: Idaf030cd369e728ec37df7107cd30062db899b7c
et/url/FileURLConnection.java
et/url/JarURLConnectionImpl.java
5ef6d301b4b9bdb610e0e84960ac81aff3d7605e 27-Jun-2014 Elliott Hughes <enh@google.com> am d6862d90: am a9640416: Merge "Fix a faulty Julian day computation."

* commit 'd6862d909fd177b5bce85aeee600ac47f67af5ce':
Fix a faulty Julian day computation.
a9640416956fac998d3a69ec05ded7eaec80dddf 27-Jun-2014 Elliott Hughes <enh@google.com> Merge "Fix a faulty Julian day computation."
fda7c027e360292edfa4d32fadd2844efaa5f9d7 26-Jun-2014 Elliott Hughes <enh@google.com> Fix a faulty Julian day computation.

The use of Calendar.MILLISECONDS was wrong, as was the use of
ZONE_OFFSET without DST_OFFSET. The existing code pretty much
only works for the values tested in the unit test! This patch
adds new tests to make up for that.

I've also added calls to Calendar.clear to ensure we're not
leaking SECONDS and MILLISECONDS from the Calendar instances (which
get initialized to the current wall clock) into our test values.
This hasn't mattered in the past, but actually does matter here
because tests like isMidnight measure down to the millisecond.

Bug: https://code.google.com/p/android/issues/detail?id=72356
Signed-off-by: jasper tsai <jasper3_tsai@asus.com>
Signed-off-by: hellena shih <hellena_shih@asus.com>
Change-Id: I7d57590a95d3f026bdf1b991e0b1ddb47ba9af37
cu/DateIntervalFormat.java
3b9d704b6ed8668493a1246a9ea1bc30fa8a2e2b 19-Jun-2014 Neil Fuller <nfuller@google.com> am 3019fd32: am c7531024: Merge "Fix for currency symbol coming from the default locale"

* commit '3019fd32394a00d61bc05ce4e7cb3c949f6143ee':
Fix for currency symbol coming from the default locale
b465afc2e95cf8d18b4925854923a41322322d2e 19-Jun-2014 Neil Fuller <nfuller@google.com> am 8c83d2aa: am 2eb56b69: Merge "Fix CurrencyTest.test_getSymbol for unknown variants"

* commit '8c83d2aa1fd7b7e3f9ca7415f9dfdf94de1314ec':
Fix CurrencyTest.test_getSymbol for unknown variants
a1eb5e8aa202df11f7b43d4b3dea74a9cc18229d 18-Jun-2014 Narayan Kamath <narayan@google.com> am 9f4d9667: am cac5dab2: Merge "Fix getISO3Country and getISO3Language."

* commit '9f4d966767bdf4fba4735aacc72d32cbb07fd4fd':
Fix getISO3Country and getISO3Language.
8d07b07a3ed315c2e1c469d3769cf1df3f49e58b 18-Jun-2014 Neil Fuller <nfuller@google.com> Fix for currency symbol coming from the default locale

NumberFormat.setCurrency() (actually DecimalFormat) was using
currency.getSymbol() without passing the format's locale. This
caused the default Locale to be used to look up the symbol.

The fix uses the format locale, not the default. A test has
been added to demonstrate the problem / fix.

To avoid having the NativeDecimalFormat know about the locale class,
the symbol is passed as an argument rather than the Currency object.
This is an internal API.

Making this change showed an issue with Currency.getSymbol():
For Locales without a country the currency code would be returned
and not a symbol.

ICU provides language-level symbols so this was not the best
we could do. Since the code was previously using the default
Locale, and the default locale usually has a country it was
not previously obvious.

testBug71369 broke because of this second issue. The code is also
fixed here.

This was discovered while investigating bug 71369 but is not
related.

Change-Id: If0ce280aefb042fe8f7ca126cced090b9268a866
cu/NativeDecimalFormat.java
280a6d7eff0147bfbabe6d407e68ee911ebcb469 18-Jun-2014 Anwar Ghuloum <anwarg@google.com> am 4aadbe01: Merge "Remove more." into lmp-preview-dev

* commit '4aadbe01b75956c4a1c5af56723e5e6e3da25c47':
Remove more.
2eb56b69de339978a29d94531759b465742f027f 19-Jun-2014 Neil Fuller <nfuller@google.com> Merge "Fix CurrencyTest.test_getSymbol for unknown variants"
1d3d40749170e945b778e74786543520fbe9d14c 17-Jun-2014 Neil Fuller <nfuller@google.com> Fix CurrencyTest.test_getSymbol for unknown variants

The behavior of CurrencyTest.getSymbol has changed since
K for unrecoginzed locales.

Commit de0eb683370d789e7bb25673b350b8dbf2ba5d69 now means
the ICU default locale is set when the Java default locale
is changed. Previously it would have been left unset and
would have fallen back to using the system settings (most
likely US or UK English during tests).

The test is setting the Java default locale to "kr-KR"
(a locale unrecognized by ICU) and requesting the currency
symbol for USD for locale "kr-KR" (still unrecognized by
ICU).

Before the commit: Because the kr-KR argument is unrecognized
ICU tries the ICU default (which was unset and so picked
system setting of en). It returned "$".

After the commit: As above, but now the ICU default is set to
kr-KR. Since there is no entry for USD in the default it falls
back to "root", and returns the value found there: "US$".

Behavior when the default locale is unrecognized is edge-case
and arguably it is no more / less correct before or after
this commit. The test has been updated to reflect
the new value + some tidy up of the test generally.

This change also contains a more focused test that demonstrates
the behavior in ICU and adds documentation to make ICU
slightly clearer.

Arguably neither the new ICUTest nor the existing
CurrencyTest code should exist because they assert edge-case behavior
that Android may wish to change in future.

Bug: 14821275
Change-Id: I8beb6004b0c37d2fe59855d13d2c8e2e6fe1c530
cu/ICU.java
ca6c2dfd21fef61f179223fb710db791802068d5 18-Jun-2014 Narayan Kamath <narayan@google.com> Fix getISO3Country and getISO3Language.

For backward compatibility, locales constructed with 3 letter
countries and languages must return those languages and countries
from these methods. With our strict language tag interpretation, these
were being omitted or transformed to und.

We fix this by passing only the language code (or the country code
with a fixed language) down to ICU, which will then deal with it
correctly.

bug: 15638049

Change-Id: I517a82496a2a4c36b1ae9234f7d2d4eb89b34ffe
cu/ICU.java
f39b5ca3c6378c3c36c63889577004b9693ea9c6 17-Jun-2014 Elliott Hughes <enh@google.com> Remove more.

Change-Id: Idaf030cd369e728ec37df7107cd30062db899b7c
et/url/FileURLConnection.java
et/url/JarURLConnectionImpl.java
324bf991656e86dce9a58c82123d4b0390a393b5 16-Jun-2014 Narayan Kamath <narayan@google.com> am 9e8e91cd: am 67831d38: Merge "Pass BCP-47 tags and not Locale.toString results to ICU."

* commit '9e8e91cd9808d4d5d959743bcd96d2c30b9e9ef4':
Pass BCP-47 tags and not Locale.toString results to ICU.
159973cc791d457defee8538008283277977f23c 12-Jun-2014 Narayan Kamath <narayan@google.com> am 9cf8ea5c: am 92bd303d: Merge "Implement Locale.toLanguageTag without ICU support."

* commit '9cf8ea5cb1870b84de6e77d000ae53d54c828f68':
Implement Locale.toLanguageTag without ICU support.
a94266074c7b82720fd2cecfb37ab8da85f1b296 30-May-2014 Elliott Hughes <enh@google.com> Pass BCP-47 tags and not Locale.toString results to ICU.

ICU can't handle the new toString forms for scripts etc.
and it's also guaranteed to deal with BCP-47 tags correctly.

Most of the changes in this patch are required to keep
backwards compatibility for getDisplayCountry string etc. in
the face of the transformations toLanguageTag performs.

A few tests were changed, but for the better.

The tagalog -> filipino charlie foxtrot will be dealt with
in a follow up change.

Co-Authored-By: Narayan Kamath <narayan@google.com>

Change-Id: Ia7f26d92a0e38c4bbb1d839c0fbd8ad16a473bf5
cu/ICU.java
cu/LocaleData.java
cu/NativeBreakIterator.java
cu/NativeCollation.java
cu/RuleBasedCollatorICU.java
12ca8820818b604c6fc30f025857ec443c83d4a3 11-Jun-2014 Narayan Kamath <narayan@google.com> Implement Locale.toLanguageTag without ICU support.

This is the first part of an effort to avoid having
to construct and parse ICU locale IDs and to instead
use language tags as inputs to all ICU APIs.

Only one minor unit test adjustment was required, and
that change brings the test closer in line with the
spec.

Change-Id: I8abc0e3b868dd73e4fb9e36b6db19853eb99e6ac
cu/ICU.java
3e58734d651080009c9190c7062837fca5c7cf4e 13-May-2014 Paul Jensen <pauljensen@google.com> Add support for network-specific host name resolution.

For now all such support is hidden.

Change-Id: I932f73158a8f6e3ccc36c319d138180dff2aa070
o/ForwardingOs.java
o/Os.java
o/Posix.java
b6f4473fea7e4000bf83a5bd5983afdf91327dc1 12-May-2014 Elliott Hughes <enh@google.com> am 6a3e6cbd: am 8d8da2f6: am 6cb4582b: Merge "Work around an icu4c 53 bug in DecimalFormat.getGroupingSize."

* commit '6a3e6cbdc25f83e755c9590ebed2991c42da1d2d':
Work around an icu4c 53 bug in DecimalFormat.getGroupingSize.
6cb4582b0466e0fc1deff08c3d3a43b59b600703 12-May-2014 Elliott Hughes <enh@google.com> Merge "Work around an icu4c 53 bug in DecimalFormat.getGroupingSize."
47dab51c092aaecfc8a4e09145b537515e69981b 10-May-2014 Elliott Hughes <enh@google.com> am bd07b48b: am dfde0674: am 5c1acb43: Merge "Add android.system.Os.link for link(2)."

* commit 'bd07b48baf1f056e3c7c781b2b3d51025893fdb4':
Add android.system.Os.link for link(2).
5c1acb43c314a7048341f1ab36799fb6675505f4 10-May-2014 Elliott Hughes <enh@google.com> Merge "Add android.system.Os.link for link(2)."
04428d61d7000e17ab21d08a1d672c34eb68f6e2 10-May-2014 Elliott Hughes <enh@google.com> Add android.system.Os.link for link(2).

Bug: 14683762
Change-Id: Ieeba1d2d0c5e9c05e85c6ffbaeb5a7febc69238c
o/BlockGuardOs.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
605a54c3fb24e9d4e0ee76f52ca5bbc387a0b544 09-May-2014 Elliott Hughes <enh@google.com> Work around an icu4c 53 bug in DecimalFormat.getGroupingSize.

Found by org.apache.harmony.tests.java.text.DecimalFormatTest#test_getGroupingSize.

Bug: http://bugs.icu-project.org/trac/ticket/10864
Change-Id: I7c9ad0dd468a2d1f7bdc3252c3de696786059a2b
cu/NativeDecimalFormat.java
40bb958bb2776fe50244ebdce1b59a7234f911d9 09-May-2014 Narayan Kamath <narayan@google.com> am 00c64297: am 469b6955: am 567dcb29: Merge "Fix various errors in FileURLConnectionTest."

* commit '00c642971127aa804eca93bf770eb9802fb5a159':
Fix various errors in FileURLConnectionTest.
d94e746976d2906b89197448db15e4a0e355d98a 08-May-2014 Narayan Kamath <narayan@google.com> Fix various errors in FileURLConnectionTest.

- First, the test was broken pretty badly. It would pass a
Jar style URL to a FileURLConnection and expect it to
work, this is out of spec and seems wrong in general
(file:///foo.apk!resources/foo.txt).

- The RI supports various "headers" on file URL connections
(sigh). As if the getHeaderField(int) and getHeaderFieldKey(int)
APIs weren't bad enough. This has now been implemented with
a naive implementation.

- Fixes FileURLConnection to populate a header map for
information it provides (content length, content type
etc.)

bug: 11664881

Change-Id: I7a3e9aaa79bf125abbcfe8367574115ce54718e3
et/url/FileURLConnection.java
5ac243a144869eb4be71be307de395da3957841f 06-May-2014 Neil Fuller <nfuller@google.com> am 9ee11a68: am 7f5533ef: am b7bef747: Merge "Improve the performance of Annotation checks"

* commit '9ee11a688766068bf8b8625b70cd8aa6cf76c9eb':
Improve the performance of Annotation checks
b7bef747246ee8042a5b4fbc9a323af6eecdaf30 06-May-2014 Neil Fuller <nfuller@google.com> Merge "Improve the performance of Annotation checks"
443cb84d380ca270c9d6f92710812ee0df1ddb61 29-Apr-2014 Nick Kralevich <nnk@google.com> am b43e74bd: am 68a60cd9: Merge "add prctl / PR_SET_NO_NEW_PRIVS"

* commit 'b43e74bd32d707d4715777e510816c2525f7c8c1':
add prctl / PR_SET_NO_NEW_PRIVS
5215e4c0db7530519981f1e505e6db82401802f2 25-Apr-2014 Nick Kralevich <nnk@google.com> add prctl / PR_SET_NO_NEW_PRIVS

Add java wrappers for prctl and PR_SET_NO_NEW_PRIVS.

Change-Id: I649a755ea9354b0290b25292bc65901b1528c1d5
o/ForwardingOs.java
o/Os.java
o/Posix.java
f7224d0e63084a3030b61a0b3ed0d6316fe2749f 29-Apr-2014 Elliott Hughes <enh@google.com> am d10e82cd: am f3305fa5: Merge "libcore.io.OsConstants is dead; long live android.system.OsConstants!"

* commit 'd10e82cd563b6558345affb599d948c26fa4f334':
libcore.io.OsConstants is dead; long live android.system.OsConstants!
ad85992a32668bdd5230e884b424ee813178340a 29-Apr-2014 Elliott Hughes <enh@google.com> libcore.io.OsConstants is dead; long live android.system.OsConstants!

Change-Id: I3951c1349842adf7dfbb7458c76c982646804ccb
o/OsConstants.java
02061ed0a8aec6b039fcf3b2c783de79a50cad53 29-Apr-2014 Elliott Hughes <enh@google.com> am a545eb3c: am 6d4959fc: Merge "Move ErrnoException into android.system."

* commit 'a545eb3c76903aa6ef26249535b0d2f843c85b71':
Move ErrnoException into android.system.
41d8acb87dd1b722cf54e4c64e72c6a13688a849 29-Apr-2014 Elliott Hughes <enh@google.com> Move ErrnoException into android.system.

Change-Id: Id22bebb6aadeff0729f430fce3f702d974a23efc
o/ErrnoException.java
o/IoBridge.java
o/IoUtils.java
25361dd033a324345de65be0809e15e1bbd360ae 29-Apr-2014 Elliott Hughes <enh@google.com> am afff61ef: am ab8f6767: Merge "Move StructStat and StructStatVfs now all the callers have switched over."

* commit 'afff61ef8ff5a0412327b09f42d8472430c23a95':
Move StructStat and StructStatVfs now all the callers have switched over.
a2fac5bc3fc5c182e738aa4f3fcc64bb38dfbf5f 29-Apr-2014 Elliott Hughes <enh@google.com> Move StructStat and StructStatVfs now all the callers have switched over.

Change-Id: Ia599ea8d65645eb97c6944743e0a9510991c0607
o/IoUtils.java
o/StructStat.java
o/StructStatVfs.java
ac4a4df9778c2b7c2ebb3f3e1879524c2f90d213 25-Apr-2014 Elliott Hughes <enh@google.com> am 9a143e29: am 0bdee7bb: Merge "Revert "Fix internal master until I have access again.""

* commit '9a143e294c06e9f673091bd050369fea0271603f':
Revert "Fix internal master until I have access again."
cc4f5f1d11edbe9baec5714d2093c74a01925aae 25-Apr-2014 Elliott Hughes <enh@google.com> am 5574d8a8: am 6d76ee74: Merge "Fix internal master until I have access again."

* commit '5574d8a83edd6f8430b95b9bfafc9e6b91c4ec11':
Fix internal master until I have access again.
0c1b4875b58d0f67432684defdeddd2c5d64f478 25-Apr-2014 Elliott Hughes <enh@google.com> Revert "Fix internal master until I have access again."

This reverts commit 510b95208a6ec9b92cd9debe954c338a8ca8cf88.

Change-Id: Ifaabadfb43b61bf72bf436451612ebf629a70648
til/MutableInt.java
510b95208a6ec9b92cd9debe954c338a8ca8cf88 25-Apr-2014 Elliott Hughes <enh@google.com> Fix internal master until I have access again.

I need to change a dependency in an internal-only class, but some
genius took our building off the net at 17:30 local time. I'll
remove this and fix the internal tree tomorrow.

Change-Id: I0f9a3ae282e1d043d818f028cdcb80854f943151
til/MutableInt.java
7406d4e17dd39f3531e764ec7788b1f8dec99971 25-Apr-2014 Elliott Hughes <enh@google.com> am 3eb545e3: am 85fa4285: Merge "Groundwork towards making the Libcore.os functionality public."

* commit '3eb545e382a12565ed8779632015d736d6f5c32c':
Groundwork towards making the Libcore.os functionality public.
5d930cadc8f62aee5f18e7921296fe66a54f18ab 24-Apr-2014 Elliott Hughes <enh@google.com> Groundwork towards making the Libcore.os functionality public.

Change-Id: Ie700aa16d91fba53fc5eb2555829cb74d84b12ad
o/BlockGuardOs.java
o/ErrnoException.java
o/ForwardingOs.java
o/GaiException.java
o/IoBridge.java
o/IoUtils.java
o/MemoryMappedFile.java
o/Os.java
o/OsConstants.java
o/Posix.java
o/StructAddrinfo.java
o/StructFlock.java
o/StructGroupReq.java
o/StructGroupSourceReq.java
o/StructLinger.java
o/StructPasswd.java
o/StructPollfd.java
o/StructStat.java
o/StructStatVfs.java
o/StructTimeval.java
o/StructUcred.java
o/StructUtsname.java
til/MutableBoolean.java
til/MutableByte.java
til/MutableChar.java
til/MutableDouble.java
til/MutableFloat.java
til/MutableInt.java
til/MutableLong.java
til/MutableShort.java
til/ZoneInfoDB.java
a12a32a2cfb04b6e6c9679686fd6f4df49458366 23-Apr-2014 Neil Fuller <nfuller@google.com> am 38f2ba65: am 4d402932: Merge "libcore changes to support asynchronous close interruption"

* commit '38f2ba6505b1d500cbdcbeff4038ebcf2502c957':
libcore changes to support asynchronous close interruption
8fd85f49c6689a98a4f9981b0a4b4b13358f6c13 22-Apr-2014 Neil Fuller <nfuller@google.com> am 5c3502f3: am 0d18ebc5: Merge "Change DecimalFormat.setRoundingMode() behavior to stay in spec"

* commit '5c3502f3d13ef2bebdeba86b9d7839ad834ce583':
Change DecimalFormat.setRoundingMode() behavior to stay in spec
f62affecd53a2caef7b5ef39d7cd7d60d6ac8874 22-Apr-2014 Elliott Hughes <enh@google.com> am 3df173cd: am 5d51965a: Merge "Update collation tests for icu4c 53."

* commit '3df173cd6c2e73219c754dbb80be5a362f2e8f54':
Update collation tests for icu4c 53.
f0d40d662d9dfdb04215c718961765837d2cf00c 11-Apr-2014 Neil Fuller <nfuller@google.com> libcore changes to support asynchronous close interruption

Previously AsynchronousSocketCloseMonitor was used to handle
socket interruption on close. To support the same for
FileChannel it has been renamed to AsynchronousCloseMonitor.
The Java class was already called this.

FileInputStream, FileOutputStream, RandomAccessFile will
now throw IOException if a connection is closed by another
thread during read. Thread.interrupt() continues to have no effect
on streams.

FileChannel will now throw AsynchronousCloseException during
reads and writes if the file is closed, per the documentation.

FileChannel will now throw ClosedByInterruptException during
reads and writes if the thread reading/writing is interrupted.

Note: FileChannel.lock() will probably still not not throw
AsynchronousCloseException, though it probably should.

This change also has impact on external/conscrypt and
frameworks/base.

Change-Id: I37de3e7d1a005a73821221e6156d10b95c595d7a
Bug: 13927110
o/BlockGuardOs.java
o/ForwardingOs.java
o/IoBridge.java
o/Os.java
o/Posix.java
0d18ebc5a68d096ce2aa5b5af09bb38453007d7c 22-Apr-2014 Neil Fuller <nfuller@google.com> Merge "Change DecimalFormat.setRoundingMode() behavior to stay in spec"
55dfcd8b9609f112b0542af6a705080d98e00d2a 18-Apr-2014 ccornelius <ccornelius@google.com> Update collation tests for icu4c 53.

As of ICU 53, rule strings must begin with a reset '&'.
http://www.unicode.org/reports/tr35/tr35-35/tr35-collation.html#Rules

Also, fewer collation elements exist in ICU 53 because ae-ligature maps to
two rather than three logical collation elements. Now the last one
yields only one CollationElementIterator value rather than two.

Finally, it's no longer possible to switch from forward to backward iteration
without calling reset/setOffset/setText. This used to be undefined behavior
but is now checked.

Change-Id: I663a2b229e551cd6f5753ddae0660f813dbbf866
cu/CollationElementIteratorICU.java
c96651d01dc87a20aa718d60feaff6611451852e 09-Apr-2014 Neil Fuller <nfuller@google.com> Change DecimalFormat.setRoundingMode() behavior to stay in spec

The serialization tests revealed that some DecimalFormat instances
could not be round-tripped. The reason is that the setRoundingMode()
method was setting a non-zero rounding increment, which cannot
be persisted, and also creates patterns that are outside of the
DecimalFormat spec.

Addressed the fact that ICU4C appears to support
RoundingMode.UNNECESSARY now by deleting special-case code.

Changed SerializationStressTest to use canonical DecimalFormat
patterns:

The ones chosen had a couple things that were not ideal:
1) Putting '-' in quotes causes ICU (for non-obvious reasons)
treat the negative pattern prefix as not being default. Default
in this case means "the positive prefix with a preceding '-'.
Removing the quotes meant it would recognize the pattern as
not needing everything after ;., so the pattern would be shrunk.
2) The positive pattern was also not one ICU could deal with
fully. ICU changed "#.#" to "#0.#" at parse time (which can be
corrected with a setMinimumIntegerDigits(0)). It's not clear why
ICU cannot deal with parsing "#.#" when it can produce it, but
there is a long comment in decimfmt.cc suggesting it is
intentional and to avoid format producing empty strings.

The pattern has been changed to one that ICU can handle and would
choose when the various serialized fields are read back. This is
necessary because NativeDecimalFormat compares the patterns and
not just the serialized fields. Leaving the pattern check part of
equals() means that two non-spec patterns will not be considered
equal(), which is important while Android allows non-spec patterns.
Restricting support in DecimalFormat to the documented subset of
characters is not worth the effort and may cause problems
elsewhere.

Change-Id: I2de588458b86619733c0dc1692d526f179059910
Bug: 11668227
cu/NativeDecimalFormat.java
2e3d5f9bf77d8e82a9f9e6c966ff85521d0e1629 14-Apr-2014 Narayan Kamath <narayan@google.com> am 743f7d5f: am a5cfa107: Merge "Set ICU\'s default locale from Locale.getDefault."

* commit '743f7d5f35ac4d350788cd6a69872616d18e58cd':
Set ICU's default locale from Locale.getDefault.
de0eb683370d789e7bb25673b350b8dbf2ba5d69 11-Apr-2014 Narayan Kamath <narayan@google.com> Set ICU's default locale from Locale.getDefault.

bug: 2541757
Change-Id: I5de58be7e8a701f2c40182ea54bceff85ec1aad2
cu/ICU.java
08da684abe6d5515a9c760a3a33af4f8b426095d 26-Mar-2014 Neil Fuller <nfuller@google.com> Improve the performance of Annotation checks

In the circumstance where the annotated element (field/
method/constructor/class) was loaded from a different Dex file
than the annotation:

The previous code would perform a binary
search to determine the type ID of the annotation in the Dex
file of the annotated element. That type ID would then be
compared against the type IDs of annotations present on the
annotated element. The binary search was quite expensive: it
involved various indirections, many small native method calls
and temporary String creation.

Instead, the code now compares the names of the
annotations on the annotated element with the name of the
annotation being searched for. The name of the annotation
is known and cached on the class and is therefore cheap to
get. The name was previously being used to binary search for
the type ID so this appears to be no less correct.

Also removed some unused methods in order to delete the
getFieldIndex() method.

Change-Id: Ib8fb021ddf1221e3eac983aa87e7aea8174720ef
eflect/AnnotationAccess.java
514f547e7da9cf1a80273c4a8d323f5ef62f0b4f 27-Mar-2014 Adam Lesinski <adamlesinski@google.com> am 47f96033: am 35103e5b: Merge "Add an empty long array"

* commit '47f96033104e15f19c6453974aa6a98dd2122496':
Add an empty long array
35103e5b8801751763a6c46290e41f6c119b00b7 27-Mar-2014 Adam Lesinski <adamlesinski@google.com> Merge "Add an empty long array"
c83bbf6124912a13f821b176ab89bbd64c7db8fb 26-Mar-2014 Neil Fuller <nfuller@google.com> am 65e5f5d6: am 80615542: Merge "Speed-up for apps that use Dagger on ART"

* commit '65e5f5d6b5164036677a4b32dcdf2609b61c98fd':
Speed-up for apps that use Dagger on ART
457745fd303079b2ccea1963794a9383f9770ee7 25-Mar-2014 Neil Fuller <nfuller@google.com> Speed-up for apps that use Dagger on ART

This is more of a harm-free heuristic improvement than a fix.
It rearranges the algorithm for determining whether a Field
(or Constructor/Method) is annotated. A cheap check (does the
Field/Method/Constructor has any annotations at all?) is pushed
ahead of a more expensive one (If the annotation were to be
present, what would its type index be?). This happens to work
well in practice in sample apps because the cheap check often
fails, allowing the algorithm to terminate earlier.

The second change is to skip() the field information
rather than to read each field in turn when looking for Method
or Constructor annotation information.

The second change is not a hotspot but looks like an easy
optimization that avoids many small method calls and a for
loop for little additional complexity.

Change-Id: I2118d650f2f1db4e103384483684306e42809093
eflect/AnnotationAccess.java
0145f19b7e2808e3a19c7459e813cc218a4412e9 18-Mar-2014 Adam Lesinski <adamlesinski@google.com> Add an empty long array

Change-Id: Ib229283546e47f31107331e2323f112ef2a0dd6b
til/EmptyArray.java
13862a4de475595f5c600fd44b6220dadcb57f99 14-Mar-2014 Narayan Kamath <narayan@google.com> am 1e504d53: am c0e4c40b: Merge "Don\'t assume minusSign is a single char."

* commit '1e504d53789a2cdc4fad825be52424ca52f1c54f':
Don't assume minusSign is a single char.
4f3bca749bdc8be8abf7555b315f308a2c8c14a7 13-Mar-2014 Narayan Kamath <narayan@google.com> Don't assume minusSign is a single char.

Locales like arabic have a multi char minusSign in
their locale data.

The only difficulty here is presented by DecimalFormatSymbols,
which is a public API and expects the minus sign to be
a single codepoint. The API has been changed to return the
first character of the minusSign string for getMinusSign, which
seems like the least bad option at this point.

This change also removes a workaround for cases where ICU
parsed (2445-) as (-2445) for RTL locales. ICU-52 doesn't do
this anymore.

The serialized form hasn't been modified either, since it's
public API as well and it isn't easy to expand to a String
without awkward semantics.

bug: 13410257

Change-Id: I0e575b7eea0fd811ccb9fb5dc04e20d2e0fa13bf
cu/LocaleData.java
cu/NativeDecimalFormat.java
de6139c4a84f320aa4ca9b5044fdbc4a2a9c5d26 12-Mar-2014 Neil Fuller <nfuller@google.com> Merge "Add APIs for better interoperability with Java 1.7"
5a692fa8cdeec7eee42482f78187bb76be5a87db 11-Mar-2014 Neil Fuller <nfuller@google.com> Merge "Add Currency.getNumericCode()"
d627bd4525e41b0503f94c2887c3e01618c73105 10-Mar-2014 Neil Fuller <nfuller@google.com> Add Currency.getNumericCode()

getNumericCode() was added in Java 1.7. It returns the ISO 4217
numeric code for a currency.

Change-Id: I8404703e749b3324bbcb89ecf6d8d64b95a030a3
cu/ICU.java
8621348d05b28d7626e76fcea3ea6f45099a9157 07-Mar-2014 Neil Fuller <nfuller@google.com> Add APIs for better interoperability with Java 1.7

Must be committed at the same time as the change in framework
to update the public API footprint.

See commit 38ce4c0f83d4ac35c4c63fecf7c8775f9b16f6da in framework/base.

Change-Id: I71a88b09feef8bc2b50b3aeafc3be5863eea3063
et/url/FileURLConnection.java
et/url/JarURLConnectionImpl.java
df29508a7aa622f265aaebdc472eb7d679185ebb 30-Jan-2014 Neil Fuller <nfuller@google.com> Implementation of MulticastChannel.

Note: ProtocolFamily / StandardProtocolFamily /
DatagramChannel.open(ProtocolFamily) have not been
implemented.

There is a related change to libnativehelper that
must be merged at the same time to avoid
build breakage. See
https://android-review.googlesource.com/#/c/81371/

Bug: 12464155
Change-Id: I07fc049b429a2d373e9bd7b07149632f5cd69f9d
o/ForwardingOs.java
o/IoBridge.java
o/Os.java
o/OsConstants.java
o/Posix.java
o/StructGroupSourceReq.java
cc346026b56ca68149b9f1cbbb42136e09ef0be3 20-Feb-2014 Brian Carlstrom <bdc@google.com> When decoding enum annotation value, treat it as a field name, not enum value

Bug: 13078746
Change-Id: I9971841aee3a061523f7ef4744de8042269c1763
eflect/AnnotationAccess.java
2587ef91ba693d73e97704e8163c050b286e7330 14-Feb-2014 Neil Fuller <nfuller@google.com> Addition of 1.7 methods to URLConnection.

URLConnection.getHeaderLong() and
URLConnection.getContentLengthLong().
These methods are required by okhttp.

Changed JarURLConnectionImpl.getContentLength() to return -1
when the size of an entry cannot be represented as an int.
Previously it would have returned a corrupted, possibly
negative, value due to a cast.

Changed FileURLConnection.getContentLength() to return -1
when the size of the file cannot be represented as an int.
Previously it would have returned a corrupted, possibly
negative, value due to a cast.

Change-Id: Ib43e68a2536c2602b4c7ee0cda68fa1f90045f57
et/url/FileURLConnection.java
et/url/JarURLConnectionImpl.java
35d776d8072b4764dd5095acaf7cca564c595ec5 06-Feb-2014 Elliott Hughes <enh@google.com> Merge "All our structs should have a public constructor."
848e5ee99fd59febb4ef8c9a1b047bbcb979a0dd 06-Feb-2014 Narayan Kamath <narayan@google.com> Merge "Make ICU.localeFromIcuLocaleId public."
c92598f1b1caf2c2eaa74e94f8ee2b67e3131892 06-Feb-2014 Narayan Kamath <narayan@google.com> Make ICU.localeFromIcuLocaleId public.

This was package private for testing, but the CTS runner
uses different class loaders for the implementation and
the test so that's not good enough.

bug: 12905565
Change-Id: I6500424333f1e6d4139bcae7339c784f7b4bcd1c
cu/ICU.java
c80b75554696fa7c3acd47b64decee5f43c84775 06-Feb-2014 Elliott Hughes <enh@google.com> All our structs should have a public constructor.

Since we're offering people the ability to mock the OS out, they need
to be able to construct made-up results.

Change-Id: I17883ee19abcefddc923e132cbbe0b82fc7e5bc1
o/StructStat.java
o/StructStatVfs.java
o/StructUcred.java
o/StructUtsname.java
df40b4ad7268a13dff0852f70451a48b59149221 04-Feb-2014 Elliott Hughes <enh@google.com> NativeCollation LP64 fixes.

Change-Id: Idf5100fdfd1915439029f5d42cf4b84d64f457a0
Signed-off-by: Stuart Monteith <Stuart.Monteith@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
cu/NativeCollation.java
11f07d30d2e344b48f132ec6ed105d85423052c2 04-Feb-2014 Elliott Hughes <enh@google.com> Add posix_fallocate to Libcore.os.

(The Java API takes longs for the off_t arguments, and uses posix_fallocate64
behind the scenes.)

Bug: 5287571
Change-Id: I48566d8720c6b41ab42a402eeb322d054d2029ea
o/BlockGuardOs.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
0b6b3e10459fc3a3f4dd280dab8d4a145f7bf2f0 01-Feb-2014 Elliott Hughes <enh@google.com> Move the hidden File.readlink into Libcore.os.

Change-Id: Ia983909e62d3806027dff870f0148dd07c31bf01
o/BlockGuardOs.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
5bdb797e4f545c6b16f44523cdab2500460f290d 30-Jan-2014 Neil Fuller <nfuller@google.com> Merge "Refactoring in preparation for NIO2 changes."
933fbbf606268eec9fc430632b8bca7002a833b3 14-Jan-2014 Neil Fuller <nfuller@google.com> Refactoring in preparation for NIO2 changes.

Making the various Socket/Channel classes more consistent with each
other for synchronizing state between the Channel, Socket and the OS.
This is in preparation for NetworkChannel.bind().
Synchronizing state revealed a test that relied upon a Socket from a
channel not reporting isConnected() properly after a connect(). Tests
have been updated.

Reading the local address back from the OS revealed that Android is
using IPv6 and reports the string equivalent of IPv4's 0.0.0.0 as
"::". Updated a test that was relying on the string form.

Calling connect() twice on a DatagramSocket appears inconsistent with
itself and Channel and other Sockets. A pure DatagramSocket switches
over to the new remote address. I have changed the Channel-backed
DatagramSocket to throw an IllegalStateException exception, and have
created a bug to discuss making the calls more consistent.

Socket has been modified to avoid using the address field to store
the local address after a bind(). This field is documented as holding
the remote address, not the local.

Changed implementation of SocketChannelImpl.socket().getInputStream()
and SocketChannelImpl.socket().getOutputStream() to use the one that
is implemented by Socket and not a custom NIO-based implementation.
The use of NIO provided two parallel implementations for the same
thing. This change alters behavior when attempting to read zero bytes
and when a Channel is in non-blocking mode: now it throws
IllegalBlockingModeException rather than
ArrayIndexOutOfBoundsException. The tests have been updated.

Various tidying up changes to introduce @Override, remove
unnecessarily initialized local variables, fields, semi-colons,
javadocs and imports. Added close() calls for objects during tests
that were cluttering the logs.

Modified IoBridge.connect() to be void. Adjusted SocketChannelImpl
accordingly and tidied up impossible cases. Modified
SocketChannel.connect() so that it always returns false in
non-blocking mode. This looks like an existing bug:
it would previously have returned true, even though the connection
was potentially still pending. Tests have been added.

Also tidied up SocketChannelImpl.finishConnect() - it was potentially
resetting the isBound state.

Change-Id: Ic7943615b4b763f77e74397e0e91a62edc7d7017
bug: 12464155
o/IoBridge.java
c5b1eb191102a20bc0626aea955aba417e337fbc 10-Jan-2014 Narayan Kamath <narayan@google.com> 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
cu/ICU.java
3a134c58302d6acf59336a4d7d0a70d574ffd493 20-Dec-2013 Narayan Kamath <narayan@google.com> Move DeleteOnExit to libcore.io.

Also makes the constructor private & a field final.

Change-Id: I1df833cee5f4217bd800c36104da2a76a1f1877d
o/DeleteOnExit.java
b46217c4c5ff99126eb31a4d2c6ad020fcb89a08 11-Dec-2013 Narayan Kamath <narayan@google.com> Remove blockguard check for getaddrinfo.

Change-Id: Ia45aa76e42b06d7ed405d7a2f6851658fec0bff0
o/BlockGuardOs.java
edaa74db58376b7528434707304d081591df2fb5 27-Sep-2013 Jeff Sharkey <jsharkey@android.com> Catch more system calls that result in disk I/O.

Change-Id: If3d941154c658bd87ed968ae4d40cfb6806242ce
o/BlockGuardOs.java
d6fcc6c62ec28f590dc8baaadc9a5035bf95b407 28-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Add RT_SCOPE_* to OsConstants.

These are defined in RFC 3549 (netlink) and will be used, for
example, to determine whether an IP address has global scope.

Bug: 9180552
Change-Id: I7e712cdd0bcb0dd7b24eb2e46b4205ad96b42164
o/OsConstants.java
972940b14c0b189584c2128e54313214bfd9d1b0 15-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 4bb8f69f: am dbdee7a8: Merge "Add IFA_F_* constants for use in LinkAddress"

* commit '4bb8f69fe9a8ed13bc7d46eff114af11e377c2b1':
Add IFA_F_* constants for use in LinkAddress
4bb8f69fe9a8ed13bc7d46eff114af11e377c2b1 15-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am dbdee7a8: Merge "Add IFA_F_* constants for use in LinkAddress"

* commit 'dbdee7a8cc1aff75d8028d61b12d3c97393276c5':
Add IFA_F_* constants for use in LinkAddress
638c455b29d06642724528c59d311a1bcb4f2359 15-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Add IFA_F_* constants for use in LinkAddress

Some of these are needed so that LinkAddress can tell if an
IP address is duplicate, tentative, etc. or if it usable. While
we're at it, add all the ones that are defined in the kernel
headers.

Bug: 9180552
Change-Id: I5fc77cacf5df2249bcf08071430675204624916f
o/OsConstants.java
ab5a0afb2c6677a0259cd20fbb0a08a54756ac6a 14-Nov-2013 Elliott Hughes <enh@google.com> am e9c981dc: am 580df337: Merge "Update our MIME type map."

* commit 'e9c981dc3a4959e780da23eee6cf5a73e13d824d':
Update our MIME type map.
e9c981dc3a4959e780da23eee6cf5a73e13d824d 14-Nov-2013 Elliott Hughes <enh@google.com> am 580df337: Merge "Update our MIME type map."

* commit '580df3374a411fb76d79ea19a129e65ee08c3733':
Update our MIME type map.
cb8b2684604c0068a9e34b7fd352f0c3abaf99ca 14-Nov-2013 Elliott Hughes <enh@google.com> Update our MIME type map.

Bug: https://code.google.com/p/android/issues/detail?id=61996
Change-Id: I55efc9d38c87d89bb20073e4632ab1e06c77be09
et/MimeUtils.java
329af9cb39b3cd325a6ac6d1bc906af8877eff9f 31-Oct-2013 Vladimir Marko <vmarko@google.com> Rewrite Memory peek/poke to swap bytes in Java.

Rewrite single memory access (non-array) peek/poke methods
in libcore.io.Memory to swap bytes on the Java side and do
only the memory access in JNI.

This causes a small performance hit. However, that will be
more than compensated for in ART by implementing intrinsics
for the new memory access helper methods.

(cherry picked from commit ad02363555dce245e1e5f547d73925f61d336dcf)

Change-Id: Iaf679c21319b3241c7cf4142e0616e91a591c20f
o/Memory.java
96caa8ec10a5d64d804a9ed3897c9a34c8626239 21-Oct-2013 Brian Carlstrom <bdc@google.com> Fix Class.getEnclosingClass for anonymous classes declared in <clinit> methods

(cherry picked from commit b9be313bdc257089534f738ff8e1e5ad4de3d25e)

Bug: 11245138
Related bug: https://code.google.com/p/android/issues/detail?id=61003

Change-Id: I5cc1db6ca6628b845409d7a6ea864da5f625fdc3
eflect/AnnotationAccess.java
54c480218b6c7b38958c9c4f9040f2147b90da90 04-Nov-2013 Narayan Kamath <narayan@google.com> am 77608ce8: Merge "Fix javadoc mistruths."

* commit '77608ce81af3b502d52eb912a7dc998523647c37':
Fix javadoc mistruths.
77608ce81af3b502d52eb912a7dc998523647c37 04-Nov-2013 Narayan Kamath <narayan@google.com> Merge "Fix javadoc mistruths."
c80750e1bcdd3753a4e65e46682b13c898173628 01-Nov-2013 Narayan Kamath <narayan@google.com> Fix javadoc mistruths.

Change-Id: I3536fe51c585c3080f1371b9bcb9924f32ca2705
o/Streams.java
b4ae662bab0ea279b136b5f462635d335a610570 01-Nov-2013 Narayan Kamath <narayan@google.com> am 6ce57c99: Merge "Remove UnsafeByteSequence."

* commit '6ce57c994dcb3a7a6e22fa45fd489e54960458d3':
Remove UnsafeByteSequence.
b0674a77ed67e30f2510064b89151002d7f2eb2a 30-Oct-2013 Narayan Kamath <narayan@google.com> Remove UnsafeByteSequence.

Replace it with a smaller, less general class for reading
the contents of a file into a byte array or a string.

Remove the need for an additional buffer and instead read
the contents of the file directly into a buffer owned by
FileReader. Optimise for the case where the length
of the file is known.

This imposes the additional restriction on callers that the
path of the file they're reading is an absolute path. I've
checked that all callers obey that currently.

Change-Id: Ic020a45051416f2de9a2f78bd5f99a21feff17df
o/IoUtils.java
563622373f953d76a4e7f4390ea922c98a267327 01-Nov-2013 Narayan Kamath <narayan@google.com> am abac79a6: Merge "Remove unnecessary FileDescriptor#valid check."

* commit 'abac79a6a9ceaadcf5db0f56f7570fb96a9f8d65':
Remove unnecessary FileDescriptor#valid check.
abac79a6a9ceaadcf5db0f56f7570fb96a9f8d65 01-Nov-2013 Narayan Kamath <narayan@google.com> Merge "Remove unnecessary FileDescriptor#valid check."
b4033d7f69677cfb5d2860775e8b1e992437f2cc 31-Oct-2013 Elliott Hughes <enh@google.com> am 8ff6e83b: Merge "Add a cache to ICU.getBestDateTimePattern."

* commit '8ff6e83b15999e2ccc88f455fbf1789a80433bcc':
Add a cache to ICU.getBestDateTimePattern.
0fd776f4dbf7c1940c080003f0c7a02d35374ab9 31-Oct-2013 Elliott Hughes <enh@google.com> Add a cache to ICU.getBestDateTimePattern.

Brings the time down from 7ms to 7us for a cache hit on Nexus 4.

Bug: 11447043
Change-Id: I7cfc055c264ce49dadc72b5acdc2f2b0b339a5a1
cu/ICU.java
cu/LocaleData.java
15443035ff7b8ac7d6a7e6e2caffcd88f2faef67 31-Oct-2013 Narayan Kamath <narayan@google.com> Remove unnecessary FileDescriptor#valid check.

Libcore.os.open will always return a valid FileDescriptor.
It will throw if open returned -1 and cause a VM segfault
if a new java file descriptor could not be created.

Change-Id: I352251203f0cc8b12fc14d4ccfee1da1658f0f39
o/IoBridge.java
054c301f83fe04c44a204b3d2e71d56763d29748 28-Oct-2013 Jeff Sharkey <jsharkey@android.com> am e690ff8e: Add more certificate MIME type mappings.

* commit 'e690ff8e85c0e0ed461112085a30496b771bc352':
Add more certificate MIME type mappings.
e690ff8e85c0e0ed461112085a30496b771bc352 25-Oct-2013 Jeff Sharkey <jsharkey@android.com> Add more certificate MIME type mappings.

Bug: 11354402
Change-Id: I8fd361de60e4170546bad8e5e58170768778f00e
et/MimeUtils.java
12a9d99bc8b7a4972a382fcd78ef24e2ac0a4233 26-Sep-2013 Michael Wright <michaelwr@google.com> am 670023f1: Merge "Add CAP_BLOCK_SUSPEND to OS constants"

* commit '670023f161f2be66c285f5ce1556aeb219571a61':
Add CAP_BLOCK_SUSPEND to OS constants
670023f161f2be66c285f5ce1556aeb219571a61 26-Sep-2013 Michael Wright <michaelwr@google.com> Merge "Add CAP_BLOCK_SUSPEND to OS constants"
d87d88312ba187a71ee02f18eb1c48a434ebcd15 26-Sep-2013 Michael Wright <michaelwr@google.com> Add CAP_BLOCK_SUSPEND to OS constants

Bug: 10901016
Change-Id: I162bde82bce9fca8eabc7168a172d3d8365e1578
o/OsConstants.java
94b1bae43287c5c8e2d31d05d4f68441acf667ab 24-Sep-2013 Ian Rogers <irogers@google.com> Merge commit 'a6e22fc9' into manualmerge

Conflicts:
libdvm/src/main/java/java/lang/Class.java

Change-Id: I03e7a0ad53ec4c3482e75c0a189649a44cdec3a0
3f1ad69ef4655901cbf71c4c1fbae074bc320585 24-Sep-2013 Ian Rogers <irogers@google.com> Merge commit 'd4ec55c4' into manualmerge

Conflicts:
libdvm/src/main/java/java/lang/Class.java

Change-Id: Ib634a11b66deb2a1a81b421b5de26a8f4a8c8746
a6e22fc9b70ebe39abd716ce37450bda935c0fb8 19-Sep-2013 Ian Rogers <irogers@google.com> Avoid computing class def indices.

Bug: 10244719
Also tidy AnnotationAccess.

(cherry-picked from 8b2c0b9abc3f520495f4387ea040132ba85cae69)
Change-Id: I6ec8fd4e36b428d7e16e01d98b7bebc143fac8c3

Conflicts:
libdvm/src/main/java/java/lang/Class.java
eflect/AnnotationAccess.java
eflect/GenericSignatureParser.java
d4ec55c4e1acc3c3df937facbd367aff6618536c 07-Sep-2013 Ian Rogers <irogers@google.com> Lazier annotation signature parsing.

Bug: 10244719.
Also, make wider use of empty arrays.
Also, use named inner classes to aid profiling.
Remove caching as the empty result will be fast.
Porting the ART changes to DVM, to avoid the caching, results in bringing
in a bunch of other ART clean-up.
TODO, avoid modified-UTF8 to String conversions by Dex.

Change-Id: I051b6e34b5a4e7a7f1383461a799755947a5ba36

Conflicts:
libdvm/src/main/java/java/lang/Class.java
eflect/AnnotationAccess.java
eflect/GenericSignatureParser.java
eflect/ListOfTypes.java
eflect/ListOfVariables.java
eflect/Types.java
til/EmptyArray.java
7e86199157f508c54ea8d80ab5dd755194444a86 12-Sep-2013 Elliott Hughes <enh@google.com> am 6c0a2af4: Merge "Remove RawSocket, which is no longer used."

* commit '6c0a2af40100e47e01c5c786cf5985a7638cc961':
Remove RawSocket, which is no longer used.
5b5e8e70b52dd4fca159fb39f9ee555d31699dec 12-Sep-2013 Elliott Hughes <enh@google.com> Remove RawSocket, which is no longer used.

Change-Id: Ia44a9ffd4d36da408c6b411c90d59ce7db30a36f
et/RawSocket.java
e78392830b4548c65364449441cac3ff16f955f5 11-Sep-2013 Elliott Hughes <enh@google.com> icu4c DateIntervalFormat objects are expensive enough that we need to cache them.

It takes ~1ms to create a DateIntervalFormat on a z620, and around 8ms on a
current mobile device (Nexus 4). Add a small cache of recently-used formatters,
using a big lock rather than per-thread caches since this typically only
happens on the UI thread anyway, and because all the other frameworks date/time
formatting is behind a single lock too.

Bug: 10696944

(cherry picked from commit fd1d5e92b2eaf785cb18aa295b7b846cfc5e29af)

Change-Id: Iefd573ff6f9851efda0ebe18418dba61fb151e65
cu/DateIntervalFormat.java
6542295d2b8e9b4879841e361814642536653ed8 12-Sep-2013 Elliott Hughes <enh@google.com> am 976db725: Merge "icu4c DateIntervalFormat objects are expensive enough that we need to cache them."

* commit '976db725f211ba640b38ff25feac4e8552597ba4':
icu4c DateIntervalFormat objects are expensive enough that we need to cache them.
fd1d5e92b2eaf785cb18aa295b7b846cfc5e29af 11-Sep-2013 Elliott Hughes <enh@google.com> icu4c DateIntervalFormat objects are expensive enough that we need to cache them.

It takes ~1ms to create a DateIntervalFormat on a z620, and around 8ms on a
current mobile device (Nexus 4). Add a small cache of recently-used formatters,
using a big lock rather than per-thread caches since this typically only
happens on the UI thread anyway, and because all the other frameworks date/time
formatting is behind a single lock too.

Bug: 10696944
Change-Id: I8ccbe0b31b722a95a08fbc5a119173b7a0f44807
cu/DateIntervalFormat.java
e2ed9c517acedc0082b01375ff3c274737a6dd6d 11-Sep-2013 Elliott Hughes <enh@google.com> am 1b2c7f9f: Merge "Add API to get a time zone\'s localized exemplar location from CLDR."

* commit '1b2c7f9fb9a7fa8d3243bf6a767cefdc354d410a':
Add API to get a time zone's localized exemplar location from CLDR.
383b6c74eb7088c545841357e482c4fd6218cb9d 11-Sep-2013 Elliott Hughes <enh@google.com> Add API to get a time zone's localized exemplar location from CLDR.

Bug: 8145760
Bug: 10179879
Change-Id: Idafa81402c8d89cc2756ab1d57c0f8b1b3401df7
cu/TimeZoneNames.java
3a41ef3fad3152c62dabdb76a9055d829cc21d58 07-Sep-2013 Elliott Hughes <enh@google.com> am 11eaa715: Merge "Fix formatDateRange\'s decisions about when to show a year."

* commit '11eaa7157d3bfcea0ccf641308a60a9f1f7f5990':
Fix formatDateRange's decisions about when to show a year.
41a439b85b660a1c7cb33b1ae0e4b3e5713664f1 07-Sep-2013 Elliott Hughes <enh@google.com> Fix formatDateRange's decisions about when to show a year.

Bug: 10209343

(cherry picked from commit e1a17472940f90d6712203f3523bb054bdbfd6e4)

Change-Id: I9931c3e72d5623dec8cc21c09eae5532aa7eb7f6
cu/DateIntervalFormat.java
e1a17472940f90d6712203f3523bb054bdbfd6e4 07-Sep-2013 Elliott Hughes <enh@google.com> Fix formatDateRange's decisions about when to show a year.

Bug: 10209343
Change-Id: Id386e9ee4acf46ce3b4d0802b4aca49a0b0667cb
cu/DateIntervalFormat.java
c55c0be0c20b134fc6f31dc9968e05a75a5e0fd3 06-Sep-2013 Elliott Hughes <enh@google.com> am ad5eb66b: Merge "Fix formatDateRange\'s handling of all-day events."

* commit 'ad5eb66b31091929bd5a40ce0aa287f647182f8b':
Fix formatDateRange's handling of all-day events.
bb0a7318f2ca1bc9768d6d68b9a4521dd40f09a9 06-Sep-2013 Elliott Hughes <enh@google.com> Fix formatDateRange's handling of all-day events.

Android's formatDateRange's interpretation of a time span running until 0 ms
into a day is different from icu4c. Traditionally we didn't count that as
being the next day, but icu4c does.

Bug: 10560853

(cherry picked from commit e6d0a351d58747ca6958ee9c9a12d2c3feb7f9db)

Change-Id: Ia394fe541afcfccfe801a8aa704ad8d14212d817
cu/DateIntervalFormat.java
e6d0a351d58747ca6958ee9c9a12d2c3feb7f9db 06-Sep-2013 Elliott Hughes <enh@google.com> Fix formatDateRange's handling of all-day events.

Android's formatDateRange's interpretation of a time span running until 0 ms
into a day is different from icu4c. Traditionally we didn't count that as
being the next day, but icu4c does.

Bug: 10560853
Change-Id: I99fbbf19ad98147c9c4ff568231aec71d97a8938
cu/DateIntervalFormat.java
8d58a5409330063cdf025a7827691d4d317e9a65 04-Sep-2013 Elliott Hughes <enh@google.com> am 1730b1d9: Merge "Don\'t abbreviate 24-hour times."

* commit '1730b1d96c7d73848866ba6c52856924d2ae78bc':
Don't abbreviate 24-hour times.
e8f98b22cbd859c5c2cad9866335128a95adcd81 04-Sep-2013 Elliott Hughes <enh@google.com> Don't abbreviate 24-hour times.

Bug: 10318326

(cherry picked from commit 504a9b9d616bd108d26077d6d215677a29605f22)

Change-Id: I3ea76ad516b7d76b7e56a562b56cdfeff451f289
cu/DateIntervalFormat.java
504a9b9d616bd108d26077d6d215677a29605f22 04-Sep-2013 Elliott Hughes <enh@google.com> Don't abbreviate 24-hour times.

Bug: 10318326
Change-Id: Ifbd50a994e30ce11e060eebd0bf6b8f428c1264d
cu/DateIntervalFormat.java
4a01f60804080f5e01873c218be287d456ad0d32 04-Sep-2013 Elliott Hughes <enh@google.com> Remove some unnecessary native code for LocaleData.

We already have a more general implementation, exposed as public
API >= jb-mr2.

(cherry picked from commit 783112d47e2236b6a7e2315c2e50166d755422a7)

Bug: 10611001
Change-Id: I5dc1c6588c183783053549e1052a475465d380e5
cu/LocaleData.java
2f35fe25fe8365ed7fb413a0da1152ee0e8cc562 04-Sep-2013 Elliott Hughes <enh@google.com> am b836cc88: Merge "Remove some unnecessary native code for LocaleData."

* commit 'b836cc88ca810763b7b031dc3c86658924d535e4':
Remove some unnecessary native code for LocaleData.
783112d47e2236b6a7e2315c2e50166d755422a7 04-Sep-2013 Elliott Hughes <enh@google.com> Remove some unnecessary native code for LocaleData.

We already have a more general implementation, exposed as public
API >= jb-mr2.

Change-Id: I917465f6bac4afec40e3685dccffad920d050c85
cu/LocaleData.java
842957f3b096d432b0da63e897eaf7864f48af2a 01-Sep-2013 Elliott Hughes <enh@google.com> am f3506533: Merge "Fix a DecimalFormat crash when formatting the empty string."

* commit 'f3506533cb9fd3db3971b992f4df996f1d0f838a':
Fix a DecimalFormat crash when formatting the empty string.
8f9976752b2a6e834994ca5790025bc46a3ef340 31-Aug-2013 Elliott Hughes <enh@google.com> Fix a DecimalFormat crash when formatting the empty string.

We don't even need a general-purpose iterator, and it's never exposed
to user code, so we can simplify things quite a bit. The key change
though is that a null array is not an error condition --- it just
means we didn't actually output anything.

Bug: https://code.google.com/p/android/issues/detail?id=59600
Change-Id: I7ec0bab00e15ab5c3a4dbd15e2dc81494f68e82f
cu/NativeDecimalFormat.java
229269b70bb8d0819c475bd675740465c063e0c8 31-Aug-2013 Elliott Hughes <enh@google.com> am 922ce230: Merge "Fix harmony java.text test failures."

* commit '922ce2301f54eb3a9e8879d73aec5a14ed27d066':
Fix harmony java.text test failures.
74473971cc9d960376295fbcc430320c9ed62991 29-Aug-2013 Elliott Hughes <enh@google.com> Fix harmony java.text test failures.

There were plenty of bad tests here, but there were some real bugs too.

* DecimalFormat was only handling RoundingMode.UNNECESSARY for double
formatting.

* DecimalFormat was not ensuring that it's superclass' fields were
being correctly updated.

* NumberFormat was throwing NPE for a null object because of an
improved detail message, despite being specified to throw IAE.

* We weren't mapping NumberFormat.Field instances to the corresponding icu4c
UNUM_x_FIELD constant, so we weren't actually setting FieldPosition
objects correctly.

* SimpleDateFormat was not formatting milliseconds correctly with 'S'.

* NativeDecimalFormat wasn't handling JNI NewString OOME correctly.

Bug: 2528220
Bug: 3056865
Bug: 3057080
Bug: 3057090
Change-Id: Iac11f902f2e9649e596e7e7b7bc501b13e956fca
cu/NativeDecimalFormat.java
273cfb1a97830191d2a94474b1fbf564e46e3e94 27-Aug-2013 Elliott Hughes <enh@google.com> am c1d4a637: Merge "Reduce the upper bound on TimeZoneNames memory usage."

* commit 'c1d4a6379e9351fffcc0dcd2649281782f20b8ce':
Reduce the upper bound on TimeZoneNames memory usage.
3020db601855fda8e33c870510204750b2386f3d 27-Aug-2013 Elliott Hughes <enh@google.com> Reduce the upper bound on TimeZoneNames memory usage.

The cache had mistakenly been sized based on the number of time zones,
despite the fact that the keys are locales. We now have a lot of locales,
but the cache was still large enough to hold all of them, which wasn't
really the intent. I pulled the number 5 out of my ass.

I've also removed the "one big intern table" and now just do per-locale
deduplication. That avoids another potentially very large leak in an
ill-behaved program.

Also handle OOME in the native code better.

Change-Id: I9a07ad210469f064acde80f7d10ffb4b3a8f6443
cu/TimeZoneNames.java
71dc4f7d4829335f7aba5414b43d16cd316ba22f 31-Jul-2013 Brian Carlstrom <bdc@google.com> Refactor ART java.lang.reflect implementation

Bug: 10014286.

(cherry picked from commit 1222a700a25956b0e3634731160017f0d3aa0585)

Change-Id: Ic5672489f6c028d47e6c2a499d6a2bbdd5cc4e4c
eflect/AnnotationAccess.java
5ec6bf8d033754e06a463adb091d2c0afd0755ac 08-Aug-2013 Elliott Hughes <enh@google.com> Fix various Charset tests, clean up the implementation.

Bug: 10211558
Bug: 10211378
Change-Id: Ib3f97430f62163c0459c53e0c282ae0ca840e0af
cu/NativeConverter.java
59675dbb837c2a92352032e2ef0c8fc3305da9c8 06-Aug-2013 Elliott Hughes <enh@google.com> Cache the few unique Attributes.Name values.

Google+ was seeing ~8k duplicate names. Their real fix is to not
accidentally cause us to parse their jar manifest, but we shouldn't
be unnecessarily wasteful in the common case, should anyone actually
need their jar manifest.

Change-Id: Ia06b0964956332975e5efd079d96aa76ba605f48
et/url/JarURLConnectionImpl.java
507e7789a5aace0f30d85dab8862151b1eba693a 01-Aug-2013 Elliott Hughes <enh@google.com> Fix DateIntervalFormat to take time zone into account.

Bug: 10089890
Change-Id: I91e61429108abb16810701d6d9feb6d1ad431740
cu/DateIntervalFormat.java
069525a39125c203b658c805685b6045a7d4dfeb 30-Jul-2013 Elliott Hughes <enh@google.com> Add gettid.

Change-Id: Ie18095d696ebeb8f056fb7f5b7cfbc452cdf8206
o/ForwardingOs.java
o/Os.java
o/Posix.java
301174b9ed79a73e35d7463f06ae48eb0654c6ca 26-Jul-2013 Elliott Hughes <enh@google.com> Use the libcore.reflect implementation.

(cherry-pick of 07e1d1125c11b8e037a31e9ebb6b64332a394a9f.)

Change-Id: I06ccfb93525525ec4f417bcbabdcead2e817ced6
eflect/AnnotationAccess.java
eflect/GenericArrayTypeImpl.java
eflect/GenericSignatureParser.java
eflect/InternalNames.java
eflect/ListOfTypes.java
eflect/ListOfVariables.java
eflect/ParameterizedTypeImpl.java
eflect/TypeVariableImpl.java
eflect/Types.java
eflect/WildcardTypeImpl.java
480537d9d51add98bffe6d9a9ef3b1022b959336 03-May-2013 Elliott Hughes <enh@google.com> Add an icu4c-based DateIntervalFormat.

This will be used to replace DateUtils.formatDateRange's implementation.

Bug: 7289514
Change-Id: I5588c79a9d0a5cbed3b4600389c545e83fc26967
cu/DateIntervalFormat.java
18c6ef53b56aa0ae9ff225bf7567375e7448923c 24-Jul-2013 Elliott Hughes <enh@google.com> am ce6f7cc5: Merge "Return a more specific type from AnnotationFactory.createAnnotation."

* commit 'ce6f7cc54d4b71b2fd33288c8bf7c0fc863745f8':
Return a more specific type from AnnotationFactory.createAnnotation.
47f7d00f0edf404e1cac410334e1ea4d75a28b8d 24-Jul-2013 Elliott Hughes <enh@google.com> Return a more specific type from AnnotationFactory.createAnnotation.

Change-Id: Ic73ff86addb689c4b67298d45385a293ccc4ecef
eflect/AnnotationFactory.java
5a2fc9c912510c65504a548f2b26328d11017059 24-Jul-2013 Elliott Hughes <enh@google.com> am 4323ab38: Merge "Simplify merges of the annotation code."

* commit '4323ab3865dfeca2ecba7fd612e4ed103452b328':
Simplify merges of the annotation code.
d736c6d053f63e4cd8dfb16c57093c67be3e18cd 24-Jul-2013 Elliott Hughes <enh@google.com> Simplify merges of the annotation code.

Change-Id: Ifb43ae14efcbfad1da600f97e3b3763ad9764b1f
eflect/AnnotationFactory.java
eflect/AnnotationMember.java
ba22290197a6d5f462b6e181515303c4ea4a3280 18-Jul-2013 Elliott Hughes <enh@google.com> resolved conflicts for merge of a6ca7a95 to stage-aosp-master

Change-Id: Icc74574f5e99d9b2076b3a1ae0136f8fdf944ee5
0ef9944d1968207ae8501aca5f904809320c520e 19-Jun-2013 Elliott Hughes <enh@google.com> Fixes for icu4c 51.

Change getYesterdayTodayAndTomorrow to cope with the new data layout.

Extend getDateFormatOrder to cope with 'G' in fa's preferred yyyyMMdd
pattern.

Fix a few tests to correspond to data changes.

Change-Id: I2478ae960ff6ec0b9a95290132c0ae0d5d8eff5a
cu/ICU.java
029b00d62b71747b2a700788066f92a7dd8579e2 10-Jul-2013 Elliott Hughes <enh@google.com> am ec618403: Merge "Switch libcore from statfs to statvfs."

* commit 'ec618403efee992f232f017fbff1afff6cfa0de3':
Switch libcore from statfs to statvfs.
721ceca2a52a3c27aa751476c8562e1e68088e15 09-Jul-2013 Elliott Hughes <enh@google.com> Switch libcore from statfs to statvfs.

Change-Id: I5115b9203ce6b11c37c0eb41fbc84fa5962ce196
o/ForwardingOs.java
o/Os.java
o/Posix.java
o/StructStatFs.java
o/StructStatVfs.java
7381513bfbaf8fa431e1e661cafd7558b2a298ee 03-Jul-2013 Elliott Hughes <enh@google.com> am fee8ca27: Merge "Add a definition for IPPROTO_ICMPV6."

* commit 'fee8ca277b2621aea0729426af66356001e3b463':
Add a definition for IPPROTO_ICMPV6.
dca34b591430a1f1c1aabab1beb5cd6e5bd4d2f8 03-Jul-2013 Lorenzo Colitti <lorenzo@google.com> Add a definition for IPPROTO_ICMPV6.

This will allow us to write a CTS test for ICMPv6 datagram
socket support.

Bug: 9469865
Change-Id: I3da0918fa0797e7319f8b2f71856f455858bdc18
o/OsConstants.java
85fe9d70ed5939686ebb29034807f95d793198f7 29-Jun-2013 Elliott Hughes <enh@google.com> am 02127781: Merge "Add java.nio.charsets.StandardCharsets."

* commit '02127781afeb957f182d57f588053ee06ed3a6ab':
Add java.nio.charsets.StandardCharsets.
2a6f23ff8690ac2f025588a360547ce96cde0943 29-Jun-2013 Elliott Hughes <enh@google.com> Add java.nio.charsets.StandardCharsets.

Bug: 3484927
Change-Id: I5820267491b850b8fcc696fa48962710de123009
o/Base64.java
o/IoUtils.java
o/StrictLineReader.java
et/UriCodec.java
et/url/FtpURLConnection.java
til/ZoneInfoDB.java
90181ef5bba842e587aac694bc3edfb65107ea18 17-Jun-2013 Elliott Hughes <enh@google.com> am 42602143: Merge "Add a short date format that\'s guaranteed to have 4-digit years."

* commit '42602143f054ccf7ab692c8fe229dadc8fcb58e7':
Add a short date format that's guaranteed to have 4-digit years.
2f5b39ddcdfc4ab7edd0a5a02801eb3dc96e0266 17-Jun-2013 Elliott Hughes <enh@google.com> Add a short date format that's guaranteed to have 4-digit years.

Bug: https://code.google.com/p/android/issues/detail?id=56385
Change-Id: Ie60d8c61aae09358d296654bd30378cbd11eeecb
cu/LocaleData.java
1ce091a1dbae09bbc554104e48e13c80134e9270 07-Jun-2013 Elliott Hughes <enh@google.com> am d1c6786d: Merge "Fix zone.tab parsing."

* commit 'd1c6786d289258a054a57eaae6a0700b74fb0157':
Fix zone.tab parsing.
b2181542090a8ff8801331e6ad8f9afcb62da8b3 07-Jun-2013 Elliott Hughes <enh@google.com> Fix zone.tab parsing.

Not every zone.tab line has a comment.

Bug: 9327819
Change-Id: I32811c2da34755e2a15334f8701523505e1398b3
cu/TimeZoneNames.java
c286ebcb2be9bd7f2dd1c14b132dbf85ee7ca314 07-Jun-2013 Elliott Hughes <enh@google.com> am b5ba804a: Merge "Fix @deprecated javadoc orthography."

* commit 'b5ba804a3b6d00c63a59902b782c11a0af9ed205':
Fix @deprecated javadoc orthography.
99b4489d0555c6e0e5df941cbfad4cf250c8f0b8 07-Jun-2013 Elliott Hughes <enh@google.com> Fix @deprecated javadoc orthography.

Change-Id: I6db6d91e21b8e1aca5b5338534196fd5bdef8a06
o/IoUtils.java
51377dcfd7cb06cb25d55ec818a941304eb0a11e 30-Apr-2013 Elliott Hughes <enh@google.com> am 87b4b0f8: Merge "Implement getDateFormatOrder."

* commit '87b4b0f88fe0b5fa5c271593e483fb5bd306a6a4':
Implement getDateFormatOrder.
0604cf761b8717c025a5e78031fde1edf71c7757 30-Apr-2013 Elliott Hughes <enh@google.com> Implement getDateFormatOrder.

I do wonder if we shouldn't generalize this, rather than hard-code yMd,
but YAGNI.

Bug: 7207103
Change-Id: Ib59191eee97c08913f9a0a4ea52fb6eb8c677918
cu/ICU.java
63d0bbf732d0b634894131ee3e34d47b43826eb6 27-Apr-2013 Elliott Hughes <enh@google.com> am 06fe32ee: Merge "Remove the now-unused ZoneInfoDB.getVersion API."

* commit '06fe32ee348b1a1141df37a0efcf2c90bea7e1a2':
Remove the now-unused ZoneInfoDB.getVersion API.
eef73ccb5e02b939ae8f348094c64f50955870a5 26-Apr-2013 Elliott Hughes <enh@google.com> Remove the now-unused ZoneInfoDB.getVersion API.

Change-Id: I05aff6c07e9baca679b8b7759f4f0108067d06e6
til/ZoneInfoDB.java
ff72988b2ff791afc4d101984c9348451f49091c 26-Apr-2013 Elliott Hughes <enh@google.com> am 971709da: Merge "Cope with a corrupt tzdata update."

* commit '971709da542bbaf163c89fce916fc943f0e1101a':
Cope with a corrupt tzdata update.
995caee51334a4f1a1429e29680ea079c900c37a 25-Apr-2013 Elliott Hughes <enh@google.com> Cope with a corrupt tzdata update.

We need to fall back to the next choice on error. Rewrite the code
to be testable and add some tests. Add an internal GMT-only
fallback in case all our sources of tzdata are bad. Also make
time zone detection on the host more useful.

Bug: 8373554
Change-Id: I9f91b844a61f07f34b268535e6d24aa0c301bf8d
cu/TimeZoneNames.java
til/ZoneInfoDB.java
ee257d971aa3376a7ae6e7c471107dc5692b8e3b 25-Apr-2013 Elliott Hughes <enh@google.com> am cf2377ac: Merge "Fix getLocalAddress on closed sockets."

* commit 'cf2377ac3d8953131d1416e955ebbb7ef042a0ab':
Fix getLocalAddress on closed sockets.
255a6f4ab321614ed1ca26849d1df7fa9c0610f5 25-Apr-2013 Elliott Hughes <enh@google.com> Fix getLocalAddress on closed sockets.

Bug: https://code.google.com/p/android/issues/detail?id=54072
Change-Id: Ie32708054f584885ec85dd7847c128d48ff6c7d5
o/IoBridge.java
7136112095f720a2e5075c61d27e6ead20967184 23-Apr-2013 Alex Klyubin <klyubin@google.com> am a8abf674: Merge "Add kernel CAP_ constants to libcore.io.OsConstants."

* commit 'a8abf674b008de7a0d85046c5d99757ecbba9989':
Add kernel CAP_ constants to libcore.io.OsConstants.
a8abf674b008de7a0d85046c5d99757ecbba9989 23-Apr-2013 Alex Klyubin <klyubin@google.com> Merge "Add kernel CAP_ constants to libcore.io.OsConstants."
63be5872f6dd0b7c4100a759605878181f133649 23-Apr-2013 Elliott Hughes <enh@google.com> am 0451730f: Merge "More 64-bit fixes for libcore native code."

* commit '0451730faea2642b759d22134a6f35dc394aa555':
More 64-bit fixes for libcore native code.
1e5d730e58d94c3bfa14b7dde5ab3981fe5a170b 23-Apr-2013 Elliott Hughes <enh@google.com> More 64-bit fixes for libcore native code.

Change-Id: Id296613590f7ccfc7b5880b27418fe3f5d511974
cu/CollationElementIteratorICU.java
cu/NativeBreakIterator.java
cu/NativeCollation.java
cu/NativeDecimalFormat.java
cu/NativePluralRules.java
cu/RuleBasedCollatorICU.java
9e0ca15905414dd4cbfe73844b0266df6eb15250 19-Apr-2013 Alex Klyubin <klyubin@google.com> Add kernel CAP_ constants to libcore.io.OsConstants.

Change-Id: I8fecdc55b2cf0041ceed643eb48df53d22ecd600
o/OsConstants.java
d4db2419b59778e8186b4ccfe8bddb7105755637 09-Apr-2013 Elliott Hughes <enh@google.com> am c5f08830: Merge "Revert "Revert "Clean up some code that\'s dead now we\'re using OkHttp."""

* commit 'c5f088304766357ba8efae909bef6e5abc09c1f0':
Revert "Revert "Clean up some code that's dead now we're using OkHttp.""
4f97bfe0d9e6f4bdb43fff91f341f4722af16301 09-Apr-2013 Elliott Hughes <enh@google.com> Revert "Revert "Clean up some code that's dead now we're using OkHttp.""

This reverts commit 7653089cb7609f6269aecd68e839c40941cb1a46

Change-Id: Ie3c0fd1f5d51d61e55ec3a581464943e63716b38
o/DiskLruCache.java
o/IoUtils.java
79bb81a750db6903bcf4c30f4d932b665c780bfb 09-Apr-2013 Elliott Hughes <enh@google.com> am 7fb1734e: Merge "Revert "Clean up some code that\'s dead now we\'re using OkHttp.""

* commit '7fb1734e4563a9692c60dd8438802f77638b32c0':
Revert "Clean up some code that's dead now we're using OkHttp."
7653089cb7609f6269aecd68e839c40941cb1a46 09-Apr-2013 Elliott Hughes <enh@google.com> Revert "Clean up some code that's dead now we're using OkHttp."

This reverts commit a77a6f93de75a1d9c51ea142013c5fd54c85a359

Change-Id: If6cfe5031efd2d36eae4af5774757667efcb67a2
o/DiskLruCache.java
o/IoUtils.java
ab8b0a1a683838ef18dfb649774d055300074a98 08-Apr-2013 Elliott Hughes <enh@google.com> resolved conflicts for merge of 574b4df2 to jb-mr2-dev-plus-aosp

Change-Id: I3b480aadccbdad9c9500ae5850604e54e245868c
d73125843c4cc102abf62057396b1741278b8364 08-Apr-2013 Elliott Hughes <enh@google.com> am c9c9e38d: Always throw IOException in IoUtils.deleteContent.

* commit 'c9c9e38d3f85a9ad0fda7c59b342eb461ab23eb8':
Always throw IOException in IoUtils.deleteContent.
a77a6f93de75a1d9c51ea142013c5fd54c85a359 08-Apr-2013 Elliott Hughes <enh@google.com> Clean up some code that's dead now we're using OkHttp.

Change-Id: I4b85c2419e73dc15f921157ce3221225a06b30bf
o/DiskLruCache.java
o/IoUtils.java
c9c9e38d3f85a9ad0fda7c59b342eb461ab23eb8 08-Apr-2013 Elliott Hughes <enh@google.com> Always throw IOException in IoUtils.deleteContent.

This way, if there's some I/O problem that means we can't set up an
HTTP cache, the app can stumble on cacheless rather than fail to start.

Bug: 8270511
Change-Id: I48331151e4f649a6c8120daf03424708cb409fbe
o/IoUtils.java
50bccad67cef5cebdd87d8fecb129b74d349ba53 03-Apr-2013 Brian Carlstrom <bdc@google.com> am 9dfbc2ec: Merge "Switch to OkHttp as URL\'s preferred HTTP implementation."

* commit '9dfbc2ec351f07b3e0215286d85541f4cd6d1b63':
Switch to OkHttp as URL's preferred HTTP implementation.
2503556d17b28c7b4e6e514540a77df1627857d0 30-Mar-2013 jwilson <jwilson@squareup.com> Switch to OkHttp as URL's preferred HTTP implementation.

Change-Id: Id724b75dd78b68ed00f5db4989c4070896996ec0
et/http/AbstractHttpInputStream.java
et/http/AbstractHttpOutputStream.java
et/http/Challenge.java
et/http/ChunkedInputStream.java
et/http/ChunkedOutputStream.java
et/http/FixedLengthInputStream.java
et/http/FixedLengthOutputStream.java
et/http/HeaderParser.java
et/http/HttpConnection.java
et/http/HttpConnectionPool.java
et/http/HttpEngine.java
et/http/HttpHandler.java
et/http/HttpResponseCache.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsHandler.java
et/http/HttpsURLConnectionImpl.java
et/http/RawHeaders.java
et/http/RequestHeaders.java
et/http/ResponseHeaders.java
et/http/RetryableOutputStream.java
et/http/UnknownLengthHttpInputStream.java
0fa4d2c52c874ac710e5195978ec0b833c5050ae 29-Mar-2013 Elliott Hughes <enh@google.com> am 236ab1f1: am 589d6f45: Merge "Use longs instead of ints to store pointers in NIO buffers."

* commit '236ab1f11ae3beaa9fee4c01e8f541429cd0bf62':
Use longs instead of ints to store pointers in NIO buffers.
0121106d9dc1ba713b53822886355e4d9339e852 28-Feb-2013 Joel Dice <joel.dice@gmail.com> Use longs instead of ints to store pointers in NIO buffers.

This allows the code to be used on 64-bit VMs.

Change-Id: I4d01bfcd0ffea528c6179687771d047fdcb4d18a
o/Memory.java
o/MemoryMappedFile.java
o/NioBufferIterator.java
0e8970748c8c78c7efd70cd642881dd99a8adeb3 29-Mar-2013 Elliott Hughes <enh@google.com> am 02b995fe: am 79ad9308: Merge "Add strsignal(3) to Libcore.os."

* commit '02b995fe022262734629fe130fae9e5918eda265':
Add strsignal(3) to Libcore.os.
763f8ed6195707d0c30bfae1ca8a3bb886b746cc 29-Mar-2013 Elliott Hughes <enh@google.com> Add strsignal(3) to Libcore.os.

Bug: 8322568
Change-Id: Iab9a782181a663719b88f090f474b66d24b69258
o/ForwardingOs.java
o/Os.java
o/Posix.java
0b2e0fc3b8b8886cfebd27d279383d8cae61102d 25-Mar-2013 Elliott Hughes <enh@google.com> am e6a128b5: am e8f2e494: Merge "MimeUtils\' list of MIME types should be in order of popularity."

* commit 'e6a128b59420dfe26a5927bedd7d37b482f95681':
MimeUtils' list of MIME types should be in order of popularity.
3b6a38d45a9e66be873909694021fa18a4670474 25-Mar-2013 Elliott Hughes <enh@google.com> MimeUtils' list of MIME types should be in order of popularity.

So mp3 really ought to be the first choice for audio/mpeg.

Bug: https://code.google.com/p/android/issues/detail?id=53598
Change-Id: I90fb45c0a71ae4b4b4a81357507ac188cbf19919
et/MimeUtils.java
48394b6e85c73211974ef3acad27b85aad22dc8d 22-Mar-2013 Elliott Hughes <enh@google.com> am 9ec78ca6: am ad5dc53f: Merge "Remove EWOULDBLOCK from libcore."

* commit '9ec78ca6374af9e405c0545683f0d2a644e0f7bf':
Remove EWOULDBLOCK from libcore.
f4a4259d8a548ab172ca98b702feafcd0ceb1411 22-Mar-2013 Elliott Hughes <enh@google.com> Remove EWOULDBLOCK from libcore.

On Linux, EWOULDBLOCK == EAGAIN, and having a synonym is just confusing.

Change-Id: If53c4ba6d82eed2236dec12003c4c9512c4ecbee
o/IoBridge.java
o/OsConstants.java
0fde03fc4507c6e17cf511c8a1c5a4f96a9cf958 21-Mar-2013 Elliott Hughes <enh@google.com> am 933cb9ea: am 0f7e3bb4: Merge "Add support for Unix domain sockets."

* commit '933cb9eaab75744547d55f57045a685b76c69bd0':
Add support for Unix domain sockets.
482a3fc5635ac431b8a7476d7fe3397af4c2e8ec 21-Mar-2013 Elliott Hughes <enh@google.com> Add support for Unix domain sockets.

Bug: 6513075
Change-Id: I0b0166f59745ac8175b39d7796c093041b2df4fd
o/ForwardingOs.java
o/Os.java
o/OsConstants.java
o/Posix.java
o/StructUcred.java
348b7f8b5b147fcba5c120d9070d8f751f4d8df8 18-Mar-2013 Jay Shrauner <shrauner@google.com> Wrap AlphabeticIndex get/setMaxLabelCount

Add JNI wrappers for AlphabeticIndex::get/setMaxLabelCount. ICU 51 default
maxLabelCount is 99; need to be able to increase this to support labeling
secondary languages.

Bug:5356921
Change-Id: I8819e8e1fa080ba4aa06bf616722d059c8a6f9ae
cu/AlphabeticIndex.java
51cf1b49bca54ec0229a51df400ad1bee580b1bb 16-Mar-2013 Brian Carlstrom <bdc@google.com> Assorted socket fixes related to test_SSLSocket_setSoWriteTimeout failure investigation

1.) Fixed the failure of libcore.javax.net.ssl.SSLSocketTest's
test_SSLSocket_setSoWriteTimeout by setting send/recv buffer sizes earlier (b/8272932)
2.) Fixed javadoc bug in java.net.Socket
3.) Fixed implementation bug in IoBridge affecting reading SO_RCVBUF
4.) Fixed bug where we would leave unsent bytes in OpenSSL write buffer after SSLSocket write
possible cause of b/6693087

Bug: 8272932
Bug: 6693087
Change-Id: I54e084e58e8b10583a6ac3051d5e05e519139d64
o/IoBridge.java
dad6760aedf4c6b29b47dea6352d88fc3df9b2e5 15-Mar-2013 Elliott Hughes <enh@google.com> Return Olson ids from TimeZoneNames.forLocale in zone.tab order.

Bug: 8391426
Change-Id: I7b1335a8d8e0c804d68c85b18b1c4891ec269c1d
cu/TimeZoneNames.java
til/ZoneInfoDB.java
78af00c336f82170d6497741688b0cbe032b7911 07-Mar-2013 Jay Shrauner <shrauner@google.com> Add JNI wrappers for ImmutableIndex

Add JNI wrappers for AlphabeticIndex.ImmutableIndex from ICU 51.

(cherry-pick of 57ff266fa4bfe233c99ac97479bfbd82c977371f.)

Change-Id: I6fd2fd4d1fe33cfac8d932ad7ba080ebe42a45dc
cu/AlphabeticIndex.java
60b997f1a60b754cfa15f7b6ea7f1c3dadfaf43e 28-Feb-2013 Joel Dice <joel.dice@gmail.com> use longs instead of ints to store pointers in NativeDecimalFormat

This allows the class to be used on 64-bit VMs.

Change-Id: Ie32d72f2f3c80d34a3da0fa08fcd96ed45793473
cu/NativeDecimalFormat.java
15d82808bab24f399a034d086f587d5fab32522e 27-Feb-2013 Elliott Hughes <enh@google.com> Make the CLDR version available.

Change-Id: I745b0153ae1dd9eb24dc02b19ac5ab34638a07e3
cu/ICU.java
ac7cf58962995825464af08ae6fa5e006c94f3fa 27-Feb-2013 Elliott Hughes <enh@google.com> Switch to using icu4c 50's TimeZoneNames API.

This takes us down from ~330ms/locale on prime to ~70ms/locale.

This also fixes a bug in DateFormatSymbols.getZoneStrings and adds a test
so we don't regress.

Change-Id: I13663a659666c0a7d87a299235b75fa4e9fef69d
cu/TimeZoneNames.java
cu/TimeZones.java
1c025319e6fea7b68817a59f0a103dcf02672c8d 16-Feb-2013 Jay Shrauner <shrauner@google.com> Persist Transliterator objects with JNI wrappers

Hold a reference to created Transliterator objects.

(cherry-pick of f273ce458c68f5f2b468927392aededc52b8d814.)

Change-Id: I8d68280be0ffb84f3039338eb8b52b07e23296f1
cu/Transliterator.java
72484cceb306ec3e197a8aba11374a6b24e9bfae 14-Feb-2013 Jay Shrauner <shrauner@google.com> Add additional AlphabeticIndex methods

Wrap AlphabeticIndex getBucketCount and addLabels(UnicodeSet) methods.

(cherry-pick of a7eab938026a211a8065b5c695080a6cdd7055a1.)

Change-Id: I02d89aac3345548441f81e505138f921f6fcbd94
cu/AlphabeticIndex.java
798f855f67b74d481346d9dc2293ba0eedd8daf9 05-Feb-2013 Nick Kralevich <nnk@google.com> Add support for Libcore.os.exec*()

Add Libcore support for execv() and execve().
This allows java programs to execute other programs
without having to write jni wrappers.

Change-Id: I82ddc069b5812ebd40f06b7f65ce173d496e0597
o/ForwardingOs.java
o/Os.java
o/Posix.java
860b3c5989a8dd9de73639d8057443aa12fe7b16 05-Feb-2013 Elliott Hughes <enh@google.com> Add libcore.icu.AlphabeticIndex.

Change-Id: I06a634199ff2c8dcf0a8b6e4774da4cdbfb0d774
cu/AlphabeticIndex.java
cu/Transliterator.java
3aac4ddc4d17c07fa8b4908069d23d5401a77993 05-Feb-2013 Elliott Hughes <enh@google.com> Add icu4c-backed transliteration.

Change-Id: I4194810646a2a0661331aaf941fb5f99ce7758b1
cu/Transliterator.java
cd8a6ed093ef3746451c18538b193f55320c5368 29-Jan-2013 Elliott Hughes <enh@google.com> Don't rely on fallback time zone names starting "GMT".

I can't think of a way to say what I actually want to say here, so let's
just wait for icu4c 50 and hope we can rewrite all this code with the new
TimeZoneNames API. Until then, various locales -- those whose gmtFormat
doesn't start "GMT" -- still have the bugs that the previous change fixes
for the majority of locales.

Also switch from "Samoa Summer Time" to "Samoa Daylight Time" because that's
what CLDR is proposing to go with.

Change-Id: I47e2fc413ccde6af59f51e5ec79e664a1dc8be82
cu/TimeZones.java
51f50987458f4b9c3bf3d53f829331a335f67113 19-Jan-2013 Elliott Hughes <enh@google.com> Always throw a SocketException from isConnected.

Either a SocketTimeoutException if it's a timeout, or a ConnectException
otherwise.

Bug: 6819002
Change-Id: I06da843bd4dd9a3492f9f1ec3e6cb36fe86ae776
o/IoBridge.java
4f32b7933626e100fca505484f8b4636f3342e5e 14-Jan-2013 Elliott Hughes <enh@google.com> Make CLDR's 12- and 24-hour time formats available.

Bug: 7924970
Change-Id: I392e8110885f662f32caae46d961ca6e9e4301d7
cu/LocaleData.java
320d5c30247a4ee3409321e131ff19bbaa89be8a 11-Jan-2013 Elliott Hughes <enh@google.com> Merge "Track redundant ops when opening the cache."
13533d151eb0a768fb5588e29cc5b2012b19b3eb 08-Jan-2013 Elliott Hughes <enh@google.com> Merge "Retry failed redirections when socket is recycled."
48f56e55bb918725a8cba2a698b3040e1bd00200 03-Jan-2013 jwilson <jwilson@squareup.com> Track redundant ops when opening the cache.

See https://github.com/JakeWharton/DiskLruCache/issues/28

Change-Id: I4815aed3b40f0d2599ff12a42853a4947feffbca
o/DiskLruCache.java
fc28f29b0b7e6e295c8680a7e1b89e2d26fe61a7 13-Dec-2012 Vladimir Marko <vmarko@google.com> Performance improvement in DiskLruCache.readJournalLine().

Speed up DiskLruCache.readJournalLine() by avoiding memory
allocations from String.split(). For non-CLEAN lines, we
avoid using String.split() altogether and find separators
explicitly, for CLEAN lines we defer to String.split() and
we optimize the underlying Splitter.fastSplit() overload to
avoid unnecessary allocations itself.

On a test journal with 7347 entries (1099 CLEAN) this saves
about 45-50% from ~250ms. On a test journal with 272 entries
(86 CLEAN) this saves about 35-40% from ~10ms. Measured
loadJournal on GN in a tight loop (file contents cached).

If used without the other DiskLruCache.readJournalLine()
improvements, the Splitter.fastSplit() optimization alone
would provide about 60% of the savings. It should also
speed up other code outside the DiskLruCache.

Change-Id: I1d6c6b13d54d8fcba3081f2bb9df701b58f5e143
o/DiskLruCache.java
19aa40c81c48ff98ccc7272f2a3c41479b806376 18-Dec-2012 Jeff Sharkey <jsharkey@android.com> Retry failed redirections when socket is recycled.

When an HTTP request fails, getResponse() attempts to retry once
if the socket was recycled from a previous request. This extends
that logic to retry failed redirects by marking the connection as
recycled.

http://code.google.com/p/android/issues/detail?id=41576

Change-Id: I5aea566a498e48d753d3893101d14cd4ab76db2b
et/http/HttpEngine.java
et/http/HttpURLConnectionImpl.java
039f7599559fd7e48c354b99dcb94ff391f53349 15-Dec-2012 Elliott Hughes <enh@google.com> Add tcsendbreak(3).

Change-Id: I12821c1ef41100ee83a13fd79c14d9eb16b6adca
o/ForwardingOs.java
o/Os.java
o/Posix.java
eb9689bf8aee71f16fbe22a2c90d25628dd431ec 10-Dec-2012 Elliott Hughes <enh@google.com> Protect broken code against native crashes.

It doesn't make any sense to access Matcher or BreakIterator concurrently from
multiple threads, but we shouldn't crash in native code.

Bug: http://code.google.com/p/android/issues/detail?id=41143
Change-Id: I5d0ed97be50ffb7c6cc281ac6293cf82f17e7b80
cu/NativeBreakIterator.java
cff1616012dc0d56c2da9af2b9b1183e76c7e044 04-Dec-2012 Elliott Hughes <enh@google.com> Add detail messages to all the easy IllegalArgumentException cases.

Noticed during my recent Matcher change.

Change-Id: I415d911b26d0ee548ca04d56bba7fc3d4e6b3f88
cu/NativeDecimalFormat.java
et/http/HttpURLConnectionImpl.java
f2d36fd3243e703464b1be537e059e2c0728ad32 06-Nov-2012 Elliott Hughes <enh@google.com> am 10a09486: Merge "Add setenv(3) and unsetenv(3) to Libcore.os."

* commit '10a094863eaf4d822f6b76be28f86a4905ebae51':
Add setenv(3) and unsetenv(3) to Libcore.os.
895a613aa2aec6aa6d03b29755cf2fea584909ad 06-Nov-2012 Elliott Hughes <enh@google.com> Add setenv(3) and unsetenv(3) to Libcore.os.

Change-Id: Ic1c667cda3203afecb3eb9b4183ec6a4013988cc
o/ForwardingOs.java
o/Os.java
o/Posix.java
028ad9ba399b09050866e6b369f6e72879b45b3a 05-Nov-2012 Elliott Hughes <enh@google.com> am df0d0295: Merge "Make System.loadLibrary use open(2) rather than stat(2)."

* commit 'df0d029524bc6f4aa6212e8d0e337b590731c7a4':
Make System.loadLibrary use open(2) rather than stat(2).
6d17baa25d349e2659eb16fe5eef3088d48e5e22 05-Nov-2012 Elliott Hughes <enh@google.com> Make System.loadLibrary use open(2) rather than stat(2).

This will let us remove read permission from directories containing .so files.

Bug: 6485312
Change-Id: I72daa265ce54747fc91cdb9d915a05a2464041bb
o/IoUtils.java
de8ef23966e922de5176c49b80c7cc65d5ed6228 23-Oct-2012 Elliott Hughes <enh@google.com> am b6cf9117: Merge "Support zone.tab in libcore, and remove the file format version."

* commit 'b6cf91174c142ff218b15124a5ff46dbfbe920fc':
Support zone.tab in libcore, and remove the file format version.
8d5562828a5dda6ae0fbe5ba0355a95e650e3d2e 22-Oct-2012 Elliott Hughes <enh@google.com> Support zone.tab in libcore, and remove the file format version.

Bug: 7012465
Change-Id: I2ac580094928806abcf7c6f5f0e6ee950a954135
til/ZoneInfoDB.java
d0649784a269aa03451c603d977188d4b932778b 22-Oct-2012 Elliott Hughes <enh@google.com> am bce53b55: Merge "Make libcore look in /data/misc for tzdata updates."

* commit 'bce53b5592f653264e7c76b6305fe216965cee23':
Make libcore look in /data/misc for tzdata updates.
4c0cbc2cf60df843387233801784ae43c2cd747c 20-Oct-2012 Elliott Hughes <enh@google.com> Make libcore look in /data/misc for tzdata updates.

Bug: 7012465
Change-Id: Ia452f9c4482d0a75073e6a174f38114525984f15
til/ZoneInfoDB.java
f927ee64aa1e067d5665f464b5a0169081321b1c 19-Oct-2012 Elliott Hughes <enh@google.com> am f1c804db: Merge "Make it possible to share libcore.util.ZoneInfo with bionic."

* commit 'f1c804dbc0147617b63efbdb5e2d981e677bedca':
Make it possible to share libcore.util.ZoneInfo with bionic.
53d000ca7ea62d0e36c9ba7be8c54c4777cabae6 19-Oct-2012 Elliott Hughes <enh@google.com> Make it possible to share libcore.util.ZoneInfo with bionic.

The code that generates the single big file from the directory of
zoneinfo files needs to be able to get the raw offset for each zone,
so we can implement TimeZone.getAvailableIDs(int) cheaply.

Bug: 7012465
Change-Id: Icc8355c086dd8e62589c2930fb7f892feea5a217
til/ZoneInfo.java
til/ZoneInfoDB.java
d7b0268ad57b3cb494c0d2f6ea3cb004338619c3 18-Oct-2012 Brian Carlstrom <bdc@google.com> am b3503014: Merge "Make sure URL.toURILenient throws the proper exception on trailing garbage escape"

* commit 'b35030149c12026711cca308122544103aec35fe':
Make sure URL.toURILenient throws the proper exception on trailing garbage escape
bb1546d2c87c6f7e996a83b6f0efca17453d53db 18-Oct-2012 Brian Carlstrom <bdc@google.com> Make sure URL.toURILenient throws the proper exception on trailing garbage escape

Previously this would throw IndexOutOfBoundsException instead of the proper checked exception.

Bug: 7369778
Change-Id: I4247240b21a98688bd890c53f654f7a030d72717
et/UriCodec.java
71e7cf503e86bc233377f3be56445dcad83704c2 18-Oct-2012 Elliott Hughes <enh@google.com> am 5088f4ce: Merge "Pull libcore\'s time zone data from the new single \'tzdata\' file."

* commit '5088f4ce1c4b733c272cea17e382a0161e1ba9a6':
Pull libcore's time zone data from the new single 'tzdata' file.
5088f4ce1c4b733c272cea17e382a0161e1ba9a6 18-Oct-2012 Elliott Hughes <enh@google.com> Merge "Pull libcore's time zone data from the new single 'tzdata' file."
6cbefca623f55004ba65f11577fc25f92f6297dc 17-Oct-2012 Elliott Hughes <enh@google.com> Pull libcore's time zone data from the new single 'tzdata' file.

Bug: 7012465
Change-Id: I5ce1a372755e31f8882fbfc2ea2b582fec1858b3
til/ZoneInfoDB.java
3c473504c37c2f91053a1099f207ad8b7cc551f4 17-Oct-2012 Brian Carlstrom <bdc@google.com> resolved conflicts for merge of 019ddbbe to jb-mr1-dev-plus-aosp

Change-Id: I0fe3967132ae298c2abe9523884c0205851e732e
9726be51ed6f9695357bc8f11a547d9beaa79fce 16-Oct-2012 Brian Carlstrom <bdc@google.com> Fix Thread.interrupt and PipedInputStream/PipedReader issues found by InterruptedStreamTest

Bug: 6951157
Change-Id: I558f8eb5c435f01c98c080ac38cc7c165e7aee25
o/IoUtils.java
ed23021e0292c42d6471b57cdee3af2e6ad04db7 16-Oct-2012 Elliott Hughes <enh@google.com> am 815d8932: Merge "More "charsetName" consistency."

* commit '815d8932cb41e62d1ee47d4975e9812e2ef72b9c':
More "charsetName" consistency.
be4a7d686edf15a7fbdd00b40cf78cb26d105d0e 16-Oct-2012 Elliott Hughes <enh@google.com> More "charsetName" consistency.

A follow-on to 9b9e9145bc55a47be42a9d3f7ecc9f6b533739b2, after URLDecoder
caused some confusion.

Change-Id: I727dc375593596272d06e177c5dd8002d3e7321c
cu/NativeConverter.java
32c042582b6fc5da2b86db1ca8920c5420edd2be 09-Oct-2012 Elliott Hughes <enh@google.com> am 23719174: Merge "Rewrite NativeBreakIterator to use refreshInputText."

* commit '2371917431e4571c6e6c2ca719f2c00682a566d4':
Rewrite NativeBreakIterator to use refreshInputText.
015843683630bd8e8f060c052ecd2e5a804a8396 08-Oct-2012 Elliott Hughes <enh@google.com> Rewrite NativeBreakIterator to use refreshInputText.

Requires icu4c >= 4.9, or a backport of the fix to icu4c bug
http://bugs.icu-project.org/trac/ticket/8490.

(cherry-pick of db1a2e3641d679faf34ce6532c487ab0236550a1.)

Bug: 7288264
Bug: 7307154
Change-Id: Ic8e5be2d345e2b2aa2873ab9bf35b1273199d227
cu/NativeBreakIterator.java
35b0b4c66d192ee6a060ef58cf5d0cd0e442bd38 05-Oct-2012 Elliott Hughes <enh@google.com> am 2bc9eec8: am e80885fe: Merge "Slim down ZoneInfo.toString."

* commit '2bc9eec85951cf503ba18166ce56bf8a84368a18':
Slim down ZoneInfo.toString.
de3df0418aff29b06ea022b200fbcc687de63a7c 05-Oct-2012 Elliott Hughes <enh@google.com> Slim down ZoneInfo.toString.

Dalvik Explorer can now do a better job of helping examine transition data,
and regular developers don't need to see it. For America/Los_Angeles, for
example, toString used to output 186 lines. Now it just returns:

libcore.util.ZoneInfo[id="America/Los_Angeles",mRawOffset=-28800000,mEarliestRawOffset=-28800000,mUseDst=true,mDstSavings=3600000,transitions=185]

Also fix an incorrect comment from the TimeZone documentation.

Change-Id: I5748845a7b4f911e99a0e1c2e1a0786742288518
til/ZoneInfo.java
ba972096ed669371c24994090501768695f54f8f 05-Oct-2012 Brian Carlstrom <bdc@google.com> am 2429c2ae: am 3c636203: Merge "Fix a bug in tunnel construction and \'Connection: close\' headers."

* commit '2429c2ae6f4c38d589b8dd2a7419fbe02749c628':
Fix a bug in tunnel construction and 'Connection: close' headers.
4bedacd569fed2db56c518ed239412b3fe32245e 20-Sep-2012 Jesse Wilson <jwilson@squareup.com> Fix a bug in tunnel construction and 'Connection: close' headers.

Based on https://github.com/square/okhttp/pull/30
(git fetch git://github.com/square/okhttp.git && git cherry-pick -x b8c51dc5bdc89d5487cbc110d6fe40389de16480)

Bug: http://code.google.com/p/android/issues/detail?id=37221
Change-Id: I5bed33d9ab16002aa38c2f729fa14a2022485469
et/http/HttpEngine.java
5f727a9f94689b1003a80b6e464c9eb6971475ec 04-Oct-2012 Elliott Hughes <enh@google.com> am 26b29f3d: am 9a2a441a: Merge "Add ICU.getBestDateTimePattern."

* commit '26b29f3dc9aaadd0647c28a61156badfd6d96042':
Add ICU.getBestDateTimePattern.
cb1b9026b8aa993785c4d54f686905522b7959b9 04-Oct-2012 Elliott Hughes <enh@google.com> Add ICU.getBestDateTimePattern.

Bug: 7204705
Change-Id: I0c65745178182f992d1d0ba0f0d56768194e2084
cu/ICU.java
025809f0a06ac8218e7c6b519936855f4d2a9686 01-Oct-2012 Elliott Hughes <enh@google.com> am 1fe7285c: am 4b606b12: Merge "Posix_umask: throw IllegalArgumentException on malformed mask"

* commit '1fe7285cdbe0625119bf3f2452c5811ef82039c5':
Posix_umask: throw IllegalArgumentException on malformed mask
c79d3ef4dcd25f0e264bf957861e2632da93e62d 27-Sep-2012 Nick Kralevich <nnk@google.com> Posix_umask: throw IllegalArgumentException on malformed mask

If we see an invalid umask, throw an IllegalArgumentException.
This prevents a native crash when FORTIFY_SOURCE is enabled and
the java umask method is used improperly.

Change-Id: I21aae48500df5e7081b63601123dd40070b4ff05
o/Posix.java
bc049016ee71735211cf0d3e4ac34a531e8fe5ba 29-Sep-2012 Elliott Hughes <enh@google.com> am 05d71b4b: am 1235166d: Merge "Rewrite NIO Pipe to use socketpair(2)."

* commit '05d71b4bb57bd741214b15ea838770adb5ff688b':
Rewrite NIO Pipe to use socketpair(2).
3218082325b6b8713a8ac15731482e3da86a7df9 29-Sep-2012 Elliott Hughes <enh@google.com> Rewrite NIO Pipe to use socketpair(2).

Our Pipe originally used socket(2) to create AF_INET/AF_INET6
sockets. This was clearly a bad idea.

I rewrote it to use socketpair(2) and AF_UNIX, but this was
before the big "expose POSIX" rewrite, so it required a bunch
of hacks in the native code, so I went with pipe(2) instead.

The trouble with pipe(2) is that we end up using FileChannel
to implement the Pipe.SinkChannel and Pipe.SourceChannel, but
the kernel won't wake a read(2) on a pipe if another thread
calls close(2) on it, so we started failing interrupt tests.

This (final?) rewrite is hopefully the best of all worlds:
we don't have any INTERNET permission needs, the code is as
simple as the pipe(2) code, and interruption works.

Bug: 7084342
Bug: 2735373
Bug: http://code.google.com/p/android/issues/detail?id=9431
Change-Id: If3f052c9d3f5aa1c099f5a069ace9a8d6ce3ca3a
o/BlockGuardOs.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
a770cc51537499170a77f7c97cf832ccc7438b92 25-Sep-2012 Brian Carlstrom <bdc@google.com> am 2c5e9434: am baf61cbc: Merge "Strip content length in requests with "transparent" gzip handling."

* commit '2c5e94343c276c431735b566ad02e884b120a77c':
Strip content length in requests with "transparent" gzip handling.
f9d60aed414ae21811a6488f603333517f257b22 24-Sep-2012 Narayan Kamath <narayan@google.com> Strip content length in requests with "transparent" gzip handling.

We need to strip both the Content-Length and the Content-Encoding
for such requests. In such requests, it will be the length of the
compressed response. We hide the fact that compression is taking place
from clients, so we shouldn't give them the content length either.

Change-Id: I80713ab33143945c5e2656f478d83cc9e60226a8
et/http/HttpEngine.java
et/http/ResponseHeaders.java
abfee56fa51ed8533a822b0e5c8ecae1333d9abe 21-Sep-2012 Elliott Hughes <enh@google.com> am 2682316c: am c87dc489: Merge "Add setsid."

* commit '2682316ccbfb1e154fd9d14d5813c805e78be885':
Add setsid.
6c9b5377550a9649ed1532d1fcdfeba116c74ead 21-Sep-2012 Elliott Hughes <enh@google.com> Add setsid.

See "Monkey not handling SIGHUP signal" (https://android-review.googlesource.com/43053).

Change-Id: Ib327702caefa8eb8d044723c270acfe4685c7551
o/ForwardingOs.java
o/Os.java
o/Posix.java
78f02b883864a64338854522731ec15174a093e2 21-Sep-2012 Elliott Hughes <enh@google.com> am f0f825cb: am 90bdb9da: Merge "Fix LocaleData.toString once and for all."

* commit 'f0f825cb720cd905a3b966d5cef35d73f87b6d24':
Fix LocaleData.toString once and for all.
0ab0d54b1615fa0b074978f0b5a669b5327294c8 21-Sep-2012 Elliott Hughes <enh@google.com> am 63529068: am 82d74983: Merge "Fix a native memory leak in SimpleDateFormat cloning."

* commit '63529068e9655252a46b372fa8919c59177fb453':
Fix a native memory leak in SimpleDateFormat cloning.
66e8297c70daaf001ca199e4e4ad3ba5283396d2 21-Sep-2012 Elliott Hughes <enh@google.com> Fix LocaleData.toString once and for all.

Change-Id: I207a3226470557ac26caba165ef35f5df6859273
cu/LocaleData.java
til/Objects.java
34a3a0501220dd62b88ddb4a355bad46b15c25a2 21-Sep-2012 Elliott Hughes <enh@google.com> Fix a native memory leak in SimpleDateFormat cloning.

We didn't use the regular finalization idiom in NativeDecimalFormat because
Formatter used to create a lot of these objects, and we wanted to be able to
close them manually rather than clogging up the GC. We've since rewritten
the Formatter code so this is no longer relevant, but we left the finalization
in the wrong class.

Tested with a "while (true) sdf.clone();" loop and ps(1).

Bug: http://code.google.com/p/android/issues/detail?id=37607
Change-Id: I0c435edf8c1bced00ebf04bd7187883344e971e7
cu/NativeDecimalFormat.java
5ab2ad7ebf828d06710868f33458fb1fbe1aa50b 19-Sep-2012 Geremy Condra <gcondra@google.com> Migrate PinFailureLogger to use the DropBox.

Also change the DropBox add* methods to be static, since they can be.

Change-Id: Iedab6948754dfc0db5d432a918bdc6297e3b8f02
o/DropBox.java
aeb2d41a75b5df69711b4dd5e4ec53190c14e657 19-Sep-2012 Geremy Condra <gcondra@google.com> Add dummy DropBox to libcore.

Bug:7190096
Change-Id: Iacd3321153c53c80353e61d8626e8f435091c9d5
o/DropBox.java
1c55af74baacee33ae662f65c07c1d9598a76524 18-Sep-2012 Kenny Root <kroot@google.com> am 0101812e: am e2f9b2c6: Merge "OsConstants: add O_NOFOLLOW"

* commit '0101812e9af94e69ac3aecbee949742796d00fd3':
OsConstants: add O_NOFOLLOW
e2f9b2c638367125899bf38576d24c6c807424e5 18-Sep-2012 Kenny Root <kroot@google.com> Merge "OsConstants: add O_NOFOLLOW"
dd538c3bbd85d14ccae83ab3b384b2ebcc4a4c13 18-Sep-2012 Kenny Root <kroot@google.com> OsConstants: add O_NOFOLLOW

Change-Id: I91619191d83ca8e0a13d30588f761e4defefc30d
o/OsConstants.java
d43b9ef11a1095967a3396b246639b563e1a4128 12-Sep-2012 Kenny Root <kroot@google.com> Add consistent reasons for NullPointerException

Semi-automated replacement of empty and non-conforming
NullPointerException reason messages.

(cherry-pick of 86acc043d3334651ee26c65467d78d6cefedd397.)

Change-Id: I6d893979f5c20a50e841e32af9fd7b2d8bc9d54d
cu/NativeIDN.java
cu/RuleBasedCollatorICU.java
o/StrictLineReader.java
et/UriCodec.java
til/BasicLruCache.java
86acc043d3334651ee26c65467d78d6cefedd397 12-Sep-2012 Kenny Root <kroot@google.com> Add consistent reasons for NullPointerException

Semi-automated replacement of empty and non-conforming
NullPointerException reason messages.

Change-Id: Iedeb4b21949e973c4042ce5982dda315f2e785e1
cu/NativeIDN.java
cu/RuleBasedCollatorICU.java
o/StrictLineReader.java
et/UriCodec.java
til/BasicLruCache.java
e88bbba97a2a68287b93fecba822d11f272325b7 12-Sep-2012 Geremy Condra <gcondra@google.com> Added event logging to PinListEntry.

This is done by adding a stub EventLogger that writes to the
usual logs if not overriden by the framework. If it has been
then we will wind up writing the code + Objects to the event
log.

cherry-picked from 52dc295e93679baa72f95b5b873dd21d5a2ccb32

Change-Id: I2c887c233d019910c9b018c4639a36c0808efc02
o/EventLogger.java
bb5816aa1626eb2f6263bd21479600b114c8a1bd 10-Jan-2012 Johan Redestig <johan.redestig@sonymobile.com> Make FileDescriptor.sync() work on ttys

fsync on Linux fails on tty file descriptors. This change
adds the capability to make sure all data was written to the
terminal device descriptor to java.io.FileDescriptor.sync()
implementation.

Also fixed the return value from Posix_isatty. isatty
returns 1 if an fd is a tty and 0 otherwise.

Change-Id: I6cc65db83f523b4c31b67b48d7534e18af0989e8
o/ForwardingOs.java
o/Os.java
o/Posix.java
7695a9b3261bfee3a810e0829bd8082fe1fcb6a4 30-Aug-2012 Brian Carlstrom <bdc@google.com> Disable SSL compression

Bug: 7079965

Change-Id: I8e060a827613e212bbcced66507fbf124bb04543
et/http/HttpConnection.java
44f7875f2985d7944c5afecc8394ad9f2219c806 16-Aug-2012 Elliott Hughes <enh@google.com> Add chown, fchmod, fchown, lchown, and umask.

Bug: 6141031
Bug: 3107501
Change-Id: I3f514f615b397f57340066f26d43320fb3c219fa
o/ForwardingOs.java
o/Os.java
o/Posix.java
ac665275e161fab8ecd4225e73e159a9edf10501 23-Jul-2012 Vladimir Marko <vmarko@google.com> Performance improvements: DiskLruCache, HttpResponseCache.

Add StrictLineReader for efficient reading of lines
consistent with Streams.readAsciiLine(). Use this to improve
DiskLruCache.readJournal() and initialization of
HttpResponseCache$Entry from InputStream.

(cherry-pick of e03b551079aae1204e505f1dc24f2b986ef82ec0.)

Bug: 6739304
Change-Id: If3083031f1368a9bbbd405c91553d7a205fd4e39
o/DiskLruCache.java
o/StrictLineReader.java
et/http/HttpResponseCache.java
c4e0797a4dd028d23e788da15c3055f83f6f37d5 15-Aug-2012 Elliott Hughes <enh@google.com> Revert "Revert "Add support for returning the CLDR "Yesterday", "Today", and "Tomorrow" strings.""

This reverts commit 73dc486a74a67ce375e3d90dcfaa6b5255b7c0da

I've added code to handle falling back to parent locales to find relative
day names.

Change-Id: Iec2eebb62c0cbb5f6ce625365de514d80ddc05f7
cu/LocaleData.java
73dc486a74a67ce375e3d90dcfaa6b5255b7c0da 15-Aug-2012 Elliott Hughes <enh@google.com> Revert "Add support for returning the CLDR "Yesterday", "Today", and "Tomorrow" strings."

This reverts commit 774294d74fe02e2b5040fcc2feb9f9d0913a4c77

This patch didn't work for locales that didn't explicitly specify values (and relied on fallback), and caused hard failures in those cases.

Change-Id: I7e3a45cc4d39317c8e523c2ee951c49e0aa8e811
cu/LocaleData.java
774294d74fe02e2b5040fcc2feb9f9d0913a4c77 15-Aug-2012 Elliott Hughes <enh@google.com> Add support for returning the CLDR "Yesterday", "Today", and "Tomorrow" strings.

This will let us remove a little more of the duplicate (and unmaintained)
CLDR data from frameworks/base.

Change-Id: Idbdb755e8469bb46e7597775ed2139c47de24b39
cu/LocaleData.java
ad66a888b2e48b1a185de1b3c73fd01383a1fd04 06-Aug-2012 Elliott Hughes <enh@google.com> Offer "J" in addition to "January" and "Jan".

The frameworks/base XML had out-of-date copies of this CLDR data, which
isn't accessible via SimpleDateFormat. Offer the strings direct from icu4c
so we can use them in frameworks/base.

Change-Id: If97dac05bcbb36542b209b19ae590e8b30aedb7b
cu/LocaleData.java
48b00f0d52cdce981c197e67e46a61af31d8648f 31-Jul-2012 Elliott Hughes <enh@google.com> Merge "HttpResponseCache should return 504, not 502."
fddea0213028dd6d467f316584fac0f6e0745ce9 31-Jul-2012 Elliott Hughes <enh@google.com> HttpResponseCache should return 504, not 502.

The RFC seems pretty clear on this issue.

Bug: http://code.google.com/p/android/issues/detail?id=28294
Change-Id: Ia9a979e1fbbd8b38b1607059c042e0fc9ca44270
et/http/HttpEngine.java
78c3de051d68b703af480778c100ca335690b250 30-Jul-2012 Elliott Hughes <enh@google.com> Fix TimeZone's handling of Australia/Lord_Howe.

Australia/Lord_Howe has a half hour difference between standard and daylight
time, rather than the usual hour. Our ZoneInfo implementation ignored this.
Fix that oversight, make SimpleDateFormat actually use this information, and
prevent TimeZone.getTimeZone("GMT") and TimeZone.getTimeZone("UTC") from
being quite as expensive as they accidentally were.

Longer term I think we should probably remove all uses of getDSTSavings from
libcore in favor of TimeZone.getOffset, but this is probably a useful step
forwards anyway. It fixes Australia/Lord_Howe in the meantime and it means
that anyone else who's using getDSTSavings won't be bitten (even if they too
really ought to be using TimeZone.getOffset).

Bug: 4723412
Bug: http://code.google.com/p/android/issues/detail?id=24684
Change-Id: I5d50afecbe1453157e9c8f0b88305a258a3ba2e0
til/ZoneInfo.java
til/ZoneInfoDB.java
c0e9010d03768a745d589e8093fc3d7a056c740b 27-Jul-2012 Brian Carlstrom <bdc@google.com> Merge "Fix HttpURLConnection CloseGuard warning due to lack of close on GZIPInputStream"
8155888a2c4e7cc28596deec28433e1984cfaf11 25-Jul-2012 Brian Carlstrom <bdc@google.com> Fix HttpURLConnection CloseGuard warning due to lack of close on GZIPInputStream

java.lang.Throwable: Explicit termination method 'end' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at java.util.zip.Inflater.<init>(Inflater.java:82)
at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:96)
at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:81)
at libcore.net.http.HttpEngine.initContentStream(HttpEngine.java:523)
at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:831)
at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
at ...

Bug: 6602529
Change-Id: I9b49cbca561f8780d08844e566820087fdffc4d7
et/http/HttpURLConnectionImpl.java
41b15b85a105cc74d8e82441c723134dde674e92 25-Jul-2012 Elliott Hughes <enh@google.com> Merge "Fix URLConnectionTest#test_getAllowUserInteraction."
7d71bf5f6d2a501426357709160416a786be40b6 24-Jul-2012 Brian Carlstrom <bdc@google.com> Merge "Tolerate cache files being removed from underneath DiskLruCache"
3827b65b1937acfbf3abbc449f8ba0ffc60f3cf3 24-Jul-2012 Elliott Hughes <enh@google.com> Fix URLConnectionTest#test_getAllowUserInteraction.

Also improve the documentation, make it possible to run these tests
individually outside of CTS with vogar, and remove a few more URLs of
external web servers.

We should clean up all tests to remove all reliance on external web servers.

Bug: http://code.google.com/p/android/issues/detail?id=35400
Change-Id: I28e78b7375ee554b3afe98e5249676e8bbbbec0e
et/url/FileURLConnection.java
459718ce7114a918efcc7d464e4209dbfade6a86 21-Jul-2012 Brian Carlstrom <bdc@google.com> Tolerate cache files being removed from underneath DiskLruCache

Bug: 6777079
Change-Id: I2f950ab6d847dd63061aeb449fc5d46ab9e6c50a
o/DiskLruCache.java
et/http/HttpResponseCache.java
26010ab930a2cee3bf10b9612cf070183c21228b 24-Jul-2012 Elliott Hughes <enh@google.com> Declare that various Posix methods can throw SocketException.

Bug: 5177516
Change-Id: Icf2f06c7df6686dd1f54a930bc3fa50b1ce4e1d4
o/BlockGuardOs.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
5ec69b20ab9b3e2dcbe225d548168b09afbbbac2 24-Jul-2012 Elliott Hughes <enh@google.com> Clean up ICU error reporting.

Throw all ICU exceptions from the native side, and include the name of the
function that failed.

Bug: 5037042
Change-Id: I49b5493a7e7365226d612479294b5b8f47ec4e8c
cu/ErrorCode.java
cu/ICU.java
cu/NativeConverter.java
b7705a4629bb74a5bb19d97bf0b4dd4c74cecd9e 20-Jul-2012 Brian Carlstrom <bdc@google.com> TLS + SNI + proxy => bug : the SNI at the TLS layer is the hostname of the proxy instead of the hostname in the URL

Bug: http://code.google.com/p/android/issues/detail?id=35050

Change-Id: Ia12f54e0521cf98eac184d80744192c1f782e7c2
et/http/HttpConnection.java
5655e03a7e10b3201b6814dac7b2f6ac5607ebf2 10-Jul-2012 Jean-Baptiste Queru <jbq@google.com> Merge from AOSP

Change-Id: I83f2ba38dca0fa86e9ff802e5df02311f6bc6e99
ebac4e8fcafe084009925cfa7526e73fa4ed0487 06-Jul-2012 Vladimir Marko <vmarko@google.com> Improve HttpResponseCache performance.

Avoid writing to HttpResponseCache.CacheRequestImpl.cacheOut
one byte at a time via inefficient FilterOutputStream write.

(cherry-picked from 91cc423115fdfa682d9c4cd025dee06aaa145b3c.)

Bug: 6738383
Change-Id: Ia657d7417cc292746968809f6896a5e790f1394d
et/http/HttpResponseCache.java
ba4be8f488f5cc416e9914f98e2f5374fa0a004b 29-Jun-2012 Brian Carlstrom <bdc@google.com> am 4ec2d0de: HttpEngine should not attempt to cache proxy CONNECT responses

* commit '4ec2d0dea800397fb32227e0631246f4d2a73191':
HttpEngine should not attempt to cache proxy CONNECT responses
4ec2d0dea800397fb32227e0631246f4d2a73191 29-Jun-2012 Brian Carlstrom <bdc@google.com> HttpEngine should not attempt to cache proxy CONNECT responses

This fixes an issue where a bad proxy repsonse that included a body
would turn into an IllegalStateException instead of an IOException.

Bug: 6754912

Change-Id: I204ad975820693d6add2780d7b77360463e33710
et/http/HttpEngine.java
8ecba5fd3f3ab30aa57caf917963bed50087ea9c 08-Feb-2012 Elliott Hughes <enh@google.com> Fix an ICS DatagramPacket bug.

(cherry-picked from e50d82455c813210a2d452070f45fd38d9903159.)

Bug: http://code.google.com/p/android/issues/detail?id=24748
Change-Id: Id7772c3f27961c99d3e5e3856e79edb84483dd46
o/IoBridge.java
f698461fec300c5e1e9570c882bd5fee0df62aed 01-May-2012 Elliott Hughes <enh@google.com> am 0253fff2: am a42068e9: Merge "BT: Adding support for wrf files to BT OPP"

* commit '0253fff2a77a0db11a1ddd879e222b36aca8a368':
BT: Adding support for wrf files to BT OPP
a42068e945d5c4de5926710d87feaf95969a2001 01-May-2012 Elliott Hughes <enh@google.com> Merge "BT: Adding support for wrf files to BT OPP"
c6d24c6b88ce50c1fa2b9e89253d5839eff1618a 07-Dec-2011 Lukasz Rymanowski <lukasz.rymanowski@tieto.com> BT: Adding support for wrf files to BT OPP

This patch adds support for wrf files to BT OPP.
Proper mime type /application/octet-stream with extension
wrf was added to webkit framework.

Change-Id: I2cdd961a78281129b96fba51d5df37c534c5c893
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
et/MimeUtils.java
e2fda3eb560dd75b6be16e2a8fce3860ce3c4e0f 12-Mar-2012 Brian Carlstrom <bdc@google.com> Make classes accessible to ParsedHeadersTest

Bug: 5835156

(cherry picked from commit 943036db28577070ae5b5fed5051a2e47d95f6ea)

Change-Id: I7a1a9d7ae7003e54847fb2b0e99cc560e1fe34f0
et/http/Challenge.java
et/http/HeaderParser.java
796f0d5a4e7b83c3efc5e587b6766977dc20b0c3 16-Feb-2012 Elliott Hughes <enh@google.com> Fix asynchronous interruption of Socket.connect with a timeout.

Turns out there was one connect variant I hadn't properly addressed.

Bug: http://code.google.com/p/android/issues/detail?id=24318
Change-Id: I7af697bdf6ea17ad1f8ea904d7d8a051ffb970d2
o/IoBridge.java
e636ca4d6bd101324bd95fbc817401e6e0b80a2c 15-Feb-2012 Jesse Wilson <jessewilson@google.com> Introduce an ExtendedResponseCache interface.

We had an ugly bug where HttpEngine was inspecting its response
cache's implementation type, and calling stats tracking methods
if that type permitted it.

This worked for all the libcore tests, but not in practice since
the public HttpResponseCache class WRAPS the libcore HttpResponseCache.
The new interface makes the new APIs called by HttpEngine on its
cache explicit, and permits the public android.net.HttpResponseCache
to implement the API.

Bug: http://code.google.com/p/android/issues/detail?id=25418
Change-Id: Ic9697af96635256e7ffc24f86628a85fbe2defd4
et/http/HttpEngine.java
et/http/HttpResponseCache.java
et/http/ResponseHeaders.java
et/http/ResponseSource.java
df29c7dc69965462cd19de8910b04c8cb463e57f 15-Feb-2012 Jesse Wilson <jessewilson@google.com> Don't attempt to parse an HTTP response body on HEAD requests.

Previously if the response had a Content-Length or Transfer-Encoding
header we assumed it had a body. This was untrue of HEAD requests.
This is not a regression.

Bug: http://code.google.com/p/android/issues/detail?id=24672
Change-Id: I264db2014e681a6f8e93cd40b0f1640c95103d21
et/http/HttpEngine.java
e50d82455c813210a2d452070f45fd38d9903159 08-Feb-2012 Elliott Hughes <enh@google.com> Fix an ICS DatagramPacket bug.

Bug: http://code.google.com/p/android/issues/detail?id=24748
Change-Id: Iafab3a6c55007a47b68af5581148f5556f2fc808
o/IoBridge.java
58d229ebb70c7f6018e7b39c004638b9bdd62e31 26-Jan-2012 Jesse Wilson <jessewilson@google.com> Merge commit 'f41105dc' into manualmerge

Conflicts:
luni/src/test/java/libcore/java/net/URLConnectionTest.java

Change-Id: I8f2bd79b02d1c3315e97e36a59497054ec3e1dc2
a468471e8ccc2f642d5b2ae3c75873a74267ece2 26-Jan-2012 Jesse Wilson <jessewilson@google.com> Don't throw needlessly when returning the CacheResponse.

We were throwing under the premise that we'd always have
response headers before we had a cached body. But when the
user calls connect() we'll have queried the cache but we
won't necessarily have response headers from the server yet.
That's because connect() doesn't require a response to be ready.

Bug: http://b/5920659
Cherry-picked from: I9d69b44b5be3d0e29f14d8b83781f6e65c67582a

Change-Id: Ia403b42ddc9783fd1456164f4b7350da3ce80566
et/http/HttpEngine.java
5f0ed6ed5798a3e6ad642bcd5382b864796cdcb8 25-Jan-2012 Irfan Sheriff <isheriff@google.com> Add support for ARP on RawSocket

Merged from the changes contributed from googletv folks

Change-Id: Ie4c40c96950becbed28fd68cb482d8b3dbebc001
et/RawSocket.java
5b7b7fe6a817fdf058eefd9a716cc58a3283eb05 12-Jan-2012 claireho <chinglanho@gmail.com> Libcore changes for ICU4.8.1.1 upgrade.

This CL includes:
1. Change libcore_icu_ICU.cpp and LocaleData.java to support locale data structures in ICU4.8.1.1.
The new libcore_icu_ICU instantiates ICU objects instead of reading the ICU resource files
directly. This could avoid the code change for future ICU upgrade.
2. Change the libcore tests data caused the test failures from ICU locale data change.

Change-Id: Ia3dfb0a8e5c4ccc2ad110a1ff4211ff97fe5b2ad
cu/LocaleData.java
fa16791091df52c2bbc0dd23eb0828f7fdc384b6 05-Jan-2012 Jesse Wilson <jessewilson@google.com> Fix a copy-paste documentation typo.

Change-Id: I1bebb0338c0ef9efad0a9296c3d1881dcd52ebbe
o/DiskLruCache.java
a9d79f124eb91eab9f7ec8f5fa6b5f64631533a2 04-Jan-2012 Jesse Wilson <jessewilson@google.com> Merge "Rename timestamp to sequenceNumber."
72baec6104b80ff6a6b189dc78968f042f0b91ef 04-Jan-2012 Jesse Wilson <jessewilson@google.com> Merge "Update the response cache on a conditional cache hit"
74bf6bb2f673cee8d2efb50b30de86411b586865 04-Jan-2012 Jesse Wilson <jessewilson@google.com> Rename timestamp to sequenceNumber.

Change-Id: If80f56a1bda637d2af7bc7951df43e84b8515629
o/DiskLruCache.java
e1a8bc9d68de9c0dde414a3a68a34aab4d8a1a33 27-Dec-2011 Jesse Wilson <jessewilson@google.com> Merge "Don't reuse an SSL socket if the socket factory has changed."
5d7e0fc1af3141aa41e9c21d74da3c36b933517f 23-Dec-2011 Jesse Wilson <jessewilson@google.com> Update the response cache on a conditional cache hit

Bug: http://b/4460598
Change-Id: I5f274b2109861b9d2ed59eda8b3e5b4e89fd27b3
et/http/HttpEngine.java
et/http/HttpResponseCache.java
et/http/ResponseHeaders.java
99eefb79fa7c150326290c7b8c3d9973be487605 22-Dec-2011 Jesse Wilson <jessewilson@google.com> Give DiskLruCache an API to edit a snapshot.

When an HTTP conditional GET results in a cache hit (ie. 304 Not Modified)
we want to update the cache's HTTP headers with the server's latest.
Unfortunately prior to this change DiskLruCache had no mechanism to
atomically change a snapshot. This change gives us a mechanism to
upgrade from a snapshot (read only) to an editor (read/write).

Bug: http://b/4460598
Change-Id: I1714fe9ce4291d0c5095460173bc4cf6da6ce9ea
o/DiskLruCache.java
fa5e8dfe3c7ed144b0fbe69091628dedd6a3b961 21-Dec-2011 Jesse Wilson <jessewilson@google.com> Don't reuse an SSL socket if the socket factory has changed.

Bug: http://b/3042192
Change-Id: Iaa9deb69058afcca4ab79ca6ba745c55d1e9321a
et/http/HttpConnection.java
et/http/HttpEngine.java
et/http/HttpsURLConnectionImpl.java
5757cb35ad2e58d7accb7f5d3db6f2d5e72f097d 16-Dec-2011 Jesse Wilson <jessewilson@google.com> Support multiple challenges for HTTP authentication.

This fixes the problem reported in the bug, but we still need
to give attention to the digest scheme. Currently we can't do
Basic auth if the HTTP response contains both a Digest challenge
and a Basic challenge!

Bug: http://code.google.com/p/android/issues/detail?id=19081
Change-Id: Ifffb307678c2afa0db1d50c1ef5fc49ec7769306
et/http/Challenge.java
et/http/HeaderParser.java
et/http/HttpURLConnectionImpl.java
et/http/ResponseHeaders.java
b2b02ac6cd42a69463fd172531aa1f9b9bb887a8 15-Dec-2011 Jesse Wilson <jessewilson@google.com> Change the way we cope with stale pooled connections.

Previously we'd attempt to detect if a connection was stale by
probing it. This was expensive (it relied on catching a 1-millisecond
read timing out with a SocketTimeoutException), and racy. If the
recycled connection was stale, the application would have to catch
the failure and retry.

The new approach is to try the stale connection directly and to recover
if that connection fails. This is simpler and avoids the isStale
heuristics.

This fixes some flakiness in URLConnectionTest tests like
testServerShutdownOutput and testServerClosesOutput.

Bug: http://b/2974888
Change-Id: I1f1711c0a6855f99e6ff9c348790740117c7ffb9
et/http/HttpConnection.java
et/http/HttpConnectionPool.java
et/http/HttpEngine.java
et/http/HttpURLConnectionImpl.java
2d9fa917aae6a6da38e9d1eda05841ffdf8855bb 15-Dec-2011 Jesse Wilson <jessewilson@google.com> Document the effect on timeouts of having both IPv4 and IPv6 addresses

Bug: http://b/3441111

Change-Id: Ib4c2e3e0d8d86eb5eb77cf92a0814c7444fd153f
et/http/HttpsURLConnectionImpl.java
064280307728e963cd9bf08796c8863127254ff0 29-Nov-2011 JP Abgrall <jpa@google.com> am 4ff58546: libcore: BlockGuard: untag socket on close

* commit '4ff585466887785d48c02d14a15dcde64934442b':
libcore: BlockGuard: untag socket on close
ecd3536488a6b5cbbe30104370c8fbd7d941a8cd 25-Nov-2011 Jesse Wilson <jessewilson@google.com> Don't check available() when testing if a socket is stale.

When the HTTP server is well behaved, available() will always
return 0. Any other result would be necessarily bogus; the server
doesn't know what the client is going to request. So this check
wasn't adding anything.

Removing the check has a pleasant side effect of fixing
URLConnectionTest#testServerShutdownOutput, which is failing due
to a bug in PlainSocketImpl.available().

Bug: http://b/5534202
Change-Id: I1c567e91c2bcbe3884dfbefe77ce4b0201a2c0d6
et/http/HttpConnection.java
4ff585466887785d48c02d14a15dcde64934442b 22-Nov-2011 JP Abgrall <jpa@google.com> libcore: BlockGuard: untag socket on close

java.net.Socket creates the socket on connect(). But in case of failure
during the connect() it closes the socket.
During the create, BlockGuard's socket() is the one tagging the socket.
But in case of failure, nobody untags that socket.
So now we untag scokets on close() in BlockGuard

Bug: 5274621
Change-Id: I282665a05e2dc184df77c84ceab49fb55b7695af
o/BlockGuardOs.java
d0d626655f1d452070d3116678037e8759f807f4 10-Nov-2011 Jesse Wilson <jessewilson@google.com> Don't NullPointerException when a URL contains a space.

We end up creating a URI of http://and%20roid which has no host
name part because and%20roid is not a valid host name. It's unclear
where the best place to fail is. This is consistent with the RI
which doesn't fail until it attempts to connect.

Bug: http://code.google.com/p/android/issues/detail?id=16895
Change-Id: Ifa4dc3c651f4627e27622ed5cedfa820f9a35358
et/http/HttpConnection.java
783631d82682027beaf80540ab08912fd56fea0c 29-Oct-2011 Jesse Wilson <jessewilson@google.com> Add a mode to UriCodec to handle invalid URLs without throwing.

Bug: http://code.google.com/p/android/issues/detail?id=21064
Change-Id: I0c0003bbacc5b9680d9f699134c02648e0d6dbea
et/UriCodec.java
0bc188affdcfebaa9bc6c16f0c1de98c734d3c2e 27-Oct-2011 Marc Blank <mblank@google.com> Add pfx extension as "application/x-pkcs12"

* This is what MS Exchange uses when it creates user certificates,
and the Email/Exchange application need to know about the
extension -> mime type mapping

Bug: 5524693
Change-Id: Ie17308070e9ec32446cb6071775b5570f4b40c23
et/MimeUtils.java
e8e19f6476b30ccf9f69925c10ce62efdba4e62a 21-Oct-2011 Elliott Hughes <enh@google.com> Cope with fstat(2) failures during close.

Whatever the root cause of the fstat(2) failure, we should still attempt the
requested close(2) --- even if it's just going to fail in the same way the
fstat(2) did.

Bug: 5407056
Change-Id: Ie988d1b1ebdb6b378fb537b2f56245fab568ee7c
o/BlockGuardOs.java
3e9485649f38c67763d6ffeecb3614c991d8aede 17-Oct-2011 Julien Mercay <jmercay@google.com> Add mime types used by Google Earth

Change-Id: If10cf39515472969a2e57e9a1e00dead818fe771
et/MimeUtils.java
25a753691a80186cd4d7086b12c0e52225d95897 30-Sep-2011 Jesse Wilson <jessewilson@google.com> Fix chunked input stream's available() method to never return -1.

Change-Id: I6ea268e469675ef890010282dbe35ed5838cca73
http://code.google.com/p/android/issues/detail?id=20442
et/http/ChunkedInputStream.java
2ca11d6eae460f94bc42bc2e453fac93f4b94eb0 13-Sep-2011 Jesse Wilson <jessewilson@google.com> Discourage developers from catching subclasses of SocketException.

We recently had a bug in Apache HTTP client where catching a
specific exception subclass caused incorrect behavior. Apache HTTP
expects a ConnectException but we're throwing its superclass,
SocketException. Unfortunately I don't think fixing this to throw
ConnectException is any better; the best I can tell from the spec
this should be throwing a NoRouteToHostException which would still
fail on Apache HTTP client. I'm going to fix that code to catch the
appropriate type.

Bug: http://b/5293809
Bug: http://b/4411922
Change-Id: I189408f6e2355475510fb817c97017e7bae1739e
o/ErrnoException.java
o/IoBridge.java
df84cec32f3c1f71ea781e5f851724d84c35e620 18-Aug-2011 Jesse Wilson <jessewilson@google.com> Fix JarInputStream Manifest parsing.

I recently broke JarInputStream by changing Streams.readFully()
to unconditionally close the input stream when it was exhausted.
Although most streams won't return data after read() returns -1,
both JAR and ZIP streams can return data after a call to get the
next entry.

Change-Id: I2fcef44aaeae0ac27c9fa5a7a4996c5b1b794964
o/Streams.java
ed211506be4a0985678cf099282ed8fe851868fb 15-Aug-2011 Jesse Wilson <jessewilson@google.com> Make HTTP implementation details public for CTS tests.

Our testing tools cannot normally test package-private APIs
because the tests are loaded in a different class loader than
the production classes. This is an unfortunate workaround.

Change-Id: Ic8d9d3088887bccceaf166959468cd52bfef9aae
et/http/HttpEngine.java
et/http/HttpResponseCache.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsURLConnectionImpl.java
et/http/RawHeaders.java
et/http/RequestHeaders.java
et/http/ResponseHeaders.java
9c8130231a0e1c2a5ded68e99f782427bb5326fa 11-Aug-2011 Elliott Hughes <enh@google.com> Use Libcore.os.fstat to recognize socket FileDescriptors in BlockGuard.

Exception throwing is pretty slow, and BlockGuard's isLingerSocket
causes us to throw whenever we close a non-socket fd. Avoid that
by adding a cheap test for socket fds and only calling isLingerSocket
on socket fds.

Bug: 4972558
Change-Id: Ib18d6c0c091cb366f953d7467e83fad570bb3457
o/BlockGuardOs.java
892c36b1c1eee25ad46bac6fffdf129219a5e98d 29-Jun-2011 Philip Milne <pmilne@google.com> Remove the contentEquals() method that was added to java.lang.String.

The public (though hidden) method contentEquals(char[], int, int)
was added to java.lang.String to avoid creating large numbers
of Strings during XML parsing.

That objective is preserved with this change, which uses a private
static method with a similar implementation that goes through the
regular String API.

Change-Id: I808e1ebc4ef6812dd651682628167b4c078af334
nternal/StringPool.java
5112325117859c7c6cd042c17f519f967c551b20 29-Jun-2011 Jesse Wilson <jessewilson@google.com> Move socket tagging to frameworks/base.

Change-Id: I6f6f840d5d5eee6ca2170fc127fd525155dd40b8
o/BlockGuardOs.java
et/http/HttpConnectionPool.java
6230d5d28024440d42adc57c25fb018f2519a51d 21-Jun-2011 Jesse Wilson <jessewilson@google.com> am 64c6c367: Implement the finalizer watchdog.

* commit '64c6c367497c7fcf88e7527022234043e4460758':
Implement the finalizer watchdog.
64c6c367497c7fcf88e7527022234043e4460758 21-Jun-2011 Jesse Wilson <jessewilson@google.com> Implement the finalizer watchdog.

Change-Id: Ia4aaf5f0ef5a2f5f7e6ec3e8b4c4e300c9e1b2ee
http://b/4144865
til/EmptyArray.java
d2dd676be7b9fc0ac49c90a9d0acc437d0010a6e 16-Jun-2011 Fabrice Di Meglio <fdimeglio@google.com> am 4c94a612: Add ICU.getScript()

* commit '4c94a6128d1fcfaa75539b36c9f50d0c75df6144':
Add ICU.getScript()
4c94a6128d1fcfaa75539b36c9f50d0c75df6144 16-Jun-2011 Fabrice Di Meglio <fdimeglio@google.com> Add ICU.getScript()

- needed for RTL support

Change-Id: I03796c25b965403432b79f21ef8ce2f3a4f5566a
cu/ICU.java
9a6483c7b662de1e02b0788214c13f87fc86a2ea 15-Jun-2011 Fabrice Di Meglio <fdimeglio@google.com> am 0452e9ad: Add addLikelySubtags() to ICU

* commit '0452e9adf6fb133b6d3e59ebae2135aa90ad0d5e':
Add addLikelySubtags() to ICU
c5ffd171c861ea2ecae026fe228c8ca8c96c9394 15-Jun-2011 Elliott Hughes <enh@google.com> Merge "Remove the LocaleData.digit field." into dalvik-dev
e2377cdd707b830d07a5708216834f7ac76ee3e1 15-Jun-2011 Elliott Hughes <enh@google.com> Remove the LocaleData.digit field.

ICU 4.6 no longer supports this, which always had the constant value '#'.

Also ensure that we cache all the locale data (not just the zone strings)
for the root locale, en_US, and the user's locale when the Zygote starts
up.

Also improve the ICU JNI code's local reference usage somewhat.

Change-Id: I28692d9484aecc29820c201b08b8bedd3f26df83
cu/LocaleData.java
cu/NativeDecimalFormat.java
cu/TimeZones.java
d8d3329347af700beed67172c77046b5c2ecece2 15-Jun-2011 Jesse Wilson <jessewilson@google.com> Kill another use of TimeZone.useDaylightTime().

I wrote another test to prove the use was incorrect.

Change-Id: I86c5e53c735e7948b96c0d2a87abe21eb9aed876
http://b/2435103
cu/TimeZones.java
0452e9adf6fb133b6d3e59ebae2135aa90ad0d5e 08-Jun-2011 Fabrice Di Meglio <fdimeglio@google.com> Add addLikelySubtags() to ICU

Change-Id: Ied6149b68452db879c902b544b5b69802e35ff8e
cu/ICU.java
e3b6fa2bf357f2712ab2ee9e8487f157595ea0c7 10-Jun-2011 Elliott Hughes <enh@google.com> Expose pread and pwrite.

And fix FileChannel to use them.

Bug: 4183719
Bug: 3107501
Change-Id: I51114a16522b93bf959b5953bec658e6889054c6
o/BlockGuardOs.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
fc041ff241f9a7556e72236f130de0215ecd17db 03-Jun-2011 Elliott Hughes <enh@google.com> Remove support for deprecated IPv4 address formats.

Bug: 4539262
Change-Id: Ic42173b7b06e8536e8c4331087720d7df1e1681a
o/ForwardingOs.java
o/Os.java
o/Posix.java
9b510df35b57946d843ffc34cf23fdcfc84c5220 28-May-2011 Elliott Hughes <enh@google.com> Make ErrnoException a checked exception.

Bug: 4486011
Change-Id: I1877ce593d441653f75ab14884aa2d85f52652ad
o/BlockGuardOs.java
o/DiskLruCache.java
o/ErrnoException.java
o/ForwardingOs.java
o/IoBridge.java
o/IoUtils.java
o/MemoryMappedFile.java
o/Os.java
o/Posix.java
til/ZoneInfoDB.java
ce257b03a1e5ff6075967e6a84cdb439cb2b01c8 27-May-2011 Jesse Wilson <jessewilson@google.com> Clean Up URI's parsing code.

http://b/2753295

Change-Id: I190ee12c14d1b3b17e2c8cb5ef3868618f1ee124
et/UriCodec.java
et/url/UrlUtils.java
2d99ef561304174b8ae01a0a68d5b96d5edb9f10 26-May-2011 Jesse Wilson <jessewilson@google.com> Fix URI to behave more like the spec and browsers and less like the RI.

When computing relative paths from URLs like foo.com/a to foo.com/a/b,
this now uses "a/b" as the relative path and not just "b". That was an
RI bug that we were foolishly compatible with.

Change-Id: I6e3f10d84602c08bbf6bd7c7e43c2ba3387e4c3b
http://b/2753295
et/url/UrlUtils.java
c5727263001f1eae068f7821063d7bfb2da8e24c 26-May-2011 Jesse Wilson <jessewilson@google.com> Use canonicalizePath in URI.

This needs to add another mode to canonicalizePath to not
discard ".." prefixes from relative paths.

Change-Id: I9e0b86bd1e7ab8e5e71c46f1efcf4aeb218e66b2
http://b/2753295
et/url/JarHandler.java
et/url/UrlUtils.java
10527ac8763cc50fa9eca0d4ce495909899f0b9a 25-May-2011 Jesse Wilson <jessewilson@google.com> Parity between URI and URL tests.

Duplication here is unfortunate. It would be a lot of work
to share tests here, since the two classes have necessarily
different behaviors in certain situations. I continue to work
on making the two classes consistent with browsers, which
means they'll be more consistent with each other.

Change-Id: Ic33c414abe1344cdfd1a9b539d9918dcd074f2c6
http://b/2753295
et/UriCodec.java
5292410e4ebf7fb5149eefd2f52fcb94c46690a6 24-May-2011 Jesse Wilson <jessewilson@google.com> Rewrite parsing for java.net.URL.

This fixes many broken cases on handling relative URLs.

We normalize all URLs by default. This will result
in more URL equality than before. Previously the URLs
http://android.com/a/../ and http://android.com/ were not
equal; now they are equal.

Change-Id: I8cf7be2e42eeb1386520be2698d8f14e0a55decb
http://b/4361656
et/http/HttpEngine.java
et/url/FileHandler.java
et/url/JarHandler.java
et/url/UrlUtils.java
2e0aed04f6bef27f2a9e4c46c3310e0b88790396 20-May-2011 Elliott Hughes <enh@google.com> Merge "Move the stuff to bridge between io/net/nio semantics and POSIX semantics." into dalvik-dev
0b736ebc4efef64f2db1999aea90297ad8196146 20-May-2011 Elliott Hughes <enh@google.com> Move the stuff to bridge between io/net/nio semantics and POSIX semantics.

IoUtils should be more generally useful.

Change-Id: I5665f2a94d226ada3077a30045549a53cc741cf0
o/IoBridge.java
o/IoUtils.java
et/RawSocket.java
c8e161cd543d2a327a7db23b8ce8f127b2e2ebae 20-May-2011 Jesse Wilson <jessewilson@google.com> Merge "Support HTTP cookies and header combining." into dalvik-dev
cd8c1dd724036dcd1b7c27542cc4d745391b8d04 20-May-2011 Jesse Wilson <jessewilson@google.com> Support HTTP cookies and header combining.

Change-Id: Ifdf15dc2f551e58bdd6a1aae847f7dec254ac7e8
http://b/3180373
et/http/HttpEngine.java
et/http/ResponseHeaders.java
9e67ca71d3d4a489a157abadc5ba519ced7a0b50 20-May-2011 Elliott Hughes <enh@google.com> Expose waitpid(2).

This lets us move the process reaper up into Java. I've rearranged the code a
bit for the benefit of those looking at stack traces: it's now much clearer
when we're idle because there are no children to wait on, which previously
looked like we were blocked trying trying to report the exit of a child.

Bug: 3107501
Change-Id: I8c5c2952cbdbf9b5a6d8954b4964011d052a90a3
o/ForwardingOs.java
o/Os.java
o/Posix.java
254198c64b687ca088d9d2631e12560e029b7f7b 19-May-2011 Elliott Hughes <enh@google.com> Merge "Expose accept(2)." into dalvik-dev
553d98af897f7202de5e5a776287de0b5ca8fe39 19-May-2011 Elliott Hughes <enh@google.com> Expose accept(2).

The implementation of PlainSocketImpl.accept is made ugly by the fact that the
SocketImpl we mutate may share its FileDescriptor with a SocketChannel, so we
need to mutate the FileDescriptor itself, and can't simply swap in a new one.
I've raised http://b/4452981 to see if we can integrate the nio and io socket
classes more closely, to avoid this kind of mess.

Bug: 3107501
Change-Id: I4964b64c25e936a44d1e4c22504ca29bba247ab6
o/BlockGuardOs.java
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
80f4d25b880b83abfd79474bb0e6fdc4d898f94c 19-May-2011 Jesse Wilson <jessewilson@google.com> Address FindBugs warnings in libcore.net.http

Change-Id: Ia0c4f95e62825a4ed4debac2578d353491a7ff2c
et/http/RawHeaders.java
et/http/RequestHeaders.java
et/http/ResponseHeaders.java
c297a0013b6a926d3e47efe6a73a6ab0f2f6eb89 19-May-2011 Elliott Hughes <enh@google.com> Merge "Implement recvfrom(2)." into dalvik-dev
23ec09188303a874b3b391f96ae0a29af002bff9 19-May-2011 Elliott Hughes <enh@google.com> Implement recvfrom(2).

This one's a little bit hairy because of multiple return values.

Bug: 3107501
Change-Id: I3bd35647d94bb6bc2192d6f31a39ecca07a3926e
o/BlockGuardOs.java
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
et/RawSocket.java
e5eb80e6adaab18ff7372adcd09f9e1af3a76871 19-May-2011 Jesse Wilson <jessewilson@google.com> Make the HttpResponseCache robust to file I/O errors.

If the filesystem fails, cache performance degrades. Ongoing
writes should not see any filesystem errors: don't punish the
writer who isn't benefitting from the cache. Ongoing reads may
see IOExceptions while streaming files. In practice this will
only happen if the directory disappears during use, as is the
case when a removable partition is removed.

Change-Id: Ibf4d51998d9beaba9f8c86c449fd5c97ca869cee
http://b/3180373
o/DiskLruCache.java
et/http/HttpResponseCache.java
09f1b0cc860e039dff39e9429c1eaddcb6af598e 18-May-2011 Jesse Wilson <jessewilson@google.com> Parse HTTP request headers only once.

Change-Id: Ib3df045c546b424651eb1164c2dc610d366b5b39
et/http/HttpEngine.java
et/http/HttpResponseCache.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsURLConnectionImpl.java
et/http/RawHeaders.java
et/http/RequestHeaders.java
et/http/ResponseHeaders.java
7a891b5c83357dbeea2bbe4a5335ae685501e21c 18-May-2011 Jesse Wilson <jessewilson@google.com> Don't read through HTTP response headers more than necessary.

This refactoring changes HttpEngine to prefer the parsed
response headers over the raw response headers. I'll do likewise
for the request headers in a follow-up change.

Change-Id: Iab8329a836d14b3ac7bb0abe190e0a8fa7cc0694
et/http/HttpEngine.java
et/http/HttpResponseCache.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsURLConnectionImpl.java
et/http/ResponseHeaders.java
6f778cc173cc60ec184e8ca54a16ad10cf55f2cf 18-May-2011 Jesse Wilson <jessewilson@google.com> Cache HTTP responses with a Vary header.

This requires a backdoor for the cache to read the request headers
at put time. This is implemented by getting the HttpEngine, which
will allow us to eventually share the response header parsing.

Change-Id: I177467244e5af0a3dda07883cd58d641bf75362f
http://b/3180373
et/http/HttpResponseCache.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsURLConnectionImpl.java
et/http/RawHeaders.java
et/http/ResponseHeaders.java
159b07372841916767251fc5416f3bb6963fe1cb 17-May-2011 Jesse Wilson <jessewilson@google.com> Merge "Test DiskLruCache with fault injection." into dalvik-dev
0eca2939f501873bd86f176540d2c072a1a83780 17-May-2011 Elliott Hughes <enh@google.com> Merge "Add sendto(2) and reimplement all network writes in terms of it." into dalvik-dev
e342455abc6b650f847d931728223411e58831ce 17-May-2011 Jesse Wilson <jessewilson@google.com> Test DiskLruCache with fault injection.

This tests what happens when the filesystem fails while reading or
writing the cached files. I still need to test what happens when
there are failures reading or writing the journal.

Change-Id: I48018514ef5b8cc206efc905b1823eb49589c8e8
http://b/3180373
o/DiskLruCache.java
et/http/HttpResponseCache.java
90d96a4f168b7e56cff54dc94dca2f3cde60ebcd 17-May-2011 Elliott Hughes <enh@google.com> Add sendto(2) and reimplement all network writes in terms of it.

Note that this doesn't fix http://b/4182806.

Bug: 3107501
Change-Id: I9b56eae226389a63a12b4c0499d40d5a54a462e2
o/BlockGuardOs.java
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
ae3dad3194393a6800590284e3632f44fac1ddfb 16-May-2011 Jesse Wilson <jessewilson@google.com> Merge "Move APIs from internal HttpResponseCache to external one." into dalvik-dev
e27d02044ec399884bfd4343d513bf270b9b9b11 16-May-2011 Elliott Hughes <enh@google.com> Remove OSNetworkSystem.close.

For now I'm keeping AsynchronousCloseMonitor as a special case in native code.
We can see about doing something more general-purpose in a later pass.

Bug: 3107501
Change-Id: Ib79b9fc0bebfafc2d14896d957bd8591ae8e6e97
o/AsynchronousCloseMonitor.java
o/BlockGuardOs.java
o/IoUtils.java
et/RawSocket.java
fb4a6392a04b1f3a1124b3db6bae51d8cbfa53f8 14-May-2011 Jesse Wilson <jessewilson@google.com> Move APIs from internal HttpResponseCache to external one.

Change-Id: Ia6c88f292088bfd3ed546c067376fcb36b435b48
http://b/3180373
o/DiskLruCache.java
et/http/HttpResponseCache.java
5637884f8217dbf28de0913c06aceaf09c898510 14-May-2011 Jeff Sharkey <jsharkey@android.com> resolved conflicts for merge of 1e8d508f to dalvik-dev

Change-Id: Id0739d4e567b112cbea48f5ecb7dd46425da1a36
1e8d508f2d97e19f2fc8a709330ea97e1e9f203a 04-May-2011 Jeff Sharkey <jsharkey@android.com> Add Socket tagging for granular data accounting.

Changes BlockGuard to maintain a set of "tags" for the current thread,
which it communicates to kernel before each Socket use. Also changes
HttpConnectionPool to tag/untag sockets as they are recycled.

Change-Id: I33e614f1f570466bdffbf07cc5c718f18b8f3773
o/BlockGuardOs.java
et/http/HttpConnection.java
et/http/HttpConnectionPool.java
d4419fce71d11ec8494525eca65e54d1aab51de6 13-May-2011 Elliott Hughes <enh@google.com> Add getpwnam(3) and getpwuid(3).

Bug: 3107501
Change-Id: I727029758fd495471a9103f6ba259f0a5410b0ab
o/ForwardingOs.java
o/Os.java
o/Posix.java
o/StructPasswd.java
396a9c666da353b910b515d12eb1c43adfddb0c8 13-May-2011 Elliott Hughes <enh@google.com> Expose getpid(2) and a bunch of its friends.

Bug: 3107501
Change-Id: I71127752373abab67eea339b9afbea03148bece0
o/ForwardingOs.java
o/Os.java
o/Posix.java
900fb3dbe24f67439bb6861ea4e961c497c61562 12-May-2011 Jesse Wilson <jessewilson@google.com> Rebuild the DiskLruCache journal periodically.

Change-Id: I8a9303387b550a307cfb49c037879164fe6898e8
http://b/3180373
o/DiskLruCache.java
841b04a2545f17bd782df1e072d4ac4f1b03373f 12-May-2011 Elliott Hughes <enh@google.com> Merge "Reimplement OSNetworkSystem.isConnected in Java." into dalvik-dev
2bad9bff258de6275bd3847e5e9f3169b0a93c61 12-May-2011 Elliott Hughes <enh@google.com> Reimplement OSNetworkSystem.isConnected in Java.

We can do this in Java now we've exposed poll(2).

Change-Id: I9f2700d09134198c1cd2681e3814fb482e8e271c
o/BlockGuardOs.java
o/IoUtils.java
396af46f45fd302e6309fc48ac1fd68cbb739edb 12-May-2011 Jesse Wilson <jessewilson@google.com> Add the application version to the DiskLruCache journal.

This makes it easy for us to change how we store HTTP cache
data without fear of compatibility problems.

Change-Id: I26cd6645d26f359ab76e2f87b6ab73bbf24ab715
http://b/3180373
o/DiskLruCache.java
et/http/DiskResponseCache.java
et/http/HttpEngine.java
et/http/HttpResponseCache.java
ca8ae42fd6a787757897a680108bdcf7b0d37f13 12-May-2011 Jesse Wilson <jessewilson@google.com> Provide more user-friendly HTTP cache stats.

Rather than strictly trackign what's convenient for implementation,
we now provide stats based on what we anticipate the user will want
to know:
- how many requests were made?
- how many requests required network use?
- how many requests were served by the cache?

This doesn't provide individual stats on how many conditional gets
were made, but those can be computed.

Change-Id: Ieeebaf8b98664e78f828971052404dd7da28ad78
http://b/3180373
et/http/DiskResponseCache.java
et/http/HttpEngine.java
et/http/HttpResponseCache.java
757afaa7afe96791a3cc612c9e3c4597a7321c7e 12-May-2011 Jesse Wilson <jessewilson@google.com> Provide hit and miss stats on the HTTP response cache.

Also capture FDs rather than InputStreams when a cache
entry is read. This permits the cache to return as many
streams as the caller requires.

Also fix bugs where we weren't properly releasing the
input streams from the responses.

Change-Id: I04807eab648864229f1e8734ad1fbb6a2d6bb51d
http://b/3180373
o/DiskLruCache.java
et/http/AbstractHttpInputStream.java
et/http/HttpEngine.java
et/http/HttpResponseCache.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsURLConnectionImpl.java
75aa19a024587f0ae91bd4c2d6e48645497ac44d 12-May-2011 Elliott Hughes <enh@google.com> Merge "Expose poll(2) and reimplement java.nio.channels.Selector." into dalvik-dev
70c820401677ca251ad09ac64cc23c760764e75d 12-May-2011 Elliott Hughes <enh@google.com> Expose poll(2) and reimplement java.nio.channels.Selector.

This also adds UnsafeArrayList<T>, which is like ArrayList but lets you access
the underlying array (as opposed to ArrayList.toArray which creates a copy).

Bug: 3107501
Change-Id: I8dc570a9fd7951b1435047017ea7aa19f8f8fc53
o/BlockGuardOs.java
o/ForwardingOs.java
o/Os.java
o/OsConstants.java
o/Posix.java
o/StructPollfd.java
1724d9cddbf0e0f4e35f5c5d83bc335994f0286e 11-May-2011 Jesse Wilson <jessewilson@google.com> Support Eviction in DiskLruCache.

Change-Id: I84f536e597efb4c2b8dd519261b327dcd3e9eefa
http://b/3180373
o/DiskLruCache.java
f589846f86761ffea3c06ab9d105d3f19328d121 11-May-2011 Jesse Wilson <jessewilson@google.com> Address code review comments to Adopt DiskLruCache change.

That change was submitted too early. This is the missing
follow-up.

Change-Id: I521455a7d249f8841c989561775c91d4368a8966
http://b/3180373
o/DiskLruCache.java
o/IoUtils.java
o/Streams.java
et/http/ChunkedInputStream.java
et/http/HttpEngine.java
433e3fac172d0c4449051b0c61c0c63b298a0903 11-May-2011 Jesse Wilson <jessewilson@google.com> Adopt DiskLruCache in HttpResponseCache.

http://b/3180373

Change-Id: I55ed45c5d0b8fc72cf50e8912416367ac802dc7a
o/DiskLruCache.java
o/IoUtils.java
et/http/ChunkedInputStream.java
et/http/HttpEngine.java
et/http/RawHeaders.java
8e0bdcf8bb815078e28679b8111d590d2da83328 11-May-2011 Jesse Wilson <jessewilson@google.com> Merge "Dont line wrap Base64." into dalvik-dev
32b2c95c350002f67c8b3e65777161feda766b72 10-May-2011 Jesse Wilson <jessewilson@google.com> Dont line wrap Base64.

Change-Id: I9a16a09dad9ff170921591455b17a3b738e70655
o/Base64.java
et/http/HttpURLConnectionImpl.java
10ae8253e9d976588de538d76cb30dd5dc32a0be 10-May-2011 Elliott Hughes <enh@google.com> Merge "Expose connect(2)." into dalvik-dev
b4edeb4bd130b1a1d0ba33f374d411cf48590f8e 10-May-2011 Jesse Wilson <jessewilson@google.com> DiskLruCache, backing store for the HttpResponseCache.

This is a work in progress. This cache doesn't yet have support
for eviction or journal compaction. This isn't intended to ever
be public API but it should still have some user documentation.

Change-Id: I62800661a8170ee117622b799836f17226abb7e4
http://b/3180373

Conflicts:

luni/src/main/java/libcore/io/IoUtils.java
o/DiskLruCache.java
o/IoUtils.java
996bf79565ac88402920bd826d6f85952c83be20 10-May-2011 Elliott Hughes <enh@google.com> Expose connect(2).

The new NET_FAILURE_RETRY in Posix.cpp is intended to replace the legacy one
in NetFd.h, but during the transition we need both. The new one also takes care
of the asynchronous Socket.close semantics, and changes the behavior when the
FileDescriptor is invalid on entry: that is now reported as EBADF; it's only
reported as "Socket closed" when we've been round the loop at least once,
giving us reason to believe the socket was ever open. Having had to debug this
distinction, I think the new semantics are less confusing.

Bug: 3107501
Change-Id: I243dc4fa2eddde7ba40e9b66ec8fc555bc4e80f9
o/BlockGuardOs.java
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
da15009528cc8300a6251f1d0931ac8657c9fc31 09-May-2011 Elliott Hughes <enh@google.com> Expose bind(2).

I've renamed the java.net.InetAddress to struct sockaddr conversion functions
too, after initially screwing up this patch by copy & pasting a usage of the
one that only one caller actually wants. Now the name's so ugly no-one will
be likely to use it by accident.

Bug: 3107501
Change-Id: I869a8d27fc40e462505e02bf25a67e771a403e92
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
9531eea15052eccc004b5f853ab4452becf7a8ab 06-May-2011 Jesse Wilson <jessewilson@google.com> Test that headers aren't accidentally transferred across requests.

We used to have a bug where we'd only ever add headers. So if
a request was redirected from a.com to b.com to c.com, then
c.com would be able to see cookies from the other two hosts.

This was fixed by the HttpEngine refactor, but tests haven't
been added until now.

Change-Id: I01588fe9662aae7404fef4d4b2c4f0468e7c670d
http://b/3180373
et/http/HttpEngine.java
et/http/HttpURLConnectionImpl.java
2f16d502415452f808b5f077ad07b941645d14e4 06-May-2011 Jesse Wilson <jessewilson@google.com> Support Cache-Control 'must-revalidate' directive.

Change-Id: I98094e90307e7a39e40de6a09f34f038ad143ea4
http://b/3180373
et/http/ResponseHeaders.java
c996149b500fc4825156106554457fe2394ae087 06-May-2011 Jesse Wilson <jessewilson@google.com> Fix proxy+HTTPS to handle authentication requests from the proxy.

Previously I'd introduced a bug by assuming that CONNECT
responses would always be successful.

Change-Id: Iaf0caf67f52154f6951a20284c75db0090843b99
http://b/4188137
et/http/HttpEngine.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsURLConnectionImpl.java
19c77c6a6da8cea7327ccbb741963ac76d3fae53 05-May-2011 Jesse Wilson <jessewilson@google.com> Address some test failures in the HTTP client.

Change-Id: I44783aa7cadd51ed6b9e7aabc94144c60252c095
http://b/3180373
et/http/HttpEngine.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsURLConnectionImpl.java
d742d7fc7f0593eb8c6e4ac9dd4c0f6a80374e46 05-May-2011 Jesse Wilson <jessewilson@google.com> Use GET after a POST is redirected.

Also dropping support for response code 305 Use Proxy, which
is seldom used, and whose behavior is quite different from
Chrome and Firefox. This is an intentional delta from the RI.

Also testing disconnect().

Change-Id: I80433f4776a2cfc5e228179421a787a44a4ded69
http://b/3180373
et/http/HttpEngine.java
et/http/HttpURLConnectionImpl.java
a4193d7e636802a2705ffb52cb69c69ff59bfbb2 05-May-2011 Jesse Wilson <jessewilson@google.com> Clean up HTTP engine connection reuse.

Also fixing cached responses to set warnings on the
response header and not the request header.

Change-Id: I4def2abf00e43aedc4baa63d1624bfa2f4d9bc16
et/http/HttpEngine.java
et/http/HttpURLConnectionImpl.java
et/http/ResponseHeaders.java
ce1150d9897bd5baf66de4a8db132afce18be15a 05-May-2011 Jesse Wilson <jessewilson@google.com> Merge "Refactor HttpURLConnection implementation." into dalvik-dev
953df613522e12a418cb7cb73248594d6c9f53d4 03-May-2011 Jesse Wilson <jessewilson@google.com> Refactor HttpURLConnection implementation.

Break HttpURLConnectionImpl into two parts: the part that
implements the Java API (that follows redirects etc.) and
the part that speaks HTTP. The HTTP part is called HttpEngine,
and it can only be used for a single HTTP request. This makes
it easier to set request properties that only apply to a
single socket request.

Tests for 'Vary', 'Content-Location' and warnings.

For simplicity of implementation I've chosen not to support
'Vary' at this time.

The 'Content-Location' header doesn't require any work from
the cache.

Warnings are ugly but allow the caller to identify when the
cache results may be problematic.

Also breaking HttpResponseCache's dependency on HttpURLConnectionImpl
so it can be tested on the RI.

Change-Id: Idbabb51251f479c2cdea4e0fceb029bfd07182be
http://b/3180373
et/http/AbstractHttpInputStream.java
et/http/ChunkedInputStream.java
et/http/FixedLengthInputStream.java
et/http/HttpConnection.java
et/http/HttpEngine.java
et/http/HttpHeaders.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsURLConnectionImpl.java
et/http/RawHeaders.java
et/http/RequestHeaders.java
et/http/ResponseHeaders.java
et/http/UnknownLengthHttpInputStream.java
1c039d71d3879f39e3a75b8788e656f7b4f88f08 05-May-2011 Elliott Hughes <enh@google.com> Add getaddrinfo(2).

This only supports the "node" side of getaddrinfo(2), not the "service" side.
There's also no support for AI_CANONNAME, so we currently return InetAddress[]
rather than anything equivalent to C's linked list of struct addrinfo.

Bug: 3107501
Change-Id: I8cf6baa3027a0fa05ac6e2f8fcc1dd8b576ff8c4
o/ForwardingOs.java
o/GaiException.java
o/Os.java
o/OsConstants.java
o/Posix.java
o/StructAddrinfo.java
o/StructFlock.java
o/StructStat.java
o/StructStatFs.java
o/StructUtsname.java
d6ecf9222ec65a08e99f15fcc4ec024f0fffd13a 04-May-2011 Elliott Hughes <enh@google.com> Fix non-blocking connects.

The key change here is reintroducing the boolean return value, which we need
as long as the native code treats EINPROGRESS as a special case which doesn't
throw.

The rest is just drive-by incremental cleanup of the code.

Change-Id: I761b052adbb14e912c3853a35327f8a589cd4023
o/IoUtils.java
0406097759dafaee2390e3ff8dbabd5a1d098122 03-May-2011 Jesse Wilson <jessewilson@google.com> Split CacheHeader into RequestHeader and ResponseHeader.

Fix suspicious use of the word 'header' in the HttpURLConnectionImpl.
Use 'header field' and 'headers' as necessary.

Change-Id: I502808005a727772091e5770a517d3170e102549
http://b/3180373
et/http/CacheHeader.java
et/http/HeaderParser.java
et/http/HttpConnection.java
et/http/HttpConnectionPool.java
et/http/HttpHandler.java
et/http/HttpHeaders.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsHandler.java
et/http/HttpsURLConnectionImpl.java
et/http/RequestHeaders.java
et/http/ResponseHeaders.java
21dddca4064527116af7a1553de502c6d11138da 03-May-2011 Jesse Wilson <jessewilson@google.com> Cache authorization headers and default expiration date.

Neither of these are particularly pretty. Authorization is a
silly special case in the spec that makes caching opt-in rather
than opt-out. Default expiration dates are reasonable but require
a hack to not cache get queries like http://foo.com/?q=bar.

http://b/3180373

Change-Id: Ica76ccfde30fe1e7a0d64895ef5370b43bd980ec
et/http/CacheHeader.java
et/http/HttpURLConnectionImpl.java
a204b444b07de3d7d5917ce8b450c804e52e8bf5 02-May-2011 Jesse Wilson <jessewilson@google.com> Merge "Honor client conditions in HTTP response caching." into dalvik-dev
84f1fd18b9db6fc6f2bb65694bee99d42f88bb79 02-May-2011 Jesse Wilson <jessewilson@google.com> Honor client conditions in HTTP response caching.

Also whitelist acceptable response codes and use the same
logic in both the write-to and read-from cache code paths.

Change-Id: I9500c6c2c0f9bb35e05e2a3443542a86de76cb66
http://b/3180373
et/http/CacheHeader.java
et/http/HttpURLConnectionImpl.java
4bccd48c4bab2c92a34caf3401d379895d2947b6 02-May-2011 Elliott Hughes <enh@google.com> Merge "Rewrite blocking connects in terms of the non-blocking primitives." into dalvik-dev
220c0af1763283b75617226efe3919c3e3b044c8 30-Apr-2011 Elliott Hughes <enh@google.com> Rewrite blocking connects in terms of the non-blocking primitives.

This simplifies OSNetworkSystem, getting us closer to replacing the
connect(2)-related bits with our new POSIX interface. It also lets
us remove cruft on the Java side that was resetting the socket's
blocking/non-blocking state (which should never have been touched),
which in turn fixes bug 4193212.

Detail messages for socket timeouts get better too, now we're throwing
on the Java side.

The only thing that's worse is that we used to get away with throwing
a checked exception from native code, which simplified our "throws"
clauses. Now we actually have to jump through a few hoops to make javac
happy. (Especially awkward because SocketTimeoutException isn't a
SocketException.) Stupid checked exceptions.

Bug: 4193212
Bug: 3107501
Change-Id: I00695d22094e6d785458dfbb7050fbaecf2db89f
o/IoUtils.java
c9e12f729cb962eb60754e4500312421c46e71dd 30-Apr-2011 Jesse Wilson <jessewilson@google.com> Adding support for only-if-cached request header.

This is somewhat ugly because it means we need to fake a 502 bad gateway
status when the response would otherwise be a cached or conditionally
cached result.

Also adding support for max-stale. This completes the set of three
client cache timing headers, max-age, min-fresh and max-stale.

Change-Id: I923a3e5a4685989cb49fb57d6a1359e10026b94b
http://b/3180373
et/http/CacheHeader.java
et/http/HttpURLConnectionImpl.java
adb64fbba2b781467e055706c3de0873dfc01166 30-Apr-2011 Jesse Wilson <jessewilson@google.com> Honor max-age and min-fresh request headers.

We now honor headers from both the server's response (which
we have cached) and the client's request.

Change-Id: Ib46e4fc0c5dd5b3e74cff8f45eea2dda51d20b94
http://b/3180373
et/http/CacheHeader.java
et/http/HttpURLConnectionImpl.java
fe2dea5d0747cbe711fcf64f89845735f4da10c2 30-Apr-2011 Jesse Wilson <jessewilson@google.com> Hack to fix URLConnectionTest.

We weren't preparing the request headers early enough
for some requests. This code needs some hefty refactoring,
but I'm putting this quick hack in to get tests working
until that's done.

http://b/3180373

Change-Id: I03dbd306070bd21b4c7e86052b0b41339cbab628
et/http/HttpURLConnectionImpl.java
9b35d1ad04cdaf0905aee3cb04064ba977e846ac 29-Apr-2011 Jesse Wilson <jessewilson@google.com> Improve parsing of HTTP caching headers.

Change-Id: Ie2b4c76ac97cc7a4783bd6a695cfb28f7ea2296f
http://b/3180373
et/http/CacheHeader.java
et/http/HttpHeaders.java
et/http/HttpURLConnectionImpl.java
00bb52d949cf48eb46658ec48e2c52790b8a1bba 29-Apr-2011 Jesse Wilson <jessewilson@google.com> Merge "Support conditional gets in HttpURLConnection." into dalvik-dev
0c59055dd24e1659f85d9ff7e2148883f663bd62 27-Apr-2011 Jesse Wilson <jessewilson@google.com> Support conditional gets in HttpURLConnection.

This is the first step towards adding an HTTP response cache.
There's still much to do; details are listed on the bug.

Change-Id: Ie693fe424d1d90e90576fc959595e4d96a31f767
http://b/3180373
et/http/CacheHeader.java
et/http/ChunkedInputStream.java
et/http/HttpDate.java
et/http/HttpHeaders.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsURLConnectionImpl.java
et/http/ResponseSource.java
a5fb706fe4a6dbeaaf4cb1f8bbc2c68b0a2a3f3c 29-Apr-2011 Elliott Hughes <enh@google.com> Add kill(2) to Libcore.os.

Also kick the tires of ProcessManager, since we'll probably have to do some
unrelated work in here soon.

Bug: 3107501
Change-Id: I132c1e09d21ffcf0d5ea4aab93f04a36c1b30eaf
o/ForwardingOs.java
o/Os.java
o/OsConstants.java
o/Posix.java
0568a63ba1086a78ffb4cff68dd2eac4f9908e13 26-Apr-2011 Elliott Hughes <enh@google.com> Fix ByteBuffer.put(ByteBuffer).

To do this tastefully required some cunning in the native code. The new
ScopedBytesRO/ScopedBytesRW classes let us paper over the differences
between byte[] and DirectByteBuffer, which in turn lets us paper over the
differences between the various kinds of ByteBuffer.

I've also rewritten Posix.read/Posix.readDirectBuffer and
Posix.write/Posix.writeDirectBuffer to use the same idea. I haven't rewritten
readv and writev, but can do and probably should.

Bug: http://code.google.com/p/android/issues/detail?id=16184
Change-Id: Ia30d2f2fe1b1716a8f068187df2218b407a55aae
o/Memory.java
o/Posix.java
a6a4b2128841da32c9b380ac649c5bef9495772c 25-Apr-2011 Jesse Wilson <jessewilson@google.com> Merge "AutoCloseable." into dalvik-dev
8033ba2bd4b8eab11e67738ba4d1390e1fb72111 23-Apr-2011 Jesse Wilson <jessewilson@google.com> AutoCloseable.

Change-Id: I5604ad7f96c824e4df78a5ebd78845d012aedc13
http://b/3484927
til/EmptyArray.java
aa96cbdcf3a0e303a16bad785c71e2efe417eea0 23-Apr-2011 Elliott Hughes <enh@google.com> Fix java.text.BreakIterator.

BreakIterator was making invalid assumptions about pointer validity. ICU4C's
API is broken, so we have to work around that by pinning for now.

Bug: 4330159
Change-Id: Ie7454d54240c10096f94462027d07ea258b483b6
cu/NativeBreakIterator.java
a37e971343883bb582a93ffbd9f0ba84f10e55ba 21-Apr-2011 Elliott Hughes <enh@google.com> Rewrite NetworkInterface.

This is part of the POSIX work, but also fixes a bug that asked for down
interfaces to be returned. Additionally, I found a few bugs while rewriting
this code. Most notably, we used to return a bogus broadcast address for
the loopback interface. The only difference I notice between us and the RI
when running on the host is that the RI claims that 127.0.0.1 has a prefix
length of 0 rather than 8. I believe that we are correct on this issue.

Bug: 4082343, 3107501
Change-Id: I677e0698e3a86676b4332b5d56fe514a99c3ddc0
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/OsConstants.java
o/Posix.java
ae394a866dd86df8819b652dfe00b3d2c7ee204c 20-Apr-2011 Elliott Hughes <enh@google.com> Remove "java.net.preferIPv6Addresses", which has been true since Eclair.

Also ensure all javadoc references to RFCs are links.

Change-Id: I58b08a8ead08d6eab018e19ec2cff7d60f2b06e6
o/IoUtils.java
4f11ebea266eada830d507b8f011e811a8e5d7bc 20-Apr-2011 Elliott Hughes <enh@google.com> Add getnameinfo(3) (and gai_strerror(3)).

There's quite a large corresponding change to InetAddress, plus I've changed
the documentation for all the Permission classes to match the handful that
we'd already documented as legacy cruft.

Bug: http://b/3107501
Change-Id: Ia67aba79f0ab13e64085bd4a2df20ad0776bcc5b
o/ForwardingOs.java
o/GaiException.java
o/IoUtils.java
o/Os.java
o/OsConstants.java
o/Posix.java
b974666d79ebc392b37ec1ae83aae57ae6331c08 06-Apr-2011 Elliott Hughes <enh@google.com> Finish setsockopt(2).

Bug: 3107501
Change-Id: I8f026dcba78acb555834bdcc594e114238f3cc52
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/OsConstants.java
o/Posix.java
438cb9e440d250c8aa5daf4fae0c400dce8b1499 02-Apr-2011 Elliott Hughes <enh@google.com> Add MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP setsockopt(2).

Bug: 3107501
Change-Id: I576f45f8c67b6172888bc0541e3d3a462bfa311a
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
o/StructGroupReq.java
c63f0d4e80a9fd3bdf99cd438d108b750226736a 02-Apr-2011 Elliott Hughes <enh@google.com> Add more of setsockopt(2).

This covers all the easy cases. I'll do the awkward ones separately.

Bug: 3107501
Change-Id: Ie424290e0bef76516d0c57e9c077cb1c202381ad
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
c84000159bb1770972c308da924e9c90db4024a0 01-Apr-2011 Elliott Hughes <enh@google.com> Remove hacks for non-dual-stack situations.

There's also a behavioral change here in code that previously said TODO.
Our current intention is that we always set both IPv4 and IPv6 options (when
coming via the java.net interfaces, which don't allow you to differentiate),
always return the IPv6 options (since it can't matter). If you need greater
control (which was never possible before), you'll be able to use the new
APIs soon.

The SocketOptions.IP_MULTICAST_IF (IPv4) and SocketOptions.IP_MULTICAST_IF2
(IPv6) distinction remains, because that's exposed java.net API.

CompatibleSocketAddress gets a lot simpler, but it looks like the kernel
still doesn't like an IN_ANY bind(2) on a dual-stack AF_INET6 socket. This
is unfortunate because it means callers have a decision to make, preventing
us from moving that code into inetAddressToSocketAddress.

Bug: 3107501
Change-Id: Ifa694d936a81af143a40f404b12470045e644fa8
o/IoUtils.java
9fa7c4cd4a619236db70aefab8da3abafb065bca 31-Mar-2011 Jesse Wilson <jessewilson@google.com> am 866b399e: am 9d28a32d: am bc4c79c6: Don\'t read from the delegate stream after we close it.

* commit '866b399e1d5cab4cc8d196f8008ba8ad8376765d':
Don't read from the delegate stream after we close it.
0a9d1ee45a9884a9616624d747172e18734e8fe0 31-Mar-2011 Elliott Hughes <enh@google.com> Add getsockname(2) and getsockopt(2).

Bug: 3107501
Change-Id: Ibb0d5a576ecb46e51dbda6051776145eec9e7fe1
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/OsConstants.java
o/Posix.java
o/StructLinger.java
o/StructTimeval.java
e8fad0e2a8787fd46654d1cc9e477b353a958451 30-Mar-2011 Elliott Hughes <enh@google.com> Fix build.

Change-Id: I29628c87ac3bd1feb0169af84f0cbc3ddf4e430d
o/IoUtils.java
462bdac45c10f43d88d8f07f6994e272a27c14a2 30-Mar-2011 Elliott Hughes <enh@google.com> Add close(2).

This is sufficient for non-socket fds, but may need to change to support the
asynchronous socket close monitor. (Hopefully not; I'd rather lift that into
Java.)

I've also changed the semantics of IoUtils.close to match those desired by
all callers: ignore null/invalid FileDescriptors.

Bug: 3107501
Change-Id: Iad5c31c8f0f34d2a5ab1ed4581509b46af28bd1f
o/ForwardingOs.java
o/IoUtils.java
o/MemoryMappedFile.java
o/Os.java
o/Posix.java
454a95f6a28855aa3c88d168b15a45bf315efc99 30-Mar-2011 Elliott Hughes <enh@google.com> Add socket(2) and start adding setsockopt(2).

I've added just enough setsockopt to keep the hack from our old socket
creation code. More later (but not necessarily right away).

Bug: 3107501
Change-Id: Id57bdd3c760bc58ed79d675b268c55493cbc24c8
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/OsConstants.java
o/Posix.java
8b15dcc5890963edad4dfcf558cc16027c7985e5 29-Mar-2011 Elliott Hughes <enh@google.com> Add sendfile(2).

This patch marks the end of OSFileSystem.

Having to support a Java "long*" for sendfile(2) gave me an opportunity to go
back and improve my ioctl(2) to use a corresponding "int*" equivalent, instead
of its previous special-case hack.

Bug: 3107501
Change-Id: I9fde4777700552263fab4fe9aeb556174163e3dc
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
til/MutableBoolean.java
til/MutableByte.java
til/MutableChar.java
til/MutableDouble.java
til/MutableFloat.java
til/MutableInt.java
til/MutableLong.java
til/MutableShort.java
94aa98c94b79f5c99a0e1d905c03c5423d1ce0fa 29-Mar-2011 Elliott Hughes <enh@google.com> Merge "Add readv(2)/writev(2)." into dalvik-dev
bbac92e691de7d570928ddfba639067978e55b06 29-Mar-2011 Elliott Hughes <enh@google.com> Add readv(2)/writev(2).

The old implementation would cheat if it was given non-direct buffers, copying
them into newly-allocated direct buffers. (The network Channel implementations
are worse: they copy all the data into a single buffer, and then read/write
that. I'll get to them eventually.)

Bug: 3107501
Change-Id: I1655bacb042e7ebcde7e5bc5cf2c71e7ce5e30af
o/BlockGuardOs.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
f16edfe125c261e7f4e5cff52c0b9c923d9f7fe6 29-Mar-2011 Jesse Wilson <jessewilson@google.com> Follow up on enh's comments for CollectionUtils.uniqueCopy()

Change-Id: I0ceb442801160827909ff9ab3e52771754072bda
http://b/4087759
til/CollectionUtils.java
0843c022f443b5c4a8ea4d298c8b12147989ec92 29-Mar-2011 Jesse Wilson <jessewilson@google.com> Move ClassMembers' members into Class; remove ClassMembers.

Change-Id: I74e056120b65578104ca4596401d0de0b9747114
http://b/4087759
til/CollectionUtils.java
461d0d860814c68154d8dd06d24f94118f33d28a 29-Mar-2011 Elliott Hughes <enh@google.com> Add ioctl(2) for int*.

I'm not adding the "struct ifreq" stuff yet because that's really hairy and I
plan on rewriting the NetworkInterface implementation anyway, so it'll mainly
be based on /proc. With any luck, we won't even need those other ioctls then.

I'm not sure _this_ ioctl is a good idea, but it does seem like a slight
improvement on the old code, and we can always move it back out if/when these
APIs become more public.

Bug: 3107501
Change-Id: Iceac15e4a107c33bfc8795976a747c2ffa59a183
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/OsConstants.java
o/Posix.java
4af0d8c99d68bcacff182699527d983a1d34fdbe 28-Mar-2011 Elliott Hughes <enh@google.com> Support read-only ByteBuffers.

Buffer.array() and Buffer.arrayOffset() throw for read-only buffers. We need
to work round this. We know that this is safe because we trust ourselves not
to write to read-only buffers and because all non-direct buffers have a
backing array.

Bug: 3107501
Change-Id: I501a5f7ddba2c66d22864bf4a41b927263493293
o/Posix.java
78c7cc547101002b9f9043cf3845970719d1bda8 26-Mar-2011 Elliott Hughes <enh@google.com> Add write(2).

Note that this is a functional change, because the old code was wrong: it
assumed that short writes don't happen. I thought we'd (I'd) cleaned this
up just recently, but it looks like I must have only gone through the network
code. Embarrassing.

This also cleans up the previous read change a bit, factoring out a bit more
duplication, and taking advantage of the fact that we now get decent
exceptions thrown from invalid FileDescriptors (meaning we can remove explicit
checks).

Bug: 3107501
Change-Id: I8bd5324836c9d151dceaef5b84ec523a67391b64
o/BlockGuardOs.java
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
26c7025a7a919044771fb89031161bd26fe03032 26-Mar-2011 Elliott Hughes <enh@google.com> Add read(2).

For both byte[]s and ByteBuffers.

Bug: 3107501
Change-Id: I93b781069ade4507371c8fe8c5fda0163fbb2dbb
o/BlockGuardOs.java
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
fc549a0b0388987b26dea524894d75a63d14783b 25-Mar-2011 Elliott Hughes <enh@google.com> Add fcntl(2).

I initially used overloading, but that actually decreases safety in practice
because which overload you need is (uniquely) determined by the specific
command you're issuing. Forcing callers to explicitly state what they're
doing works around this. As it was, I had to use strace(1) to find my bug.

Bug: 3107501
Change-Id: Ia54b72dd6453372922f01b22f382eb93ac91aaa7
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/OsConstants.java
o/Posix.java
o/StructFlock.java
7341b9ed7157a1e37a3e69a0974676da358b735a 24-Mar-2011 Elliott Hughes <enh@google.com> Add uname(2).

This replaces InetAddress's use of gethostname(2), and System's hard-coded use
of uname(2) itself.

Bug: 3107501
Change-Id: I7e808177eece1e38428fea18a96c65628d51d93e
o/ForwardingOs.java
o/Os.java
o/Posix.java
o/StructUtsname.java
e1502d64e937001636fca3d62b2552ef2a34d05f 24-Mar-2011 Elliott Hughes <enh@google.com> Add listen(2).

Bug: 3107501
Change-Id: I3677bb4ddb3f3d0e58a6833165504f47bb309630
o/ErrnoException.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
59e4744d27231f260271dbbca406e0cc39768116 24-Mar-2011 Elliott Hughes <enh@google.com> Add shutdown(2).

Bug: 3107501
Change-Id: I30354c4cc6e86a4e7b0e3f84e95719539db1d297
o/ForwardingOs.java
o/Os.java
o/Posix.java
41f0605d2c809bd9bc1c0fb68d86b49a0f59b6c5 24-Mar-2011 Elliott Hughes <enh@google.com> Add pipe(2).

This lets us kill quite a bit of IoUtils.

Bug: 3107501
Change-Id: Ic8a297b29cc53a17841cc77e266cd8dc3910c521
o/ForwardingOs.java
o/IoUtils.java
o/Os.java
o/Posix.java
c7fa20701d5e9398c38f4615ed293acfce1c0cf6 24-Mar-2011 Elliott Hughes <enh@google.com> Add mkdir(2) and remove(2).

Bug: 3107501
Change-Id: Ia4ca50b957d6015fa49076806273054563d25b63
o/ForwardingOs.java
o/Os.java
o/Posix.java
b7190190e0ef8de883c952efb319ce7748831faa 24-Mar-2011 Elliott Hughes <enh@google.com> Add chmod(2).

Bug: 3107501
Change-Id: If3a0639634a90f607b8c6035f25b03d23e7261e0
o/ForwardingOs.java
o/Os.java
o/Posix.java
59fa7163774d6930a174bc038414a4b780581957 23-Mar-2011 Elliott Hughes <enh@google.com> Add statfs(2).

Bionic doesn't support statvfs(2), so we'll have to use statfs(2) in the
meantime. We should fix this before making this API public, though.

Bug: 3107501
Change-Id: I1af8a473261586321543dd1554e1f6079a84f384
o/ForwardingOs.java
o/Os.java
o/Posix.java
o/StructStatFs.java
a20cc6fca30d18e05db67ceeb0403b7b58ffd364 23-Mar-2011 Elliott Hughes <enh@google.com> Add rename(2) and symlink(2).

And use them too.

Bug: 3107501
Change-Id: I83b512a2553bfc2501d02c251a4649f8e670774e
o/ForwardingOs.java
o/Os.java
o/Posix.java
2ffce92141c0b2a5f0543229f3ded34b0ee79ba1 23-Mar-2011 Elliott Hughes <enh@google.com> Move File.createNewFile into Java.

Also add improved tests.

Bug: 3107501
Change-Id: Ibea9bd71adf1e1230c14072fb4597ad5bd9c214b
o/MemoryMappedFile.java
0ac77ac8e915bff1a863e371f9b363033f9cf759 23-Mar-2011 Elliott Hughes <enh@google.com> Add open(2).

Bug: 3107501
Change-Id: I404030b4c678862465d04f723a6a324663e0af25
o/BlockGuardOs.java
o/ForwardingOs.java
o/IoUtils.java
o/MemoryMappedFile.java
o/Os.java
o/Posix.java
0f746ff511162add42eeabaf14ba70ace874c6f4 23-Mar-2011 Elliott Hughes <enh@google.com> Add mincore(2).

Bug: 3107501
Change-Id: Ibb288b0889ff47612f77870239f51928b35754a9
o/ForwardingOs.java
o/Memory.java
o/Os.java
o/Posix.java
7e13c0f05ac9e7c55682d10e953dd4cbd5e6107c 19-Mar-2011 Elliott Hughes <enh@google.com> Add mlock(2) and munlock(2).

Bug: 3107501
Change-Id: I7e4cad36370196d990c709bfa33f89d7568aa453
o/ForwardingOs.java
o/Os.java
o/Posix.java
7e25eff38a191d9c19e45093f4fde5102fb09d78 19-Mar-2011 Elliott Hughes <enh@google.com> Add mmap(2), msync(2), and munmap(2).

Bug: 3107501
Change-Id: I6a7c4147ec27bab9ded280476bad1157ce03fab8
o/ForwardingOs.java
o/Memory.java
o/MemoryMappedFile.java
o/Os.java
o/Posix.java
til/ZoneInfoDB.java
450d9307bf6a3c6ee90ee8754e1eb6c3e0245f7a 19-Mar-2011 Elliott Hughes <enh@google.com> Merge "Add isatty(2)." into dalvik-dev
9a3f363523000704205df288f8b6f2f48c0d8563 19-Mar-2011 Elliott Hughes <enh@google.com> Add isatty(2).

Bug: 3107501
Change-Id: I67e4a4ceeba945095419d176e7de5edb7da8a440
o/ForwardingOs.java
o/Os.java
o/Posix.java
5aafac4db69e6d087c512cdfa5c7c0e2f1611681 19-Mar-2011 Jesse Wilson <jessewilson@google.com> Move URLConnection classes to libcore.net.

Change-Id: I14bf8373dfce50dda94e1a64419b9a8a9cf3c82e
et/MimeUtils.java
et/http/AbstractHttpInputStream.java
et/http/AbstractHttpOutputStream.java
et/http/ChunkedInputStream.java
et/http/ChunkedOutputStream.java
et/http/FixedLengthInputStream.java
et/http/FixedLengthOutputStream.java
et/http/HttpConnection.java
et/http/HttpConnectionPool.java
et/http/HttpHandler.java
et/http/HttpHeaders.java
et/http/HttpURLConnectionImpl.java
et/http/HttpsHandler.java
et/http/HttpsURLConnectionImpl.java
et/http/RetryableOutputStream.java
et/http/UnknownLengthHttpInputStream.java
et/url/FileHandler.java
et/url/FileURLConnection.java
et/url/FtpHandler.java
et/url/FtpURLConnection.java
et/url/FtpURLInputStream.java
et/url/JarHandler.java
et/url/JarURLConnectionImpl.java
dedaccdfa07c370a58cba08b096133ad9eec0ec3 18-Mar-2011 Elliott Hughes <enh@google.com> Add lseek(2).

Bug: 3107501
Change-Id: Ie27e2ae1c7d37de5f02b1d81ee2005182339f881
o/ForwardingOs.java
o/Os.java
o/Posix.java
f5333fd2094bdac4d6506177b1964b79afa64d77 18-Mar-2011 Elliott Hughes <enh@google.com> Add ftruncate(2).

The claim that "the port library" modifies the file offset appears to only ever
have been true of Harmony's Win32 implementation. Certainly, this is not the
behavior of ftruncate(2), so we can lose the cruft.

Bug: 3107501
Change-Id: I35092fd986296b78c4847c7215765f9997339f37
o/BlockGuardOs.java
o/ErrnoException.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
6fc1a0e1e68dc2e0d12341548e58fa7f1c5dafc4 18-Mar-2011 Elliott Hughes <enh@google.com> Add sysconf(3).

This gives us a getpagesize(3) replacement right now, and will let us implement
Runtime.availableProcessors here rather than in the VM in a later change.

Bug: 3107501
Change-Id: I6fc1f83d36b026fbe8d37eca525550479677f2de
o/ForwardingOs.java
o/Os.java
o/OsConstants.java
o/Posix.java
o/StructStat.java
47cb338d43f75dd998b29caaaa9446c5705217d1 18-Mar-2011 Elliott Hughes <enh@google.com> Add fstat(2), lstat(2), and stat(2).

Bug: 3107501
Change-Id: Ic36f9ffd03446d6e0189470f42abdadde57327df
o/ErrnoException.java
o/ForwardingOs.java
o/Os.java
o/Posix.java
o/StructStat.java
5b6296d6bf06784362394e1c4b25df316d140771 18-Mar-2011 Elliott Hughes <enh@google.com> Also give errno names (like EINVAL) when we know them.

Bug: 3107501
Change-Id: I333f1efd72a2969ce87a0e7af45b0d47e50d5b00
o/ErrnoException.java
o/OsConstants.java
bdb717ae237f4bb9b14b61a2d24150106ac8e6c7 18-Mar-2011 Elliott Hughes <enh@google.com> Simplify the constant initialization.

Bug: 3107501
Change-Id: I07b035482de00cb39c735e3acd9387fcbc22b30a
o/OsConstants.java
52724d3ebd4ccaaa4b9f5576e329d4272cde8ea9 17-Mar-2011 Elliott Hughes <enh@google.com> Add fsync(2) and fdatasync(2).

Interesting parts to this change:
* first BlockGuard support (and general delegation support).
* first rethrowing of ErrnoException as IOException.
* switching FileChannelImpl from int to FileDescriptor.

The special case in FileDescriptor.sync has been removed. Testing with the RI
showed that it doesn't treat syncing a FileDescriptor that corresponds to a
socket as a special case --- it throws SyncFailedException just like normal.

Bug: 3107501
Change-Id: I99faf120bd802aec0397a79772ed38c5e1542fed
o/BlockGuardOs.java
o/ErrnoException.java
o/ForwardingOs.java
o/Libcore.java
o/MemoryMappedFile.java
o/Os.java
o/Posix.java
ddfdbb9d172fe9b72e08e8d7deab0aa3b8acf044 17-Mar-2011 Elliott Hughes <enh@google.com> Add access(2), strerror(3) and access to environ.

Update java.io.File and java.lang.System to use the new functionality
rather than brewing their own.

Bug: 3107501
Change-Id: I5fa63190d240d638f44a911401143ffb2af9d395
o/ErrnoException.java
o/Os.java
o/Posix.java
ec617e2cb4a374f0fd8fbda4a633214cf23a59a9 17-Mar-2011 Elliott Hughes <enh@google.com> Move the getenv(3) native code out of System as a demo.

This is a fairly trivial patch, just to show the general structure.

Bug: 3107501
Change-Id: I547df621ccb8b8874e5f74c4d0bcf84ccaef97c3
o/Libcore.java
o/Os.java
o/Posix.java
2822a84736c46282ee3a12983340f594e38eac5a 16-Mar-2011 Elliott Hughes <enh@google.com> More POSIX constants.

This covers <errno.h>, <netinet/in.h>, <stdlib.h>, <sys/mman.h> (minus some
POSIX constants missing in bionic), <sys/socket.h> (minus the
getsockopt/setsockopt constants), <sys/stat.h>, <sys/wait.h>, and <unistd.h>.

Bug: 3107501
Change-Id: I83d5beeb74cce31f3fbac1e1b350d73df7cb4b9d
o/OsConstants.java
cdf7a1f942469221bcfd63d9cdf71851b011eaf0 16-Mar-2011 Elliott Hughes <enh@google.com> Expose POSIX constants.

And use them, too. This patch is a little confusing because we already had
constants in Java that were using the POSIX names but that didn't actually
correspond to the constants whose names they'd stolen. Ugh.

Bug: 3107501
Change-Id: Ib64a109c9340b0ecdf80bec91074206c001f455a
o/OsConstants.java
f934c3d2c8dd9e6bc5299cef41adace2a671637d 15-Mar-2011 Elliott Hughes <enh@google.com> Make OSMemory the semi-supported libcore.io.Memory.

Looks like we're not going to bother with a separate libcore.os package,
when libcore.io will do.

Change-Id: I2806c59349ed4b6410d768c4207c384ced973c54
o/HeapBufferIterator.java
o/Memory.java
o/MemoryMappedFile.java
o/NioBufferIterator.java
ff8234c90ecab9f1db368924bf92a5b16460f9b5 08-Mar-2011 Elliott Hughes <enh@google.com> Factor out our single-byte InputStream.read/OutputStream.write implementations.

Change-Id: I00106a51a32ea84a39256d5629369170b892a039
o/Streams.java
0ad1c14261c4db0731503770ec6a027e90cc6e38 04-Mar-2011 Elliott Hughes <enh@google.com> Add new java.util.Currency functionality.

Also clean up the implementation a bit, fix a long-standing
serialization bug, and improve the documentation.

Bug: 3484927
Change-Id: I5e5270b1b1cdac69b6d7f51b8460896692040a12
cu/ICU.java
f5309a39506c967feda8766feeba7f7271a458cb 25-Feb-2011 Elliott Hughes <enh@google.com> Fix more FindBugs warnings: RR_NOT_CHECKED.

"This method ignores the return value of one of the variants of
java.io.InputStream.read() which can return multiple bytes. If the return
value is not checked, the caller will not be able to correctly handle the
case where fewer bytes were read than the caller requested. This is a
particularly insidious kind of bug, because in many programs, reads from input
streams usually do read the full amount of data requested, causing the
program to fail only sporadically."

Change-Id: I7d7c62836f2037f0cbb4bb0708bd4f034a22a2fc
o/Streams.java
9ebb5807fa40f3bddf3567906a2c77ee053174bb 24-Feb-2011 Elliott Hughes <enh@google.com> NativePluralRules.finalize should be protected, not public.

(FindBugs.)

Change-Id: I3ac444fdc84beb7f8738b941849cc76a950708e8
cu/NativePluralRules.java
244449b9ccd108197d1c117edda99cd93a891d49 23-Feb-2011 Elliott Hughes <enh@google.com> Fix a comment and remove some duplication.

Change-Id: I67bb9f1c71c774e04698a3e489bd48e9b27b2b64
til/ZoneInfoDB.java
a7ef55258ac71153487357b861c7639d627df82f 22-Feb-2011 Elliott Hughes <enh@google.com> Simplify internal libcore logging.

Expose LOGE and friends for use from Java. This is handy because it lets me use
printf debugging even when I've broken String or CharsetEncoder or something
equally critical. It also lets us remove internal use of java.util.logging,
which is slow and ugly.

I've also changed Thread.suspend/resume/stop to actually throw
UnsupportedOperationException rather than just logging one and otherwise
doing nothing.

Bug: 3477960
Change-Id: I0c3f804b1a978bf9911cb4a9bfd90b2466f8798f
cu/TimeZones.java
627e11cb4d62b42c081886575292b0992158c06b 19-Feb-2011 Elliott Hughes <enh@google.com> am 9bbaec8f: Cope with ICU reporting obsolete language codes.

* commit '9bbaec8f8f415244ab80061e6637c22bf40b5ccd':
Cope with ICU reporting obsolete language codes.
9bbaec8f8f415244ab80061e6637c22bf40b5ccd 19-Feb-2011 Elliott Hughes <enh@google.com> Cope with ICU reporting obsolete language codes.

java.util.Locale mangles the new language codes for Hebrew and Indonesian into
the obsolete codes. I've added the ICU aliases so that ICU knows about the
obsolete codes (so that when we pass a mangled locale to ICU, ICU knows what
we're talking about). This patch adds tests, and also filters out the
duplicates caused by ICU now reporting both "he" and "iw", which we mangle
into "iw" and "iw". I've used a LinkedHashMap to preserve ICU's ordering;
there's no _need_ to do this, but it's nice behavior, better than the RI's.

Bug: 3452611
Change-Id: I320ede1a35c9dd5578116499d33a7172f27e95f5
cu/ICU.java
6aa068b481cc4cca7765ce90fdf32f3eb2b5a77c 18-Feb-2011 Elliott Hughes <enh@google.com> Fix various FindBugs warnings.

Only the ChunkHandler and ZoneInfo ones were real bugs. The former is only
called with one input value that doesn't exercise the bug, and the latter
would cause us to think that a time zone that stopped using daylight time
before 1970 was still using daylight time (which would defeat various
optimizations, but should otherwise be harmless).

The other stuff is trivia not worth individual changes.

Change-Id: Ib0752560cd16edc6538d1fc2b234451a66d48171
til/ZoneInfo.java
aa37e2512b13deab2e82800c71327dd74c362577 17-Feb-2011 Elliott Hughes <enh@google.com> Move SneakyThrow to libcore.util.

Change-Id: Ibd3dc18cf8352ee259b3665bcdc80a13842acb64
til/SneakyThrow.java
6d82ce5d35a5e84aedf08528fd98b849f3f565a6 15-Feb-2011 Elliott Hughes <enh@google.com> Move ZoneInfo and ZoneInfoDB into libcore.util.

Change-Id: I91385512ec27aa2aebdc163ae204e542efa58f21
til/ZoneInfo.java
til/ZoneInfoDB.java
566bbb1d5a0ffadfc07fa58176587d4bd0d0be13 12-Feb-2011 Elliott Hughes <enh@google.com> Various time zone strings improvements.

* Added a cache -- really a memo table -- to libcore.icu.TimeZones. I've also
made the intern table global across all locales, for the common case where one
language has many corresponding country codes (and thus locales) for which the
strings are all the same. (I.e. this gives us deduplication across locales
where before we only had it within locales.) We also eagerly populate the cache
with both the default locale *and* en_US in the zygote, which should provide
better behavior for everyone whose default locale isn't en_US.

* Switched from linear search to binary search when pulling a row out of the
zone strings table. We could hash these, but I currently have no reason to
think we'd gain much speed for the space.

* Removed the special-case hack I had to ask ICU for a single string. The new
code largely removes the need for this, though one can imagine a theoretical
app that will behave worse under the new regime, all plausible ones will
benefit.

* Switch ICU over to using an mmap(2)ed copy of its .dat file and tell it never
to look for stuff on the file system. This doesn't actually work in any current
version of ICU, though it is slightly faster by virtue of no longer looking for
individual .res files (it still keeps looking for the same .dat file over and
over). I'll work on fixing ICU later. This change takes us from about
1.1s/locale to 0.8s/locale. My current ICU hack takes that down to 0.3s/locale,
which is still obscene, but it's another step in the right direction.

* Fixed the "unambiguous abbrevations" logic in TimeZones.cpp so that all users
of (say) CET to mean "Central European Time" get it, not just first. We really
just wanted to avoid the situation where there's a "Central Excellent Time" or
whatever, whose CET would *conflict* with the first one we learned about.
Multiple references to the same time zone are not conflicts.

* Moved clone2dStringArray to the only place it's really needed.

* Slightly better documentation for Comparator.

* More tests, including the one for CET formatting that I should have added
when I fixed CET parsing, which would have shown me the error of my old ways.

Bug: 3443476
Change-Id: If1d50e6273fc98a38139f14445265ce0be5e09dd
cu/TimeZones.java
6f29fe0f1a0a42d773fb435e132d8dea9b59a11d 11-Feb-2011 Jesse Wilson <jessewilson@google.com> Merge commit '7d95dd2e' into manualmerge

Conflicts:
luni/src/main/java/java/net/AddressCache.java

Change-Id: I32c78e56b5b7ac078e75bacfe7ec176962e777c5
e0e567287e4392bebc5f5826b8ef3b1bd8ca166e 11-Feb-2011 Elliott Hughes <enh@google.com> Add system properties that report our ICU4C and Unicode versions.

Bug: 3413364
Change-Id: Ibbc4ab3564bc3329275a1a828f86750aa6beb200
cu/ICU.java
7d95dd2ed60350f90fe64c33cbde58e5c2a72c83 10-Feb-2011 Jesse Wilson <jessewilson@google.com> Adopt BasicLruCache in AddressCache.

Change-Id: I08a5e82e123920762ad9a9c87bbe3045f17e33a9
http://b/3184897
til/BasicLruCache.java
786ca658dfe8596835859ce45ee3b0ed46b8f21c 10-Feb-2011 Jesse Wilson <jessewilson@google.com> Fix URL encoder regression.

My recent cleanup broke URL partial encoding when the source URL
already contained escaped sequences. It was covered by a test that
I didn't run! Sigh.

Also fold in related tests. The URL decoding tests were validating
that URLs were resolving IP addresses; that functionality has since
been removed.

Change-Id: I876db3459f413e3f20ac3fd757749d8fbee3a1eb
http://b/2753295
et/UriCodec.java
32559028b14b9b321b10eede050afd554a376569 09-Feb-2011 Jesse Wilson <jessewilson@google.com> Use the same code to encode and fix poorly encoded URLs.

Don't permit digits outside of ASCII.

Change-Id: I47b756c32e67b7415e35ae9eb55b735d1c22a36d
http://b/3436051
et/UriCodec.java
56099d23fcb002b164bff8fb7f14d6ec0453509e 09-Feb-2011 Jesse Wilson <jessewilson@google.com> Remove redundant URL encoders and decoders.

http://b/3436051
http://b/2753295

Change-Id: I5836eab395214767efa4a3d8e8002cff72738854
et/UriCodec.java
3664d8839f0ba794f428119ee7f7304a66861da5 08-Feb-2011 Elliott Hughes <enh@google.com> Clean up the CharsetDecoder/CharsetEncoder implementation a bit more.

Moving CharsetEncoderICU into java.nio.charset lets us use a cleaner workaround
for the constructor-calling-abstract method API bug.

Change-Id: I2312580b2c27711e9d4c88fe4dc057eec13c12e0
cu/CharsetDecoderICU.java
cu/CharsetEncoderICU.java
cu/CharsetICU.java
0a95ca9e544a8c6fa49a9972bc173c16fdc612ce 08-Feb-2011 Elliott Hughes <enh@google.com> Merge "Clean up the CharsetDecoder/CharsetEncoder implementation a bit more." into dalvik-dev
37871fb106b08055ad56d7f04d4faccdd163e1af 08-Feb-2011 Elliott Hughes <enh@google.com> Clean up the CharsetDecoder/CharsetEncoder implementation a bit more.

This removes the duplicated error-checking in the ICU classes that started
this investigation, but also cleans up a bunch of other stuff. There shouldn't
be any other behavioral differences, just clearer code.

Bug: 3418769
Change-Id: I4da4d2a5b2fce1b152e527909b7c76a6db76c5c0
cu/CharsetDecoderICU.java
cu/CharsetEncoderICU.java
cu/NativeConverter.java
26ce8fbd8fe488cc969b08f64c56525662763dc4 08-Feb-2011 Jesse Wilson <jessewilson@google.com> resolved conflicts for merge of 6186821c to dalvik-dev

Change-Id: Ic6f0172767d6feedb188d3a5e7488a67702ef8c4
b0dd42c2b44ef61f116a7eea0e13237f55e07c9f 08-Feb-2011 Jesse Wilson <jessewilson@google.com> am e5720bcc: Avoid name collision in libcore.base vs android.util.LruCache.

* commit 'e5720bcc0ac6587d152f2e8525eb2fc35c46bb0c':
Avoid name collision in libcore.base vs android.util.LruCache.
6186821cb13f4ac7ff50950c813394367e021eae 08-Feb-2011 Jesse Wilson <jessewilson@google.com> Move libcore.base classes to libcore.util and libcore.io.

Change-Id: I2340a9dbad3561fa681a8ab47d4f406e72c913e3
ase/BasicLruCache.java
ase/CollectionUtils.java
ase/EmptyArray.java
ase/Objects.java
ase/Streams.java
o/Streams.java
til/BasicLruCache.java
til/CollectionUtils.java
til/EmptyArray.java
til/Objects.java
e5720bcc0ac6587d152f2e8525eb2fc35c46bb0c 07-Feb-2011 Jesse Wilson <jessewilson@google.com> Avoid name collision in libcore.base vs android.util.LruCache.

The libcore LRU cache is only for our internal use and can be
minimal; the android.util LRU is public API.

Change-Id: Icff4b20627fe93bf82e940d6d9a43b711c34349f
http://b/3184897
ase/BasicLruCache.java
ase/LruCache.java
d304af23ed896199b84ea7a1481e3f6042b6e243 04-Feb-2011 Elliott Hughes <enh@google.com> Merge "Improve CharsetDecoder's quality of implementation, like CharsetEncoder." into dalvik-dev
f938abcc05c2de327e46b0e27e6b4896cc0cd845 04-Feb-2011 Jesse Wilson <jessewilson@google.com> am adf31bd1: Merge "Permit cache elements to have non-symmetric sizes."

* commit 'adf31bd1326e32ba299fddc531672a4dd6c73448':
Permit cache elements to have non-symmetric sizes.
b3f2b1082275ed9f95153a077a45bafde6c2a55c 03-Feb-2011 Jesse Wilson <jessewilson@google.com> Permit cache elements to have non-symmetric sizes.

Change-Id: I2545ffb00130baab5b03b39bad972e08dbeb04b5
http://b/3184897
ase/LruCache.java
2981b5e8cf7c19dfd85b2088b18b7a6146825317 03-Feb-2011 Elliott Hughes <enh@google.com> Improve CharsetDecoder's quality of implementation, like CharsetEncoder.

As I suspected, CharsetDecoder doesn't cope with a character's bytes being
split across multiple writes any more than CharsetEncoder could cope with
halves of a surrogate pair being split across multiple writes. This seems
much more likely to have harmed applications than CharsetEncoder (since
surrogates are rare).

Anyway, ICU does the right thing here too, so the fix is basically the same.

I've also gone through the decoder/encoder code a bit to bring them more
in line with each other.

Bug: 3410124
Change-Id: I151d043e474161e324361cddfc73188ba73fd59c
cu/CharsetDecoderICU.java
cu/CharsetEncoderICU.java
dbf863488607fbb16a3d28c09f772d9581bd64ad 02-Feb-2011 Elliott Hughes <enh@google.com> Bring CharsetDecoderICU more in line with CharsetEncoderICU.

There's no need for separate 'flush' native code here either.

I've also explicitly set inEnd to 0 in CharsetEncoderICU which was
an oversight before; I've added a failing test. (Existing
tests for CharsetDecoder failed without the corresponding line.)

I've also made a comment in InputStreamReader match the equivalent comment
in OutputStreamWriter.

I'll make more invasive changes (looking at the INPUT_HELD stuff) when I've
written some tests for CharsetDecoder.

Change-Id: I39a3b2c017da1f991bdff33ebc8c226fc56841ba
cu/CharsetDecoderICU.java
cu/CharsetEncoderICU.java
cu/NativeConverter.java
33604713c5c70f9e6cad61dee6eb628db666bb22 01-Feb-2011 Elliott Hughes <enh@google.com> Improve CharsetEncoder to handle surrogates gracefully.

Behave like ICU rather than the RI, and transparently handle surrogate pairs
split across buffers. This fixes callers who were unaware of the bad design,
and shouldn't harm those callers who try to work around it (since they'll
never find themselves in the bad state).

Bug: 3408061
Change-Id: I6b5675196a14b15efdaa7084a82a483d8d2c47ad
cu/CharsetEncoderICU.java
cu/NativeConverter.java
9a4a53771e642f1f323bfa5e6d9f5aa07cdd0852 30-Jan-2011 Jesse Wilson <jessewilson@google.com> Merge commit 'e2b2e81f' into manualmerge

Conflicts:
luni/src/main/java/java/lang/Class.java
luni/src/main/java/java/lang/Enum.java

Change-Id: I191a233776965d4eb6c8c8ec67ec3596f8ddd57f
de591ee02f7615c7e5faa6c933dc08ac65055b61 28-Jan-2011 Jesse Wilson <jessewilson@google.com> Use an LRU to cache reflection objects in Class.

Change-Id: I275f5cf25c8ecc9f16555df56715ea75bc802574
http://b/3184897
ase/LruCache.java
8324278fa95470a42c01dc7678c36627d15d5007 17-Jan-2011 Elliott Hughes <enh@google.com> Slight cleanup of the TimeZones code.

Move the allocation down into JNI, since -- despite what the ancient
comment claimed -- it makes no difference. The de-duplication stays
in Java so we don't have to think about overflowing the local reference
table.

I did experiment with moving that down into native code, so we could
avoid the allocations in the first place, but it didn't make any
convincing difference.

Change-Id: I6cad52e83f1300c331cdb95544faa0be1efbfc08
cu/TimeZones.java
4ab15b795072beb75debd2e8456010dacb8e6f67 16-Jan-2011 Elliott Hughes <enh@google.com> Include more time zone abbreviations.

Time zone abbreviations are inherently ambiguous. Everywhere has a center, for
example, so there a large number of "CST"s. This code allows us to use
less-common abbreviations (such as "CET" for Central European Time in en_US),
provided they don't conflict with common abbreviations. When there are multiple
identical uncommon abbreviations, we take the first one we come across. (It's
possible we'll have to come back and change this so we only take the globally
unambiguous set, but I'm starting off optimistic.)

Sensible people are already using numeric offsets -- or better still Zulu
time -- so they won't be affected by this.

Bug: http://code.google.com/p/android/issues/detail?id=13420
Change-Id: I90ab9f9c23cd2616d55e470555754eb922cf917f
cu/TimeZones.java
fb0ec0e650bf8be35acb0d47da0311a7c446aa33 14-Jan-2011 Elliott Hughes <enh@google.com> Remove useless android-changed comments.

I've changed useful ones to regular comments or TODOs, as appropriate.

I've left ones in code like java.util.concurrent where we really are
tracking an upstream source, making the change markers useful.

I've left a handful of others where I intend to actually investigate
the implied TODOs before deciding how to resolve them.

Change-Id: Iaf71059b818596351cf8ee5a3cf3c85586051fa6
cu/CharsetDecoderICU.java
cu/CharsetEncoderICU.java
cu/CollationElementIteratorICU.java
ad41624e761bcf1af9c8008eb45187fc13983717 07-Jan-2011 Elliott Hughes <enh@google.com> Retire SecurityManager.

This change removes all the code that was calling getSecurityManager, and
removes all use of AccessController.doPrivileged. It also changes the
implementation of AccessController so it doesn't actually do anything; it's
only there for source-level compatibility.

Bug: 2585285
Change-Id: I1f0295a4f12bce0316d8073011d8593fee116f71
et/MimeUtils.java
d7fd1b88b89ca762afe5609d84a8eedfb611cbe1 07-Dec-2010 Brian Carlstrom <bdc@google.com> Adding binary hprof support to SamplingProfiler

SamplingProfiler refactored:
- HprofData is now a separate class, the common data structure
- SamplingProfiler uses HprofData as its runtime format
- AsciiHprofWriter refactored from profiler, takes an HprofData
- new BinaryHprofWriter to output HprofData in binary format
- new BinaryHprofReader can recreate HprofData from binary file
- new HprofBinaryToAscii command line tool to convert formats

dalvik/src/main/java/dalvik/system/SamplingProfiler.java

SamplingProfilerTest expanded to cover new HprofData class
directly. Includes testing of conversion from various hand constructed
HprofData to ascii and binary formats as well as from binary back to
HprofData with out loss of data.

dalvik/src/test/java/dalvik/system/SamplingProfilerTest.java

Change-Id: I6fe06f5dbdbf2f0bf2de228d9761f84d75290ba7
ase/Objects.java
9b255360071b7e07bf5ce68010b0497ff7ce61e7 13-Dec-2010 Elliott Hughes <enh@google.com> Merge "Lots more bounds-checking/exception-throwing consistency."
a1603838fe9e865575c87982e32c6343740e464c 11-Dec-2010 Elliott Hughes <enh@google.com> Lots more bounds-checking/exception-throwing consistency.

Overflow-safe checks all round, plus better detail messages. This isn't
quite everything, but it's a large chunk of the work. Most notably, this
is all of io and nio.

There are numerous changes of exception priority here, and the harmony
tests noticed a subset of them in the nio code. I've modified our checked-out
copy of the tests to accept any of the throwable exceptions.

Change-Id: Id185f1228fb9a1d5fc9494e78375b5623fb0fe14
ase/Streams.java
5bbfa5c19740eceffe0defb3062ccf7393bce922 10-Dec-2010 Elliott Hughes <enh@google.com> Merge "Adds new RawSocket class (and underlying jni implementation). This is a utility class for an experimental Java implementation of dhcp. The client DHCP implementation needs to construct, send, receive, and parse raw L2 packets before the network interface is configured with an IP address. Current Java networking classes do not work with unconfigured network interfaces."
975dc421bdf9f207ed88b3fbedbba558f0f62c3c 10-Dec-2010 Stan Chesnutt <chesnutt@google.com> Adds new RawSocket class (and underlying jni implementation). This is a
utility class for an experimental Java implementation of dhcp. The client
DHCP implementation needs to construct, send, receive, and parse raw L2
packets before the network interface is configured with an IP address. Current
Java networking classes do not work with unconfigured network interfaces.

Change-Id: I4dd0133868da5b84bd2a471c33173d4c056c34e8
et/RawSocket.java
866e7ae17a3da81a02b0b144e0c9c2b3196d293a 09-Dec-2010 Elliott Hughes <enh@google.com> Fix a bunch of javac -Xlint warnings in our code.

I think "fallthrough" uncovered a couple of real bugs in the kxml code, but
other than that there's nothing very exciting here. This addresses all but
one of the non-xml warnings. I'm assuming that we'll move the xml cruft out
into external at some point (since we're deliberately not maintaining it).

Change-Id: Ice81253b019df7b19d6557e719663b7bdc11fb22
cu/CharsetDecoderICU.java
cu/CharsetEncoderICU.java
cu/CollationElementIteratorICU.java
cu/NativeBreakIterator.java
cu/NativeDecimalFormat.java
5501a3d4b3d7657c183ed5446fe67fa011fbf70b 03-Dec-2010 Elliott Hughes <enh@google.com> Comments/javadoc should be in en_US, not en_CA.

Change-Id: Ie9dde4971e0a6a8dadd14af43d631158fc488cd8
cu/CharsetDecoderICU.java
cu/CharsetEncoderICU.java
086fd0244a54fa5ecf13ea66d49b22b36d7d456e 30-Nov-2010 Jesse Wilson <jessewilson@google.com> Fix XML DOM test failures and close guard warnings.

Fix KxmlParser to capture the DTD's root element name, system ID and
public ID. This is more robust than capturing the same in the pull-to-DOM
adapter.

Fix close guard warnings in XML tests. Close input streams of resource
files. Don't catch exceptions only to call fail().

http://b/3090550
Change-Id: I7cfafde58cc28af79c48386a4d124803c8791328
ase/Streams.java
a78c2aac2a73f001aa00971adfae90af4d6726fb 14-Nov-2010 Jesse Wilson <jessewilson@google.com> Add interning to KxmlPullParser.

Adding just a small interning pool improves performance even further.
Combined with the first round of optimizations, total improvement for
three large files is 51% 56% and 42%. Performance on a small file
improved 3%. When interning is checked in, Kxml will be significantly
faster than Expat's pull parser for everything but very small files.

/sdcard/xml/com.amazon.mp3.meta /sdcard/xml/com.cooliris.picasa /sdcard/xml/com.rhapsody.Deauth /sdcard/xml/com.snoggdoggler.r
benchmark run us linear runtime % us linear runtime % us linear runtime % us linear runtime %
Dom baseline / master 210,256 ============================== 184% 53,227 ============================== 171% 2,183 ============================== 151% 164,708 ============================= 200%
Dom first optimizations 174,580 ======================== 153% 40,964 ======================= 132% 1,968 =========================== 136% 130,814 ======================= 159%
Dom new interning 163,366 ======================= 143% 35,736 ==================== 115% 2,116 ============================= 147% 121,870 ====================== 148%
ExpatPull baseline / master 130,078 ================== 114% 21,700 ============ 70% 759 ========== 53% 85,578 =============== 104%
ExpatPull first optimizations 129,776 ================== 114% 21,621 ============ 70% 734 ========== 51% 86,799 =============== 105%
ExpatPull new interning 130,971 ================== 115% 21,627 ============ 70% 723 ========= 50% 86,555 =============== 105%
KxmlPull baseline / master 114,317 ================ 100% 31,040 ================= 100% 1,443 =================== 100% 82,478 =============== 100%
KxmlPull first optimizations 88,716 ============ 78% 20,578 =========== 66% 1,560 ===================== 108% 58,567 ========== 71%
KxmlPull new interning 55,773 ======= 49% 13,692 ======= 44% 1,394 =================== 97% 48,068 ======== 58%

http://b/3090550
Change-Id: I4515546abbbcf940de7be22f26925c4334e59146
nternal/StringPool.java
bbf2c7d0462bb2c612e5a1a28e6d0ce5413d746d 12-Nov-2010 Elliott Hughes <enh@google.com> Tidy up some jar-related code.

...and kill InputStreamHelper by inlining all that's left into the sole caller.

Change-Id: Iadddba9f067a1af2a2a66803aa9ef26ea6dc3396
ase/Streams.java
693eacca9fa67ad79d1b35dbaad61c5ac1ac457c 10-Nov-2010 Elliott Hughes <enh@google.com> Stop allocating empty arrays.

Bug: 3166662
Change-Id: I151de373b2bf53786d19824336fa434c02b0b0e8
ase/EmptyArray.java
b5bde2fd72189192b52e726a2d606d70c3c8a34b 02-Nov-2010 Elliott Hughes <enh@google.com> More shift removal.

A few more customers for OSMemory's peek/poke abilities, and a bunch of shifts
that should have been multiplications.

Bug: 3032515
Change-Id: Ic518fd8f7565d67523ea10e3f5afca3a9c8501b8
o/BufferIterator.java
o/HeapBufferIterator.java
o/NioBufferIterator.java
0eb70e31581a977afa5df3292d1c96e42e548821 28-Oct-2010 Elliott Hughes <enh@google.com> Optimize DataInputStream and a few friends.

Also ensure that we're doing a correct readFully when reading
shorts/ints/longs.

Bug: 3032515
Change-Id: I39e6f926537f5d55063db8fc1c5a1b4b794746d4
ase/Streams.java
be013ce620f6d3bd24f7f0b631a36f70197ac3e3 23-Oct-2010 Jesse Wilson <jessewilson@google.com> Change ThreadGroup to no longer hold strong references to threads.

This is intended to fix an issue where threads were leaking when
they weren't started.

This changes a lot of the internals of ThreadGroup, taking advantage
of a new utility method dereferenceIterable that turns a collection
of references into the corresponding iterable of referents.

Change-Id: I8d96c79b4ee30c557276854b38149b9131b656ee
http://b/1937448
ase/CollectionUtils.java
43a9f774d075e0e441d8b996e3f6c81ea483ec89 19-Oct-2010 Elliott Hughes <enh@google.com> BufferIterator support for byte[].

Bug: 3032515
Change-Id: I040a92c3ce241aa97719ff94e3cc31c62473bf46
o/BufferIterator.java
o/HeapBufferIterator.java
o/MemoryMappedFile.java
o/NioBufferIterator.java
o/SizeOf.java
4dfae7b3e2b56160646c17d93b32b3ff495c0053 07-Oct-2010 Elliott Hughes <enh@google.com> Finish (for now) the icu4jni cleanup.

This is the most interesting change, now all the pieces are in place. The
concrete Collator implementation (now called RuleBasedCollatorICU for clarity)
becomes quite a bit simpler.

Bug: 3045778
Change-Id: I98fb5b78c42a13584e541818aa4427c78add79d0
cu/CollationKey.java
cu/CollationKeyICU.java
cu/RuleBasedCollatorICU.java
cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1f 04-Oct-2010 Elliott Hughes <enh@google.com> More package-jiggling for our ICU-related code.

Bug: 3045778
Change-Id: Ia9b29b28512deca6bd9dad806468238f8db2a8b9
cu/CollationElementIteratorICU.java
cu/CollationKey.java
cu/NativeCollation.java
a7a70410e26802f3ab480b08a1ab499338cb6f7e 03-Oct-2010 Jesse Wilson <jessewilson@google.com> Use IoUtils.closeQuietly where possible.

Change-Id: I354c1e00b7068108032d09c0a1c38e29f6283fb0
o/IoUtils.java
c27a366a89e470690e99374b15270e7b9169ade1 02-Oct-2010 Elliott Hughes <enh@google.com> More icu4jni reshuffling.

Bug: 3045778
Change-Id: Iafb367f97d1fb169c6106adad0525cfcc0e10f25
cu/NativeBreakIterator.java
cu/NativeDecimalFormat.java
162b0775772fa66b7eb634760a8159a60c1ddcea 02-Oct-2010 Elliott Hughes <enh@google.com> Move more stuff out of icu4jni; ICU and LocaleData.

Bug: 3045778
Change-Id: I59fd27920a2da9a42b29fd79b8d81bdaabdef8cd
cu/ICU.java
cu/LocaleData.java
644ccb2c3d69ee6f3a69996ca7651b84d409fe41 02-Oct-2010 Elliott Hughes <enh@google.com> Start moving icu4jni classes into libcore.icu.

Bug: 3045778
Change-Id: I8d87c31d36b441a69e6d3259e700b7133dfdc803
cu/CharsetDecoderICU.java
cu/CharsetEncoderICU.java
cu/CharsetICU.java
cu/ErrorCode.java
cu/NativeConverter.java
5df6708702ddd1405e7d0a39e9f806cefd330028 01-Oct-2010 Jesse Wilson <jessewilson@google.com> am ff805724: am 16bba11e: Merge "Don\'t use the decompression-buffer as the skip buffer in InflaterInputStream." into gingerbread

Merge commit 'ff8057246a6d43a55c93c9c728a6dddb0d98fcdb'

* commit 'ff8057246a6d43a55c93c9c728a6dddb0d98fcdb':
Don't use the decompression-buffer as the skip buffer in InflaterInputStream.
3541c79d5058b86e742867b4ee5811a1de01de1f 30-Sep-2010 Jesse Wilson <jessewilson@google.com> Don't use the decompression-buffer as the skip buffer in InflaterInputStream.

This has bad consequences for the GzipInputStream subclass, which can't
use the input buffer as a scratch space because it needs to CRC all of
the decompressed data.

Change-Id: I310261dc8ef7a5082768cc6d6a2eff4ef77f5a21
http://b/3042574
ase/Streams.java
63fcdd7e833df417cfbd60961a5167ce637f3071 29-Sep-2010 Brian Carlstrom <bdc@google.com> resolved conflicts for merge of 53e83038 to master

Conflicts:
luni/src/main/java/java/io/FileInputStream.java
luni/src/main/java/java/io/FileOutputStream.java
luni/src/main/java/javax/crypto/ExemptionMechanism.java
luni/src/main/java/org/apache/harmony/luni/net/PlainDatagramSocketImpl.java
luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java

Change-Id: I0dd5da8e8cb1819cb90440c462ba307dffde8ed7
e2f58c9501eac730d048199906dc41fe8e4cd6e9 29-Sep-2010 Brian Carlstrom <bdc@google.com> Scrub missing calls to super.finalize()

Bug: 3024226
Change-Id: I6642cb9d4929ba72244529efe4ebdfa595ae4fa7
cu/NativePluralRules.java
ae704b984c10a63883cc366e823d53902d6ac7a9 21-Sep-2010 Elliott Hughes <enh@google.com> Minor tidy-up.

The nio implementation is still a bit of a mess because Java doesn't have any
kind of "module" concept, nor "friend". But this makes it a little less untidy,
and makes the deliberate access control subversions a little more explicit, and
makes various things less accessible than they were.

Change-Id: I514b1e24000b91f86b768ed408fedae115dc3080
o/MemoryMappedFile.java
bffb058e565a97f838247f1e092b0d17b26cb68e 21-Sep-2010 Elliott Hughes <enh@google.com> Stop doing unbuffered file I/O in ZoneInfoDB.

Use the new memory-mapped code for the index as well as for individual time
zones. This takes the (once-only, during boot) index-reading time down
from ~90ms to ~20ms. DataInputStream(BufferedInputStream(FileInputStream))
would have got us down to ~40ms.

Also remove duplication amongst code snippets that want to read a whole file
into a byte[].

Bug: 3014973
Change-Id: I9d8a326438663314b7f5ee0145cda32ea335f41d
o/IoUtils.java
o/MemoryMappedFile.java
d6b9f2e0e9640ff9c896b394716cf5e7eee6e257 14-Sep-2010 Elliott Hughes <enh@google.com> Much faster TimeZone.getTimeZone using a new private mmap(2) interface.

froyo:

benchmark us logarithmic runtime
TimeZone_getDefault 8.43 =
TimeZone_getTimeZoneUTC 1140.19 ===========================
TimeZone_getTimeZone_America_Caracas 1537.78 ============================
TimeZone_getTimeZone_America_Santiago 1920.50 =============================
TimeZone_getTimeZone_GMT_plus_10 1089.90 ==========================
TimeZone_getTimeZone_default 1105.54 ===========================

dalvik-dev:

benchmark us logarithmic runtime
TimeZone_getDefault 7.37 =
TimeZone_getTimeZoneUTC 30.35 ================
TimeZone_getTimeZone_America_Caracas 35.98 ==================
TimeZone_getTimeZone_America_Santiago 100.21 ==============================
TimeZone_getTimeZone_GMT_plus_10 43.83 ====================
TimeZone_getTimeZone_default 31.32 =================

There are two main changes. The biggest one is to use our own private mmap(2)
API. We might want to make this more generally available in the long term, but
for now it's pretty unsafe; we do nothing to detect invalidated iterators, and
we do no bounds checking. But that's fine for our internal use.

The other change is to recognize that we don't actually need the abbreviated
names. We were only using them for hashCode and equals, and the canonical Olson
id seems like a much better choice for those purposes! That then means that we
don't need to read in as much data in the first place. This makes more
difference for simpler time zones (such as Caracas in the example) because the
overhead is pretty much fixed.

The profile now has us spending most of our time in String.compareTo (for the
binary search) and in OSMemory (paying for our slow native method calling).

Change-Id: I848a318572008e0be8a4a330bb14d2f791353200
o/BufferIterator.java
o/MemoryMappedFile.java
706de1164836051ab31cc69eb77a6bba1a723896 27-Aug-2010 Elliott Hughes <enh@google.com> Minor tidy-up of Float.toString and Double.toString.

This patch looks larger than it is. I've moved duplicated constants out of
Math and StrictMath and into Float and Double where they belong. I've also
moved a table out of BigDecimal so I can reuse it in NumberConverter, which
I've renamed to RealToString.

The main active ingredient here is that there's no longer StringBuilder usage
to prepend '-'. This actually brings us down from 74ns to 62ns for an easy
case like 123.45f.

[cherry-pick of 910106e29fe98f14b2c36312a7498287273ba826 from dalvik-dev to gingerbread; plus build fix]

Bug: 2934304
Change-Id: Id79a6fb0d739e673b7428d240fc48bdae9b8bb43
ath/MathUtils.java
910106e29fe98f14b2c36312a7498287273ba826 27-Aug-2010 Elliott Hughes <enh@google.com> Minor tidy-up of Float.toString and Double.toString.

This patch looks larger than it is. I've moved duplicated constants out of
Math and StrictMath and into Float and Double where they belong. I've also
moved a table out of BigDecimal so I can reuse it in NumberConverter, which
I've renamed to RealToString.

The main active ingredient here is that there's no longer StringBuilder usage
to prepend '-'. This actually brings us down from 74ns to 62ns for an easy
case like 123.45f.

Bug: 2934304
Change-Id: I65461753247eeb9ff890ffe66b0bc79d66d2ec9c
ath/MathUtils.java
f14cadb15b06371fb9a6daf885dc1c4bccf975b9 10-Aug-2010 Elliott Hughes <enh@google.com> Minor TimeZone cleanup.

Getting ready to do some real work here, I thought I'd improve the
documentation and remove some cruft.

Bug: 2870945
Change-Id: I771badc8afa5c0a5f77880f64e1542d77672d984
o/IoUtils.java
440ba565fa5384bc23255fbc412f7b97fcbdccd9 04-Aug-2010 Elliott Hughes <enh@google.com> Rename setNonBlocking to setBlocking.

This makes the boolean argument less confusing.

Change-Id: Ic226f6d3c5afe8e15a95e74917656424f8a448fe
o/IoUtils.java
99a89dd6f0a0e1396aa9b3feebf15ea31f703d3a 04-Aug-2010 Elliott Hughes <enh@google.com> Rewrite the nio Pipe to use a Unix pipe behind the scenes.

We were using an AF_INET or AF_INET6 socket to implement the nio Pipe, which
was causing trouble for people on systems where IPv6 wasn't working yet.

This patch switches over to pipe(2). My first implementation used socketpair(2)
and retained the SocketChannelImpls, but it still seemed a bit off to be asking
for a full-duplex pipe to implement a unidirectional channel, and it required
hacks in the networking code to cope with the AF_LOCAL family, and in the
BlockGuard for the isLingeringSocket test.

This implementation uses pipe(2) and FileChannelImpl. It breaks a few tests, but
the tests are wrong, and it actually brings us closer to the RI's behavior of
throwing IOException "broken pipe" when writing to a broken pipe.

Rather than keep throwing junk into the FileSystem/NetworkSystem classes, and
resolving the question of which of those setNonBlocking belonged in (answer:
neither; this is a false Windows-style dichotomy that isn't helpful here), I've
added a new IoUtils with a few generally useful methods. The remainder of this
patch switches over existing code. We could probably make
FileDescriptor.descriptor private now I've exposed accessors, but this change
is large enough already...

Bug: 2735373
Bug: http://code.google.com/p/android/issues/detail?id=9431
Change-Id: I6b6d1e50bdddd435e71c31105a73c9d4fd135d7e
o/IoUtils.java
7b3ebefcdf79a251cf2a5619dd2354952fc67665 02-Aug-2010 Elliott Hughes <enh@google.com> Use the existing mime-type/extension mapping from frameworks/base.

(An accompanying change to frameworks/base switches that over so that both
android.webkit.MimeTypeMap and java.net.URLConnection use the same data.)

Bug: 2422917
Bug: http://code.google.com/p/android/issues/detail?id=10100
Change-Id: I37f008a00093efcf7b336ea0c206e8977544b0bf
et/MimeUtils.java
c0372d90016d241ac979faa6fa1731f30b6f2a03 13-Jul-2010 Jesse Wilson <jessewilson@google.com> Cleanup HTTP retries.

We now do the right thing when redirects point us at a different
host or a different scheme.

Also...

Invert the parameter to AbstractHttpInputStream.endOfInput()
and HttpURLConnection.releaseSocket() to be positive 'reuse'
rather than negative 'close'. It makes the code in that method
read better.

Combine discardResponse() and endRequest(). The new method is
discardIntermediateResponse(). Cleanup how we handle intermediate
responses, and how those connections get recycled.

Remove HttpURLConnection's cached fields for proxy addresses.
Instead just update the proxy field when those fields change.
This attempts to make it clear that the names represent the
connected address and not the origin server's address. (This
is different when a proxy is in use.)

Document a consistent interpretation of the inherited protected
field 'connected'. Unfortunately it does not mean connected.

Change-Id: I8d4b65bffa5aeba353186b60cf951232f7762a18
ase/Streams.java
3b777d1b4c1dc5d4c817fb70167b02a4f7e15092 24-Jun-2010 Elliott Hughes <enh@google.com> A couple of intention-revealing renames I missed in the last commit.

Change-Id: Ifb16948b201d3f5e2359550d36ef66b213b0ac4c
cu/TimeZones.java
21557bb6a8f35a2f9889adba449cac950c9d41b9 23-Jun-2010 Elliott Hughes <enh@google.com> Add TimeZones.forLocale, plus some tidying.

The new feature here is TimeZones.forLocale and the accompanying JNI. I've also
taken the liberty of pulling the time zone stuff out of ICU.java and ICU.cpp,
and I've moved some of the ICU-related code I've written recently (NativeIDN,
NativeNormalizer, and NativePluralRules) into a new libcore.icu package.

I've also renamed various things so the implementation details use the same
terminology as the thing they're implementing.

Bug: 2790386
Change-Id: Ie39a2f5f7023e8e29864de15790be8a660f5cba6
cu/NativeIDN.java
cu/NativeNormalizer.java
cu/NativePluralRules.java
cu/TimeZones.java
e32b21f14d52bac429a9c54fe031f9e92c911d64 18-Jun-2010 Jesse Wilson <jessewilson@google.com> Implementing ZoneInfo.hasSameRules().

Moving TimeZoneTest to OldTimeZoneTest and removing test methods
that are duplicated between libcore and Harmony.

Also adding Objects.equals() to make implementing this easy,
and removing redundant time zone tests. I did a few searches
to find candidate code that could take advantage of this new
utility method and adopted it there.

Change-Id: I133298f1b36d755bd35c1ad0dc0ab366fd164270
ase/Objects.java