summaryrefslogtreecommitdiffstats
path: root/luni
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Add FLOAT entry to EmptyArray"Elliott Hughes2014-07-291-0/+1
|\
| * Add FLOAT entry to EmptyArrayMichael Wright2014-07-291-0/+1
| | | | | | | | Change-Id: I70a591093557ce3dd0471bcc7e888d630c80bb88
* | Fix Character.getDirectionality.Elliott Hughes2014-07-293-12/+27
| | | | | | | | | | | | | | | | | | | | Previously we'd throw ArrayIndexOutOfBoundsException for U+2066..U+2069. Now we'll return DIRECTIONALITY_UNDEFINED. I've exposed (via @hide) the underlying icu4c implementation so that frameworks code at least can work with the new explicit bidi formatting characters. Bug: 15492712 Change-Id: I96583c7e1c6be26d3f1a857615a1042d58e9feaf
* | Merge "SSLSocketFactory: don't reload the default if class name is same"Kenny Root2014-07-242-20/+31
|\ \
| * | SSLSocketFactory: don't reload the default if class name is sameKenny Root2014-07-232-20/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't bother to reload the default SocketFactory if the requested classname didn't change since the last time. Also make the warning when classloading fails more terse. Most of the time the ClassLoader is wrong, so giving them a hint via ClassLoader#toString is sufficient. Bug: 16468683 Change-Id: I36844e942ccadda993c9f5a1523b2a66280903f3
* | | OsConstants: add PR_GET_DUMPABLE / PR_SET_DUMPABLENick Kralevich2014-07-242-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expose PR_GET_DUMPABLE and PR_SET_DUMPABLE via java. This is a cherrypick of two commits from internal master: * 1fc6b04adc87e752aa35bedb7617b5145d835d7c * 514b1d21f66caff9f26fcf042882c5115b5431c4 Change-Id: Ibb60ed1d00c3a84fa77a34d0acc56cb995d14e1c
* | | Modified array threshold length for primitive types in arraycopy function.Emma Meersman2014-07-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | As a result of improved benchmarking, the arraycopy function runs 35% faster on average than a straight call to the native code for arrays of length 32 or shorter. Bug: 7103825 Change-Id: I68600b01a6218d761be874528cfa70de56efdfdc
* | | Merge "Remove workaround for *.clients.google.com."Alex Klyubin2014-07-231-4/+1
|\ \ \
| * | | Remove workaround for *.clients.google.com.Alex Klyubin2014-07-231-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the workaround for broken TLS/SSL server certificates that were being presented by android.clients.google.com in early 2012 (8576f309825e23add080f2a50345ec1884939c39). The server is presenting better certificates these days and the workaround is no longer needed. Bug: 5426333 Change-Id: I4e7be7bcf522f2d210a596aa03b86a19884e075a
* | | | Fix serialization / deserialization of SealedObjectNeil Fuller2014-07-242-29/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to apphelia@ for the report. The readObject() implementation had hardcoded the field order incorrectly leading to a couple of fields being swapped on each serialization: paramsAlg and sealAlg. This was wrong as far back as 2009 so the class has likely never worked for its intended purpose. Field order during Serialization is primitives first, then fields. Secondary ordering is alphabetical. The purpose of overriding readObject() at all is for safety in the event of compromised stream data. It would be more appropriate to clone() rather than readUnshared(). readUnshared() assumes a corresponding writeUnshared(), which is not present. The readUnshared() probably only works here because the byte[] arrays typically are not shared anyway. From reading latest guidelines on safe serialization the code need not be order-specific: it can use readFields(). s.defaultReadObject() could have been used instead but the guidelines recommend against. Performance is probably not a concern. Until now nobody could have been using SealedObject for its intended purpose otherwise they would have noticed this bug (or they were always serializing / deserializing an even number of times!). Anybody attempting to use SealedObject on earlier versions of Android will need to serialize / deserialize twice to avoid the bug. After this fix the class will work as intended. Additional: Some duplicated code has been extracted into methods, and streams are now closed when they are finished with. In reality this will have no effect given the stream implementations involved. Bug: https://code.google.com/p/android/issues/detail?id=73235 Change-Id: If745d6556437ae7839543e66dd15f912afd4ec98
* | | | Throw an error when parsing an obviously bad DoubleNeil Fuller2014-07-242-7/+41
| |/ / |/| | | | | | | | | | | | | | | | | Thanks to Robbie Hott for the bug report. Bug: https://code.google.com/p/android/issues/detail?id=71216 Change-Id: I402fa27e0b90c1c1d26169d79c7061e4a2caa138
* | | Merge "Fix handling of invalid locales in Date/DecimalFormatSymbols."Narayan Kamath2014-07-235-22/+37
|\ \ \
| * | | Fix handling of invalid locales in Date/DecimalFormatSymbols.Narayan Kamath2014-07-235-22/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Add math tests in csv format for libcore math functions"Jeff Hao2014-07-226-0/+10328
|\ \ \ \
| * | | | Add math tests in csv format for libcore math functionsMichael Chen2014-07-216-0/+10328
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal here is to have a csv file with math tests that different parts of Android can all use the same math tests. This change provides these initial csv files as well as the corresponding testing framework for libcore. Change-Id: I56430bd9224d92853aefa5024d6fdd1d10dfb255
* | | | Fix broken nio BufferTest and add alignment test.Mathieu Chartier2014-07-221-9/+23
| |/ / |/| | | | | | | | | | | | | | Bug: 16486921 Bug: 16449607 Change-Id: Ib1871d0fa09bfc3fbf3c041f56ee74fd7a234a5a
* | | Support for a android.text.format.Time implemented entirely in JavaNeil Fuller2014-07-223-5/+673
| | | | | | | | | | | | | | | Bug: 15765976 Change-Id: Ic743168a54ff96e5403a9c73c27eeb7d482a01dc
* | | Implement Locale.forLanguageTag in java.Narayan Kamath2014-07-225-133/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Expand visibility of adjustLanguageCode."Narayan Kamath2014-07-171-1/+4
|\ \ \
| * | | Expand visibility of adjustLanguageCode.Narayan Kamath2014-07-181-1/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | There's already one copy in the frameworks (in the resource system) and we will need to add another copy to the code that sets system locales from the SIM. Change-Id: I24d88ea8da0c4f1de26dde2f86e4880507b1da4b
* | | Merge "Make ByteBuffer.allocateDirect be 8 byte aligned."Mathieu Chartier2014-07-171-1/+5
|\ \ \ | |/ / |/| |
| * | Make ByteBuffer.allocateDirect be 8 byte aligned.Mathieu Chartier2014-07-211-1/+5
| |/ | | | | | | | | | | Bug: 16449607 Change-Id: I4a854d55f49fe709965c6b6a769fb58c356627dc
* | Merge "CipherTest: check multiple calls to doFinal work"Kenny Root2014-07-171-0/+8
|\ \
| * | CipherTest: check multiple calls to doFinal workKenny Root2014-07-141-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In existing implementations of JSSE Cipher providers, calling "doFinal" resets the cipher to the state it was at when "init" was called. Note that this is dangerous to do, but it appears some people do it. Bug: 16298401 Bug: http://code.google.com/p/android/issues/detail?id=73339 Change-Id: I32e26fde660dc7c50fdac0d74d5d97801f1da9f9
* | | Revert "Revert "Add a cache for ZoneInfo objects in Java""Neil Fuller2014-07-174-13/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 01b6a878d10ee68db87c3d85d137e81a5257a78a. Contains a fix for when the timezone ID is not found. This includes a new test. Change-Id: I2e5e669782ea6caf4e97153ed6b63ca6ee4ef50d
* | | Merge "Revert "Add a cache for ZoneInfo objects in Java""Neil Fuller2014-07-174-53/+13
|\ \ \
| * | | Revert "Add a cache for ZoneInfo objects in Java"Neil Fuller2014-07-174-53/+13
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a6e8689807f5a8bb9470ce7c26a47455d2d0608d. Change-Id: I17a0262d169db3418f2f8888195381f778975dc4
* | | | Merge "Fix UnmodifiableEntrySet.toArray() ordering"Neil Fuller2014-07-171-1/+1
|\ \ \ \ | |/ / / |/| | |
| * | | Fix UnmodifiableEntrySet.toArray() orderingNeil Fuller2014-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | toArray() was returning entries in reverse order. toArray(T[]) was correct. Thanks to Chris Povirk for discovering. The fix is simple. Change includes additional tests to avoid regressions. Test & support code has been cleaned up a little to improve coverage and make it (slightly) less horrible. Bug: https://code.google.com/p/android/issues/detail?id=72073 Change-Id: I42ff90e0f592482289cd0cd9fdbdaabf0c17ad93
* | | | Add a cache for ZoneInfo objects in JavaNeil Fuller2014-07-164-13/+53
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Tidy up OldAndroidLocaleTest#testICULocales.Narayan Kamath2014-07-161-6/+11
| | | | | | | | | | | | | | | | | | | | | Construct the locale object directly instead of having a list of strings and parsing them by hand. Change-Id: Ia26ab30cbe7c5e6e10aca81a0d55b213879b5112
* | | TLS-PSK cipher suites enabled when PSKKeyManager is provided.Alex Klyubin2014-07-143-8/+122
| |/ |/| | | | | | | | | | | | | This documents and tests that TLS-PSK cipher suites are enabled if a PSKKeyManager is provided to SSLContext during its initialization. Bug: 15073623 Change-Id: I8e2bc3e7a1ea8a986e468973b6bad19dc6b7bc3c
* | Merge "TLS-PSK cipher suites should appear in API Level 21."Alex Klyubin2014-07-112-16/+16
|\ \
| * | TLS-PSK cipher suites should appear in API Level 21.Alex Klyubin2014-07-082-16/+16
| | | | | | | | | | | | | | | | | | | | | This also fixes a typo in two TLS-PSK cipher suite names. Bug: 15073623 Change-Id: I92d289c2b91862529faf6e06f2eb9b0a21d42b52
* | | Merge "Invalidate cache of default SocketFactory"Kenny Root2014-07-104-0/+193
|\ \ \
| * | | Invalidate cache of default SocketFactoryKenny Root2014-06-274-0/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the default SocketFactory is set once and never invalidated. Use the Services cache version number to know when to invalidate our cache. This increases the time to get the default implementation from 63ns to 97ns on a Nexus 7 (2013) aka deb. Change-Id: I5d46f02fccaa25e5bcea69d5ca0e4924290cf0e1
* | | | Merge "KeyPairGeneratorTest: add back some DH tests"Kenny Root2014-07-101-6/+23
|\ \ \ \
| * | | | KeyPairGeneratorTest: add back some DH testsKenny Root2014-07-101-6/+23
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add back the DH tests that uses a pre-defined Diffie-Hellman prime and generator. Keep the tests that try to find safe prime disabled. Bug: 5513723 Bug: 16188130 Change-Id: If77b14287855528964665e7782be45c5f57434db
* | | | Merge "Fix unit tests now that the "tl" -> "fil" hack is gone."Narayan Kamath2014-07-091-11/+27
|\ \ \ \
| * | | | Fix unit tests now that the "tl" -> "fil" hack is gone.Narayan Kamath2014-07-071-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | bug: 15873165 Change-Id: I2ffe1f384e2140b31adb72d1f4eaa029a70428f0
* | | | | Switch libcore to the new icu.Elliott Hughes2014-07-091-2/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I58ec1fafdf5524538ac14c52d561bf93d5a6c946
* | | | | Remove more.Elliott Hughes2014-07-074-100/+3
| |_|/ / |/| | | | | | | | | | | | | | | | | | | (cherry-pick of f39b5ca3c6378c3c36c63889577004b9693ea9c6.) Change-Id: Idaf030cd369e728ec37df7107cd30062db899b7c
* | | | Remove.Elliott Hughes2014-07-0734-4938/+149
| | | | | | | | | | | | | | | | | | | | | | | | (cherry-pick of 63744c884dd4b4f4307f2b021fb894af164972af.) Change-Id: Ibf79a402e1bad98a262e380fcee3d35c127ae6d5
* | | | RemoveBrian Carlstrom2014-07-076-270/+0
|/ / / | | | | | | | | | | | | | | | (cherry picked from commit 36214feb86a0963b23f34c8c63584252bd757e19) Change-Id: I96d5109c01e39255b9970f7a515ddd3575a50e56
* | | Revert "Rename Arrays.ArrayList to Arrays.ArrayAdapter."Narayan Kamath2014-07-011-3/+3
| | | | | | | | | | | | | | | | | | This reverts commit 4b999a474eb92e0b89a34de56f3f7979fd491aa1. Change-Id: Ifd70798e74357ffe14cbc659ad49a9853b3be8c6
* | | Rename Arrays.ArrayList to Arrays.ArrayAdapter.Narayan Kamath2014-07-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Looking at Arrays.asList in isolation, it's easy to assume that the method returns a java.util.ArrayList instead of a private static class with the same name and different behaviour. Change-Id: Icd75a4a3d0e21c1302ca766e529172cf2de30c2c
* | | Fix System.arraycopyAndreas Gampe2014-06-261-52/+0
|/ / | | | | | | | | | | The generic version of arraycopy does not work. Remove it. Change-Id: I524289874cfbf62ed0af3c91264180041342c3f1
* | Merge "Fix a faulty Julian day computation."Elliott Hughes2014-06-264-5/+62
|\ \
| * | Fix a faulty Julian day computation.Elliott Hughes2014-06-264-5/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Clarify the String.compareTo contract and add tests."Elliott Hughes2014-06-261-0/+67
|\ \ \