summaryrefslogtreecommitdiffstats
path: root/luni
Commit message (Collapse)AuthorAgeFilesLines
* Return unlocalized TimeZoneID from TimeZone.getTimeZone()Taiju Tsuiki2015-04-212-1/+15
| | | | | | | | | ISO 8601 recommends the numbers in the time zone string should be non-localized numbers. Though implemented version returns localized numbers depends on the default locale. This CL removes localization from formiting the time zone ID. Change-Id: If828bcebb13b8509f5caf4dd201a4dbcd7defc38
* Remove support for reading mime types from property files.Narayan Kamath2015-04-211-61/+0
| | | | | | | | 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
* Merge "Implement mapLibraryName in Java."Elliott Hughes2015-04-162-14/+6
|\
| * Implement mapLibraryName in Java.Elliott Hughes2015-04-162-14/+6
| | | | | | | | | | | | No need for native code here. Change-Id: Iaeb0369b5638a6681fd94fd999641801719aaea2
* | Merge "Use ICU4J more in DateIntervalFormat and RelativeDateTimeFormatter"Neil Fuller2015-04-163-113/+114
|\ \
| * | Use ICU4J more in DateIntervalFormat and RelativeDateTimeFormatterNeil Fuller2015-04-163-113/+114
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Make Manifest#clone obey clone's contract.Narayan Kamath2015-04-161-6/+20
| | | | | | | | | | | | | | | | | | | | We must call through to Object.clone to ensure that we always return an object of the right type. If not, subclasses will have to override clone() instead of calling through to super.clone(). bug: 19748843 Change-Id: Ie2177bbc05c62281f48780e521ad66de3612561e
* | Fix bad negation in Collections#binarySearch.Narayan Kamath2015-04-162-16/+88
| | | | | | | | | | bug: 19749094 Change-Id: Id1d7bcf4abebb423fd3bbb7c8f379bf9e6234969
* | Unbreak Harmony MacTest.Alex Klyubin2015-04-151-0/+13
|/ | | | | | | | | The test got broken by recenly added AndroidKeyStore-backed implementation of Mac which cannot be initialized with a SecretKeySpec. Bug: 20222007 Change-Id: Id4941347acd092b435d6797c5ee2477fae8cd516
* Switch DateIntervalFormat/RelativeDateTimeFormatter to ICU4JTravis Keep2015-04-147-302/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* StrictJarFile: unittest for missing filesNick Kralevich2015-04-141-0/+4
| | | | | | | | Add a test to verify that we error out when the manifest declares a file which isn't present in the jar. Bug: 1162500 Change-Id: I3c6814c500d218036a5c0515e9f4f93e3f7a63d5
* StrictJarFile: better handle missing filesNick Kralevich2015-04-141-0/+7
| | | | | | | Ensure all manifest files are present in the jar. Bug: 1162500 Change-Id: I36b40a34d5837b8ad4a0d13e7ea2e37ad7e51f3b
* Refactor security classes for static initializationKenny Root2015-04-132-13/+45
| | | | | | | | | | | | | | | | Split out security.properties I/O to a separate method returning a Reader. This method can be intercepted at compile-time and provide a StringReader with the content of the file. A reader is necessary as Properties interally uses a reader and requires a Charset to translate from an input-stream. Refactor Services provider loading to first try the boot classpath loader instead of the system class-loader. The former is accessible during compile-time initialization and functionally equivalent. Bug: 19498458 Bug: 19542228 Change-Id: I853952b83ca99006907c070734f767259c975517
* Libcore: Refactor TimeZone for compile-time initializationAndreas Gampe2015-04-131-36/+46
| | | | | | | | | | | Introduce a private inner class for custom-time-zone parsing. This moves the Pattern field which cannot be compile-time initialized. As a result, TimeZone, SimpleTimeZone & ZoneInfo can be initialized in the boot image. Bug: 19542228 Change-Id: I6fc8cb65975e14351a6bfc1ddfac175368efd1eb
* Libcore: Make Date compile-time initializableAndreas Gampe2015-04-101-2/+5
| | | | | | | Move CREATION_YEAR to a static inner class. Bug: 19542228 Change-Id: I3db699f8ad661305f5255ee730faeb21c2861dde
* Remove obsolete concurrent access test.Narayan Kamath2015-04-101-28/+0
| | | | | | | | | | | This failure mode we're testing for is no longer possible because we use ICU4J. Moreover, this seems to trip up the CTS test runner which flags exceptions in the logs from other threads as failures. If there's a good reason to keep this, we can always add an UncaughtExceptionHandler that doesn't log to all worker threads. Change-Id: I23eeeb01e4a9c0987e30e54a2d84cc5d4f79a6c0
* Make ICU4J look for timezone updates in /dataNeil Fuller2015-04-091-1/+33
| | | | | Bug: 19941636 Change-Id: I4dbadfbfd4a8fbfeb3d580c073061710fd521fdd
* Merge "libcore: change SSLEngineTest to close SSLEngine instances"Sergio Giro2015-04-081-34/+88
|\
| * libcore: change SSLEngineTest to close SSLEngine instancesSergio Giro2015-04-081-34/+88
| | | | | | | | | | | | | | | | | | | | It was leaking resources allocated by SSLEngine's, pipes among others, thus causing subsequent tests to fail with "too many open files" errors. In OpenSSLEngineImpl, the resources are freed in the finalizer, so there's no guarantee that resources as pipes will ever be freed unless the engines are explicitly closed. Change-Id: Ide90808a64278486a19bcdfcba628f623c62afc9
* | Small documentation changes to SystemNeil Fuller2015-04-081-4/+6
| | | | | | | | | | | | Updates to documentation around lineSeparator. Change-Id: I0b646c06ac85303e572e38738889a8247eef37a0
* | Rename package to android.icu.* instead of com.android.ibm.icu.*.Narayan Kamath2015-04-071-1/+1
| | | | | | | | | | | | Based on a discussion with the icu team. Change-Id: I47a6b260a9348debd65282794996f7976b8bc008
* | Merge "Changes to enable timezone data overrides for ICU and libcore"Neil Fuller2015-04-072-19/+64
|\ \
| * | Changes to enable timezone data overrides for ICU and libcoreNeil Fuller2015-03-262-19/+64
| | | | | | | | | | | | | | | Bug: 19941636 Change-Id: Id587be99f645978c2e1067c9f8eef26d6d63ec27
* | | GZIPInputStream: Correctly handle extras in gzip headers.Narayan Kamath2015-04-072-1/+17
| | | | | | | | | | | | | | | | | | | | | We were peeking into the wrong field for the extra length. bug: https://code.google.com/p/android/issues/detail?id=159340 Change-Id: Ib7ed400e3e119b1d6c95be49d25812c5c7f366b9
* | | Merge "Expose getSpi from crypto operations as hidden API."Alex Klyubin2015-04-034-4/+22
|\ \ \
| * | | Expose getSpi from crypto operations as hidden API.Alex Klyubin2015-03-244-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible for platform code to obtain the current SPI implementation of Cipher, Signature, Mac, and KeyAgreement instances. The current use case is to access additional information about these crypto operations when they are backed by Android KeyStore. NOTE: The getSpi API will not and cannot become public framework API. Bug: 18088752 Change-Id: If575726d288eebc73ffa3209c316fad071a087fd
* | | | GZIPInputStream: Fix handling of header CRCs.Narayan Kamath2015-04-032-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the same mistake as public bug 159340, we were peeking in the wrong buffer for the CRC. Note that this is different from the member CRC, the latter is the CRC of the actual data (not the header) and is mandatory. Change-Id: I98d49bdd9d5ea93fe982783c8077531764ee5347
* | | | Don't use zip64 by default.Narayan Kamath2015-04-036-579/+669
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change was breaking tools like dexmaker that would write zipfiles to disk so that the runtime could read them. We don't want to go back and amend the local file header, so we just throw an IOException if somebody writes more than 4GB of data to an entry that doesn't have a declared size. If the entry has a declared size > 4GB, we can write the zip64 header in advance. bug: 19574093 Change-Id: I771e821996efd3ef4c3de5e02f5a0062e62f9244
* | | | Merge "Be consistent with the library path."Nicolas Geoffray2015-04-031-1/+5
|\ \ \ \
| * | | | Be consistent with the library path.Nicolas Geoffray2015-04-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the boot class loader (loader == null) loadLibrary tries to find the the full path of the library using java.library.path. When actually loading the library, we need to use the same java.library.path property in case the library has dependencies. Change-Id: I2404d72f5c65c6a5ecfedc1efe879cfc9cef55ad
* | | | | Implement BreakIterator in terms of icu4j.Narayan Kamath2015-04-026-450/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge "Override ICU4Js search path for ICU4C data."Narayan Kamath2015-04-021-0/+6
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Override ICU4Js search path for ICU4C data.Narayan Kamath2015-04-011-0/+6
| | |_|/ | |/| | | | | | | | | | Change-Id: I4dc6c40be400e298921c57f5c6d6c413edd70f68
* | | | Fix KeyGeneratorTest breakage due to AndroidKeyStore.Alex Klyubin2015-04-012-1/+13
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AndroidKeyStore provider's KeyPairGenerator and KeyGenerator instances require AndroidKeyStore-specific initialization parameters which are represnted by Android framework classes and are thus not accessible from libcore tests. This CL fixes KeyGeneratorTest to skip AndroidKeyStore provider to follow the behavior of KeyPairGeneratorTest. Change-Id: I61d176a7bc22a676d06d32f49aba37aebebe9c76
* | | Merge "Add a test to confirm that TZ data is in sync"Neil Fuller2015-03-303-0/+22
|\ \ \
| * | | Add a test to confirm that TZ data is in syncNeil Fuller2015-03-273-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Test NetworkSecurityPolicy effect on HTTP connections."Alex Klyubin2015-03-261-0/+54
|\ \ \ \
| * | | | Test NetworkSecurityPolicy effect on HTTP connections.Alex Klyubin2015-03-251-0/+54
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds CTS tests that assert that platform-provided URLConnection instances that use cleartext HTTP honor the cleartext traffic policy from NetworkSecurityPolicy. Bug: 19215516 Change-Id: I79f5fce5e00434e96f4325c1aae65a573f10dcdd
* | | | Merge "Remove a misleading comment."Neil Fuller2015-03-261-3/+0
|\ \ \ \ | |/ / / |/| | |
| * | | Remove a misleading comment.Neil Fuller2015-03-131-3/+0
| | | | | | | | | | | | | | | | Change-Id: I7a5c8095e98f1449fb4efc98061c488fd0b573e2
* | | | Merge "Add libcore.net.NetworkSecurityPolicy."Alex Klyubin2015-03-254-2/+340
|\ \ \ \
| * | | | Add libcore.net.NetworkSecurityPolicy.Alex Klyubin2015-03-244-2/+340
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Fix for ftp:// invalid urls with ProxySelector"Neil Fuller2015-03-251-1/+1
|\ \ \ \ | |/ / / |/| | |
| * | | Fix for ftp:// invalid urls with ProxySelectorNeil Fuller2015-03-251-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Remove forced alignment code."Christopher Ferris2015-03-243-84/+260
|\ \ \
| * | | Remove forced alignment code.Christopher Ferris2015-03-233-84/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The move from to gcc 4.8 to gcc 4.9 for arm32 introduced a bug in this code. The original code is trying to out smart the compiler by arch, but we got caught. Running benchmarks, the amount of time we save by doing this is in the nanosecond range, so just let the compiler figure things out on it's own. It turns out for aarch64, x86, x86_64, two of the functions produce exactly the same code. For swapLongs, x86/x86_64 produces slightly different code but is about the same performance. For arm32, letting the compiler optimize also leads to about the same performance. Adding unit tests and benchmark code for these. Bug: 19692084 Change-Id: I858eb3147ef1e9e2c1894ddb226cdddcc0baf933
* | | | Merge "Fix the year display when formatting absolute date string"Tao Bao2015-03-232-5/+79
|\ \ \ \
| * | | | Fix the year display when formatting absolute date stringTao Bao2015-03-232-5/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge "Pass getDexPath to Runtime.nativeLoad"Dmitriy Ivanov2015-03-231-9/+10
|\ \ \ \ \
| * | | | | Pass getDexPath to Runtime.nativeLoadDmitriy Ivanov2015-03-201-9/+10
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getDexPath is used by Runtime.nativeLoad to open libraries directly from apk. Given that libraries are not compressed and are page-aligned. Bug: 8076853 Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1