summaryrefslogtreecommitdiffstats
path: root/luni/src/test/java/libcore/util
Commit message (Collapse)AuthorAgeFilesLines
* Add a ZoneInfoDB.hasTimeZone API.Narayan Kamath2015-04-301-0/+7
| | | | | | | | | Allows us to query the DB without having to clone an object or an entire strings array. bug: 19106773 bug: 19987403 Change-Id: I66d466e414972b02a75bcfe68263e74de8b9a768
* Use uppercase for hex encoded strings.Narayan Kamath2015-03-161-4/+6
| | | | | | | | For backwards compatibility with the apache code this is replacing. Several callers compare encoded strings for byte equality. bug: 19731588 Change-Id: I2e96abcabd69ba6d48d341eafe1f8075fff880ee
* Repurpose "HexEncoding" for internal users.Narayan Kamath2014-12-161-0/+76
| | | | | | | | | 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
* Revert "Revert "Add a cache for ZoneInfo objects in Java""Neil Fuller2014-07-171-0/+23
| | | | | | | | | This reverts commit 01b6a878d10ee68db87c3d85d137e81a5257a78a. Contains a fix for when the timezone ID is not found. This includes a new test. Change-Id: I2e5e669782ea6caf4e97153ed6b63ca6ee4ef50d
* Revert "Add a cache for ZoneInfo objects in Java"Neil Fuller2014-07-171-18/+0
| | | | | | This reverts commit a6e8689807f5a8bb9470ce7c26a47455d2d0608d. Change-Id: I17a0262d169db3418f2f8888195381f778975dc4
* Add a cache for ZoneInfo objects in JavaNeil Fuller2014-07-161-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix ZoneInfoDBTest.testGoodOverrideNeil Fuller2014-06-021-15/+17
| | | | | | | | | | | | | | | | | | | When executed under the CTS environment some of the tests in ZoneInfoDBTest assumed: 1) The device was booted with all tzinfo files present and that they don't change (i.e. so the runtime's static TimeZone singleton reflects the contents of the file system at the time the test is executed). 2) The number of timezone IDs in /data/misc/zoneinfo/tzdata, /system/usr/share/zoneinfo/tzdata are the same (if assumption 1 holds). This change modifies the tests to only use the (unchanging) /system/usr/share/zoneinfo/tzdata file and avoid use of the TimeZone class. Bug: 15382201 Change-Id: I8d3b1ea52a2147e7afaa302803c834539bd01db9
* The file in /data overrides the file in /system, not the other way round.Elliott Hughes2013-11-061-6/+9
| | | | | Bug: 11513357 Change-Id: Ib8a6c2574eb2aef85c4224f0c640ab9b883713c5
* Fix ZoneInfoDBTest on devices that have taken a gservices tzdata update.Elliott Hughes2013-11-041-5/+8
| | | | | | | | | The tests were assuming that the zygote was always using the /system/usr/share/zoneinfo copy, but devices that have taken a gservices tzdata update will be using the /data/misc/zoneinfo/tzdata copy instead. Bug: 11513357 Change-Id: Ieb5c28f91445630f6b00e18aefff0c234c223d97
* Fix ZoneInfoDBTest.Elliott Hughes2013-04-261-1/+1
| | | | | | I'm so stupid. frameworks/base wasn't the only caller. Change-Id: Ia0c3ce79e2f899e77a9cd1e62fca7d3b22130cf2
* Cope with a corrupt tzdata update.Elliott Hughes2013-04-261-0/+87
| | | | | | | | | | 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
* Rename SerializableTester to SerializationTesterJesse Wilson2011-12-131-0/+125
| | | | Change-Id: Idfaea5c474eb3cabfb8eefc5aa25a7ff0cce26ea
* Follow up on enh's comments for CollectionUtils.uniqueCopy()Jesse Wilson2011-03-281-0/+26
| | | | | Change-Id: I0ceb442801160827909ff9ab3e52771754072bda http://b/4087759
* Adopt BasicLruCache in AddressCache.Jesse Wilson2011-02-101-18/+15
| | | | | Change-Id: I08a5e82e123920762ad9a9c87bbe3045f17e33a9 http://b/3184897
* Move libcore.base classes to libcore.util and libcore.io.Jesse Wilson2011-02-072-0/+229
Change-Id: I2340a9dbad3561fa681a8ab47d4f406e72c913e3