summaryrefslogtreecommitdiffstats
path: root/luni/src/main
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | 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
* | | | Revert "Revert "Add a cache for ZoneInfo objects in Java""Neil Fuller2014-07-173-13/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-173-35/+13
|\ \ \ \
| * | | | Revert "Add a cache for ZoneInfo objects in Java"Neil Fuller2014-07-173-35/+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-163-13/+35
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | TLS-PSK cipher suites enabled when PSKKeyManager is provided.Alex Klyubin2014-07-142-8/+14
| |/ |/| | | | | | | | | | | | | 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-103-0/+19
|\ \ \
| * | | Invalidate cache of default SocketFactoryKenny Root2014-06-273-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Switch libcore to the new icu.Elliott Hughes2014-07-091-2/+2
| | | | | | | | | | | | | | | | Change-Id: I58ec1fafdf5524538ac14c52d561bf93d5a6c946
* | | | Remove more.Elliott Hughes2014-07-073-53/+3
| |/ / |/| | | | | | | | | | | | | | (cherry-pick of f39b5ca3c6378c3c36c63889577004b9693ea9c6.) Change-Id: Idaf030cd369e728ec37df7107cd30062db899b7c
* | | Remove.Elliott Hughes2014-07-0724-2681/+119
| | | | | | | | | | | | | | | | | | (cherry-pick of 63744c884dd4b4f4307f2b021fb894af164972af.) Change-Id: Ibf79a402e1bad98a262e380fcee3d35c127ae6d5
* | | RemoveBrian Carlstrom2014-07-074-161/+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-263-5/+20
|\ \
| * | Fix a faulty Julian day computation.Elliott Hughes2014-06-263-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "Fixed build for arraycopy with objects."Jeff Hao2014-06-261-3/+3
|\ \ \
| * | | Fixed build for arraycopy with objects.Emma Meersman2014-06-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Enabled arraycopy to call native code when passed two objects. Change-Id: I77f9455550acc53ab59ec2dc85cb1fe4d75583c9
* | | | Merge "Expanded arraycopy function to deal with more types and updated ↵Jeff Hao2014-06-261-2/+427
|\ \ \ \ | |/ / / | | | | | | | | benchmarking."
| * | | Expanded arraycopy function to deal with more types and updated benchmarking.Emma Meersman2014-06-231-2/+427
| |/ / | | | | | | | | | | | | | | | | | | | | | Runs 48% faster on average for short arrays of length 16-128, depending on the type. Defaults to native code for longer arrays. Bug: 7103825 Change-Id: I70ca8f4a379600917e5bc103364af0637f18e03a
* | | Don't return NULL as a jint.Ian Rogers2014-06-241-1/+1
| | | | | | | | | | | | | | | | | | Build fix. Change-Id: I49a566c3c34d2040e092689e52b0039c8195de03
* | | Merge "Build fix: Remove reference to deleted java_io_Console function"Neil Fuller2014-06-201-1/+0
|\ \ \
| * | | Build fix: Remove reference to deleted java_io_Console functionNeil Fuller2014-06-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function was deleted by 1f3014901704f3ae81538773b8a0b382945adc8d Bug: 12491103 Change-Id: If75f1f05d6a72cac7b7a86b7616bae870615452e
* | | | Merge "Unimplement Console.readPassword and remove test"Neil Fuller2014-06-203-87/+4
|\ \ \ \ | |/ / /
| * | | Unimplement Console.readPassword and remove testNeil Fuller2014-06-233-87/+4
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConsoleTest.test_readPassword* fails CTS tests. Context: Under standard Android applications the System.console() method will return null. The Console.readPassword() method must turn off echo. Under automated tests the ConsoleTest is exercising a Console object with fake stdout / stdin streams to get around the absence of a System.console(). setEcho() is hardcoded to use stdin / stdout in the native code. Under the test runners stdin / stdout are not connected to a TTY leading to a ENOTTY. Under Android readPassword is unimportant. Rather than leaving untested security-related code the password methods are being unimplemented. It is unlikely this code has ever been used on Android given the absence of a System Console instance. Bug: 12491103 Change-Id: I755c014e6b53236f5bef0535be137dd721918b44
* | | Fix for currency symbol coming from the default localeNeil Fuller2014-06-193-9/+6
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Fix CurrencyTest.test_getSymbol for unknown variants"Neil Fuller2014-06-171-0/+7
|\ \
| * | Fix CurrencyTest.test_getSymbol for unknown variantsNeil Fuller2014-06-181-0/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "CTS fix: Signature2Test.test_clone()"Neil Fuller2014-06-171-1/+1
|\ \
| * | CTS fix: Signature2Test.test_clone()Neil Fuller2014-06-181-1/+1
| |/ | | | | | | | | | | | | | | | | | | Previously it would throw a NullPointerException. Fixing that rendered the Signature cloneable and the test assertions failing. The test now passes but is of questionable value except to prove the absence of RuntimeException. Change-Id: I2a5b160f0914837b37b801e16b8a3717d00fd94e
* | Fix getISO3Country and getISO3Language.Narayan Kamath2014-06-183-17/+13
|/ | | | | | | | | | | | | | | 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
* Merge "Pass BCP-47 tags and not Locale.toString results to ICU."Narayan Kamath2014-06-1017-274/+328
|\
| * Pass BCP-47 tags and not Locale.toString results to ICU.Elliott Hughes2014-06-1617-274/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix bogus define checks and a typo.Narayan Kamath2014-06-131-10/+6
|/ | | | | | | | | | | | | | | RT_* constants are enum members in the UAPI so we can't use #define checks for them. Also fix a typo in the define check for an IFA_ constant. More generally, we should get rid of all these conditional checks for target builds because we know what version of the UAPI we have in bionic. We should move these conditional checks under #if HOST_BUILD or something similar. bug: 15602893 Change-Id: I3affc10773ade4dac68c176f79962ca8ad312579
* Remove unnecessary loop in uloc_forLanguageTag.Narayan Kamath2014-06-121-15/+15
| | | | | | | | | | When uloc_forLanguageTag fails with a U_STRING_NOT_TERMINATED_WARNING or with a U_BUFFER_OVERFLOW_EXCEPTION, we know precisely how many characters we need to allocate to make the call succeed. Change-Id: Ie761b9c7279d3c6f6d432285155a7087fab6d066
* Implement Locale.toLanguageTag without ICU support.Narayan Kamath2014-06-123-72/+255
| | | | | | | | | | | | 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
* Fix Mac build.Ian Rogers2014-06-101-0/+3
| | | | Change-Id: I32fdb9dabbc87d49e0be82ea39c2eea6f452fd6f
* Build fix.Ian Rogers2014-06-091-0/+2
| | | | Change-Id: I52559cfcc806dfe0d8682be50a6078cb678e4169
* Remove deprecated WITH_HOST_DALVIK.Ian Rogers2014-06-093-5/+70
| | | | | | | | | | Bug: 13751317 Fix the Mac host build: - conditionally define constants using pre-existing pattern, - make Posix calls that the Mac doesn't support throw UnsupportedOperationException. Change-Id: Ib68887cbe36ab167d042eb96c7834bce0651b078
* Improve the load/loadLibrary documentation.Elliott Hughes2014-06-062-57/+42
| | | | | | | | | | | Also improve the exception detail message for the default case. Experience with third-party app developers is that the current documentation is unhelpful and the current exception detail message is misleading. If we didn't have to use the existing ClassLoader API, we could actually list the exact pathnames we'd tried. Change-Id: I31e1980addf34d6ada6a112949801c970f73bd2b
* Merge "Add interruptibility/wake on close to FileChannel.lock()"Neil Fuller2014-06-042-3/+8
|\
| * Add interruptibility/wake on close to FileChannel.lock()Neil Fuller2014-06-032-3/+8
| | | | | | | | | | | | | | | | | | | | There is no obvious way of automated testing given the test would have to spawn a separate process to lock a file (and flock is not available on devices). It has been tested manually with multiple processes on host and a device. Bug: 13927110 Change-Id: Ie2e565d4965e7aa6392b0eb32e55cdf50d7f61c5
* | Merge "Fix BufferTest.testAccess"Neil Fuller2014-06-031-2/+5
|\ \