summaryrefslogtreecommitdiffstats
path: root/luni/src/main/java/libcore
Commit message (Collapse)AuthorAgeFilesLines
* libcore: add a way to clear cached time zone stringsRoman Birg2015-11-072-0/+19
| | | | | | | Ref: CYNGNOS-453 Change-Id: I5aaf315f0d2b7b039cacb5de135501cea4f7cf0c Signed-off-by: Roman Birg <roman@cyngn.com>
* Add getxattr/setxattr/removexattr syscalls.Jeff Sharkey2015-07-023-0/+9
| | | | | Bug: 20275572 Change-Id: I958056f757f095ad6278624e293a5583d9cee822
* Fix bug in formatting intervals at month boundaries.Travis Keep2015-05-121-1/+1
| | | | | | | | | | | | | | | | | | | 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
* am 3bb83381: Add a ZoneInfoDB.hasTimeZone API.Narayan Kamath2015-04-301-0/+4
|\ | | | | | | | | * commit '3bb833819dba8d530620ad6d43dc53c3fd54763b': Add a ZoneInfoDB.hasTimeZone API.
| * Add a ZoneInfoDB.hasTimeZone API.Narayan Kamath2015-04-301-0/+4
| | | | | | | | | | | | | | | | | | Allows us to query the DB without having to clone an object or an entire strings array. bug: 19106773 bug: 19987403 Change-Id: I66d466e414972b02a75bcfe68263e74de8b9a768
* | am 39f72b16: Merge "Removed offset and value from String and added ↵Jeff Hao2015-04-281-13/+13
|\ \ | |/ |/| | | | | | | | | StringFactory." * commit '39f72b16952fbe4aff5c2e080ce9f7f6dbb1b93d': Removed offset and value from String and added StringFactory.
| * Removed offset and value from String and added StringFactory.Jeff Hao2015-04-271-13/+13
| | | | | | | | Change-Id: I55314ceb906d0bf7e78545dcd9bc3489a5baf03f
* | am bd7c7451: am 726db7ae: Merge "Ensure consistency of capitalization in ↵Neil Fuller2015-04-234-212/+305
|\ \ | |/ | | | | | | | | | | RelativeDateTimeFormatter" * commit 'bd7c7451634fa46aef554dd6e09421ce2d6033a6': Ensure consistency of capitalization in RelativeDateTimeFormatter
| * Merge "Ensure consistency of capitalization in RelativeDateTimeFormatter"Neil Fuller2015-04-234-212/+305
| |\
| | * Ensure consistency of capitalization in RelativeDateTimeFormatterNeil Fuller2015-04-224-212/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am ccb61deb: am 97ca5855: Merge "Move java.nio.Charsets to libcore.util."Narayan Kamath2015-04-221-0/+80
|\ \ \ | |/ / | | | | | | | | | * commit 'ccb61deb8f478f91404b75cbe19cb7b9cbcb4f76': Move java.nio.Charsets to libcore.util.
| * | Move java.nio.Charsets to libcore.util.Narayan Kamath2015-04-221-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am 69773bd2: am 21a0e54a: Merge "Remove support for reading mime types from ↵Narayan Kamath2015-04-211-61/+0
|\ \ \ | |/ / | | | | | | | | | | | | | | | property files." * commit '69773bd217466a536c9317073a184d3907f58100': Remove support for reading mime types from property files.
| * | 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
* | am b059489d: am 83f2b5f3: Merge "Use ICU4J more in DateIntervalFormat and ↵Neil Fuller2015-04-162-85/+85
|\ \ | |/ | | | | | | | | | | RelativeDateTimeFormatter" * commit 'b059489d9b120279eff706efda839ff719e722e0': Use ICU4J more in DateIntervalFormat and RelativeDateTimeFormatter
| * Use ICU4J more in DateIntervalFormat and RelativeDateTimeFormatterNeil Fuller2015-04-162-85/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am c5546c4c: am 0ed6c7db: Merge "Switch ↵Neil Fuller2015-04-142-111/+85
|\ \ | |/ | | | | | | | | | | DateIntervalFormat/RelativeDateTimeFormatter to ICU4J" * commit 'c5546c4c0812bba9d9a6b0611839465b9fd4eab6': Switch DateIntervalFormat/RelativeDateTimeFormatter to ICU4J
| * Switch DateIntervalFormat/RelativeDateTimeFormatter to ICU4JTravis Keep2015-04-142-111/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 8426170b: am 345d118d: Merge "Changes to enable timezone data overrides ↵Neil Fuller2015-04-071-1/+2
|\ \ | |/ | | | | | | | | | | for ICU and libcore" * commit '8426170b2440ce9d9857f8b63e5de5f77d7ee393': Changes to enable timezone data overrides for ICU and libcore
| * Merge "Changes to enable timezone data overrides for ICU and libcore"Neil Fuller2015-04-071-1/+2
| |\
| | * Changes to enable timezone data overrides for ICU and libcoreNeil Fuller2015-03-261-1/+2
| | | | | | | | | | | | | | | Bug: 19941636 Change-Id: Id587be99f645978c2e1067c9f8eef26d6d63ec27
* | | am ff1e2b45: am 6696f19d: Merge "Implement BreakIterator in terms of icu4j."Narayan Kamath2015-04-021-177/+0
|\ \ \ | |/ / | | | | | | | | | * commit 'ff1e2b45293d883fbff3d58f1d88746fbe126836': Implement BreakIterator in terms of icu4j.
| * | Implement BreakIterator in terms of icu4j.Narayan Kamath2015-04-021-177/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am 1b29afea: am fc62e635: Merge "Add a test to confirm that TZ data is in sync"Neil Fuller2015-03-301-0/+3
|\ \ \ | |/ / | | | | | | | | | * commit '1b29afea69c76a7ed73c60d35d84b515097b25a0': Add a test to confirm that TZ data is in sync
| * | Add a test to confirm that TZ data is in syncNeil Fuller2015-03-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am d92eaa4a: am 1e342670: Merge "Add libcore.net.NetworkSecurityPolicy."Alex Klyubin2015-03-252-2/+75
|\ \ \ | |/ / | | | | | | | | | * commit 'd92eaa4a580d86051f8174b1992c40f55df6e56a': Add libcore.net.NetworkSecurityPolicy.
| * | Merge "Add libcore.net.NetworkSecurityPolicy."Alex Klyubin2015-03-252-2/+75
| |\ \
| | * | Add libcore.net.NetworkSecurityPolicy.Alex Klyubin2015-03-242-2/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | am fc23db65: am 74b6f466: Merge "Fix for ftp:// invalid urls with ProxySelector"Neil Fuller2015-03-251-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * commit 'fc23db65f41c887963ce754e3a2cd350d5dad8e8': Fix for ftp:// invalid urls with ProxySelector
| * | | 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
* | | | am 94cc3faf: am 61ac7408: Merge "Fix the year display when formatting ↵Tao Bao2015-03-241-5/+24
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | absolute date string" * commit '94cc3fafd50df1d5ab0fdb141db2e260efdc7831': Fix the year display when formatting absolute date string
| * | | Fix the year display when formatting absolute date stringTao Bao2015-03-231-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "Use uppercase for hex encoded strings."Narayan Kamath2015-03-161-1/+1
|\ \ \ \ | |/ / / |/| | |
| * | | Use uppercase for hex encoded strings.Narayan Kamath2015-03-161-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | For backwards compatibility with the apache code this is replacing. Several callers compare encoded strings for byte equality. bug: 19731588 Change-Id: I2e96abcabd69ba6d48d341eafe1f8075fff880ee
* | | Add a version of sendto that takes a SocketAddress.Lorenzo Colitti2015-03-143-0/+6
|/ / | | | | | | | | | | | | | | Only the byte[] version for now. The ByteBuffer version will be added later. Bug: 19704592 Change-Id: I35c5f305b5828ff3315e42aae72aa4b01839e2fc
* | Add support for netlink sockets and addresses.Erik Kline2015-03-093-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Implement zip64 support for ZipFile/ZipInputStream/ZipOutputStream.Narayan Kamath2015-02-271-0/+59
|/ | | | | | | | | | | | | | | | | | 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
* Use ICU for relative time formattingTao Bao2015-02-112-1/+381
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove fcntlLong, use fcntlInt for F_SETFD instead.Narayan Kamath2015-01-194-4/+1
| | | | | | | | | | 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
* Add fcntlInt.Narayan Kamath2015-01-163-6/+9
| | | | | | Hidden for now, for use from the frameworks. Change-Id: I30d95b28ecbc422aaa5bf28fb2f288c3ca026493
* More FileDescriptor.isSocket cleanup.Elliott Hughes2015-01-081-1/+1
| | | | | | | | | | 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
* Avoid a type conversion during comparisonNeil Fuller2015-01-061-1/+1
| | | | | | | Tiny change after commit 2237a9d0ea59928f8852c9f599bdd9a6930e727d to compare a long with a long. Change-Id: Iaba2d7246295f3f23c760fe72195136208a95933
* Fix integer overflow issue in ZoneInfo.Narayan Kamath2014-12-301-9/+20
| | | | | | | | | | | 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
* MimeUtils: add ODF presentation (template)Miklos Vajna2014-12-271-0/+2
| | | | | | | | 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>
* Create GregorianCalendar via a delegate.Deepanshu Gupta2014-12-241-1/+7
| | | | | | | | | | | | 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
* Merge "Add various system calls needed by the zygote."Elliott Hughes2014-12-183-0/+12
|\
| * Add various system calls needed by the zygote.Elliott Hughes2014-12-173-0/+12
| | | | | | | | | | Bug: 18719692 Change-Id: I91a943369bc3b331e7e06e758f729b008c3c041c
* | Add hwp to MimeUtils map.Sungmin Choi2014-12-171-0/+1
|/ | | | | Bug: 18788282 Change-Id: I9e28278eae3812387440dbfce196a20c32e24b30
* Merge "Fix poll to never return EINTR."Elliott Hughes2014-12-171-5/+1
|\