summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Make ReferenceQueueTest#test_removeJ more robust."Mathieu Chartier2015-02-181-7/+10
|\
| * Make ReferenceQueueTest#test_removeJ more robust.Mathieu Chartier2015-02-181-7/+10
| | | | | | | | | | | | | | | | No spurrious failures if the sleep finishes before the RemoveThread is inside the try catch block. Bug: 19384923 Change-Id: I81e340e97eff5e1d011e980c2f89dfa679662547
* | Merge "Deal with quoted subformat patterns correctly."Narayan Kamath2015-02-182-0/+14
|\ \
| * | Deal with quoted subformat patterns correctly.Narayan Kamath2015-02-182-0/+14
|/ / | | | | | | | | | | | | | | This change might look like a hack, but the API it implements is more than worthy of it. bug: 19011159 Change-Id: I8a539f1b54282220fbb0a005a750819fa7873cc9
* | Merge "Fix handling of consecutive quotes in ChoiceFormat et al."Narayan Kamath2015-02-182-4/+19
|\ \
| * | Fix handling of consecutive quotes in ChoiceFormat et al.Narayan Kamath2015-02-182-4/+19
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two consecutive single quotes ('') must be interpreted as an escaped single quite sequence. We were implementing it by simply keeping track of whether the last character was a single quote. This is insufficient for sequences of three or more quotes since we shouldn't emit ('') for an escape sequence of ('''). We'll have to keep track of the number of consecutive quotes we've seen in the input instead. This is a partial fix for the bug below. There appears to be another bug in MessageFormat itself in its handling of subpatterns. bug: 19011159 Change-Id: Ia71e5d8c1962356cabc265cf80ebc0a04ff84f17
* | Merge "Handle infinities correctly in ChoiceFormat."Narayan Kamath2015-02-182-46/+40
|\ \
| * | Handle infinities correctly in ChoiceFormat.Narayan Kamath2015-02-172-46/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'd like ChoiceFormat.toPattern to emit a pattern that's parseable by ChoiceFormat - which means we need an infinity that's parseable by NumberFormat.parse(). Also, implement the nextDouble / previousDouble public API <sadface/> in terms of Math.nextAfter and Math.nextUp. bug: 19149384 Change-Id: Ieb13ee70c212d188ff9fde09463ced8d632f47ab
* | | Merge "Fixes associated with the tzdata 2015a update"Neil Fuller2015-02-181-8/+0
|\ \ \ | |/ / |/| |
| * | Fixes associated with the tzdata 2015a updateNeil Fuller2015-02-181-8/+0
|/ / | | | | | | | | | | | | | | | | | | Chile has changed the rules for DST. The test duplicates testApia below it, so it can be removed. Bug: 19212588 (cherry-picked from commit ebfb8f8b0ee0c0a75d92d8fc56ccd0d87ee7e9ad) Change-Id: Ibe7c0dc510813826dca13993b6600d368e03740a
* | Merge "Use ICU for relative time formatting"Tao Bao2015-02-127-1/+1171
|\ \ | |/ |/|
| * Use ICU for relative time formattingTao Bao2015-02-117-1/+1171
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "Fix LocaleTest#testDefaultLocale."Narayan Kamath2015-02-102-16/+18
|\
| * Fix LocaleTest#testDefaultLocale.Narayan Kamath2015-02-102-16/+18
|/ | | | | | | | | | | | | The implementation considers user.locale / region / language immutable if set at the command line. For the purposes of this test, we'll have to resort to changing the unchangeable by hand. Fortunately, we already have such a function thanks to the native bridge. bug: 19329061 Change-Id: I583a0da355503b547c60e2df6da4c23ac5882e4a
* Merge "Explicitly state all File constructor NPEs."Elliott Hughes2015-02-071-0/+4
|\
| * Explicitly state all File constructor NPEs.Elliott Hughes2015-02-071-0/+4
|/ | | | | | | | | | I think I closed the previous bug report as "unless otherwise stated, you should assume that passing null to anything gets you a NullPointerException", but this is at least the second time this specific case has been reported as a bug, so... Bug: https://code.google.com/p/android/issues/detail?id=136551 Change-Id: I5993bbf405054f57cd4f7c05af38e6c9d66355e7
* Merge "CharsetEncoder.flush() should only call implFlush() once."Narayan Kamath2015-02-042-0/+59
|\
| * CharsetEncoder.flush() should only call implFlush() once.Fredrik Roubert2015-02-042-0/+59
|/ | | | | | | | | | Repeated calls to flush() should not result in repeated calls to implFlush(), leaving CharsetEncoder implementations free to do such things as unconditionally prepend headers in their implFlush(). ICU4J does that. bug: 19251672 Change-Id: Id6399c16a60b0ec7f73248e431741fe5432c9c3a
* Merge "Fix deflater in / out counts for inputs > 4G."Narayan Kamath2015-01-306-5/+71
|\
| * Fix deflater in / out counts for inputs > 4G.Narayan Kamath2015-01-306-5/+71
|/ | | | | | | | | | | | | | | | | | | | | The underlying inflate & deflate can process any amount of data correctly, since the protocol is chunk based (the size of each chunk is limited to 32 bits, usually) and there is no limit to the number of chunks. On LP32, the stream counters are limited to 32 bit counts and the manual recommends that the caller maintain their own counters to support larger counts. <quote> Note however that the strm.total_in and strm_total_out counters may be limited to 4 GB. These counters are provided as a convenience and are not used internally by inflate() or deflate(). The application can easily set up its own counters updated after each call of inflate() or deflate() to count beyond 4 GB. </quote> Change-Id: I066e1141935154773360c1b9f94c56bd604f8474
* Merge "Work around 32 bit glibc bug."Narayan Kamath2015-01-301-0/+17
|\
| * Work around 32 bit glibc bug.Narayan Kamath2015-01-291-0/+17
| | | | | | | | | | | | | | Don't allow glibc's TEMP_FAILURE_RETRY on 32 bit hosts, it will truncate 64 bit return types such as from lsee64, sendfile etc. Change-Id: I009510a69ec80d42a17192bf960b056456bd88f5
* | Merge "Remove flakiness from ProcessTest."Elliott Hughes2015-01-301-3/+6
|\ \
| * | Remove flakiness from ProcessTest.Elliott Hughes2015-01-291-3/+6
|/ / | | | | | | | | | | | | | | | | | | If run as root, ps(1) will list far too many processes, some of which might coincidentally be zombies. Note that we wanted "ps S" to show the STAT field, not "ps s" to show the signal masks which also shows the STAT field as a side-effect. Change-Id: Iedbcb45b871b1207248cb59c3a5fae9be5b0b3e2
* | Merge "Fix org.json.JSONTokenerTest#testNextStringUnicodeEscaped."Elliott Hughes2015-01-291-3/+2
|\ \
| * | Fix org.json.JSONTokenerTest#testNextStringUnicodeEscaped.Elliott Hughes2015-01-291-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Throwing NumberFormatException for bad Unicode escapes was a bug. The test I added when I fixed that was in a different file, and apparently I didn't re-run these tests. Bug: https://code.google.com/p/android/issues/detail?id=103641 Change-Id: I271063ef12eab1369e4ce4cbbb7dd00e15c9ce79
* | | Merge "Set the test as large, it can reach the 1 minute timeout."Nicolas Geoffray2015-01-291-0/+1
|\ \ \ | |/ / |/| |
| * | Set the test as large, it can reach the 1 minute timeout.Nicolas Geoffray2015-01-291-0/+1
|/ / | | | | | | | | BUG: 19165288 Change-Id: I1112170a917fe9f5c5482544edae3d326832f638
* | Merge "Regression tests for Etag handling"Neil Fuller2015-01-271-0/+133
|\ \
| * | Regression tests for Etag handlingNeil Fuller2015-01-261-0/+133
| | | | | | | | | | | | | | | | | | | | | Confirm that Etag headers are implemented correctly. Bug: https://code.google.com/p/android/issues/detail?id=108949 Change-Id: Ida716d089ab1367ae955bb110a450c63ce3a1fa9
* | | Merge "Fix the infinite loop issue of the conversion from string to double"Elliott Hughes2015-01-233-143/+33
|\ \ \
| * | | Fix the infinite loop issue of the conversion from string to doubleJingwei Zhang2015-01-233-143/+33
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provide the additional check for “z”. The “if” statement checks whether the double precision value z, is at the end of a binade (a term used to describe the set of numbers in a binary IEEE 754 floating-point format that all have the same exponent, i.e., a binade is the interval [2n, 2n+1) for some value of n.) If so, it needs to adjust for the change of ulp (unit of least precision is the spacing between two consecutive floating-point numbers, i.e., the value the least significant digit represents if it is 1). The adjustment is done by the “simpleShiftLeftHighPrecision” routine. This is all necessary, except when z is close to denormal (i.e. DOUBLE_TO_LONGBITS(z)==DOUBLE_NORMAL_MASK) where no adjustment is needed since the ulp should remain the same once z becomes denormal. This means we can remove the old hack that counted how many times we'd incremented or decremented, so this patch removes the DECREMENT_DOUBLE and INCREMENT_DOUBLE macros. This patch also contains the float equivalent of everything mentioned above, plus some new tests. Finally, this patch removes the USE_LL conditional compilation because it was always true. Bug: 18087920 Change-Id: I4a9112f012dfd9eeb8db89f0652528b6c02e8f1e Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com> Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
* | | Merge "Make Cipher.update return null for empty input."Alex Klyubin2015-01-232-3/+13
|\ \ \
| * | | Make Cipher.update return null for empty input.Alex Klyubin2015-01-232-3/+13
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Cipher.update(byte[], int, int inputLen) is supposed to return null when inputLen is zero. This CL makes it so. Prior to this CL, this method returned an empty byte array. Bug: 19100173 Change-Id: I5698f11f76a17dd8fc2509be5d8ec9369a888eaf
* | | Merge "Add SSLSocket tests which inspect emitted ClientHello fields."Alex Klyubin2015-01-236-98/+470
|\ \ \
| * | | Add SSLSocket tests which inspect emitted ClientHello fields.Alex Klyubin2015-01-226-98/+470
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds basic tests which capture the ClientHello emitted by SSLSocket and assert that the various fields are as expected. In particular, this CL adds tests for: * client protocol version, * cipher suite list, * compression methods, * server_name extension (SNI). Change-Id: I387c44363ad26f064885f9bfa28572da37871078
* | | Merge "Fix incorrect ordering of assertEquals"Neil Fuller2015-01-231-1/+1
|\ \ \ | |/ / |/| |
| * | Fix incorrect ordering of assertEqualsNeil Fuller2015-01-231-1/+1
| | | | | | | | | | | | Change-Id: I69ddea2941400881ef64309d2470953d25136c1a
* | | Merge "Throw JSONException rather than NumberFormatException for an invalid ↵Elliott Hughes2015-01-222-6/+14
|\ \ \ | | | | | | | | | | | | escape."
| * | | Throw JSONException rather than NumberFormatException for an invalid escape.Elliott Hughes2015-01-222-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only our documentation claims that any of the JSON code throws NumberFormatException, and throwing JSONException seems much more in keeping with the rest of the API (and makes it easier for callers to handle errors). Bug: https://code.google.com/p/android/issues/detail?id=103641 Change-Id: I4f4ebfd983f4ccb2a1f266a0bfa5732174df26f6
* | | | Merge "okhttp.jar is needed by run-libcore-tests."Alex Klyubin2015-01-221-0/+1
|\ \ \ \
| * | | | okhttp.jar is needed by run-libcore-tests.Alex Klyubin2015-01-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the libcore's tests indirectly depend on okhttp being in the CLASSPATH. Change-Id: Iff5b7f361d088a08c31e7fcdea3ef243f4a2fe44
* | | | | Merge "Introduce user.locale [take 2]"Narayan Kamath2015-01-223-52/+133
|\ \ \ \ \ | |_|_|_|/ |/| | | |
| * | | | Introduce user.locale [take 2]Narayan Kamath2015-01-213-52/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5eba1f238e37e3fef73b492badb950225150cdcf and adds additional code to set user.language / user.region for backwards compatibility. The original commit had a static initialization order bug, so this change reorders static fields so that GRANDFATHERED_TAGS is initialized before the default locale. We also set user.language / user.region for backwards compatibility. The android framework have been changed to pass in user.locale instead of user.language / user.region but we parse that value and set user.language / country for code that still relies on it. bug: 17691569 Change-Id: Ie5e8ffe4bafa3977fea27289f9ffc5100288cab3
* | | | | Merge "Use the IPv6 instead of the IPv4 wildcard address in sockets."Lorenzo Colitti2015-01-226-23/+24
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Use the IPv6 instead of the IPv4 wildcard address in sockets.Lorenzo Colitti2015-01-226-23/+24
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few places in libcore consider the local address of an unbound socket to be Inet4Address.ANY. For example, calling getLocalAddress on an uncreated Socket will return 0.0.0.0, and when creating a DatagramSocket, libcore attempts to bind it to 0.0.0.0 unless the caller specifies another address. On Android, this is incorrect. All native socket filedescriptors that underpin Java socket objects are created by IoBridge.socket, and are dual-stack AF_INET6 sockets, not AF_INET sockets. When such a socket is created, its local address is ::, not 0.0.0.0. Thus, for example, calling getLocalAddress on a just-created ServerSocket object will return ::. Binding to 0.0.0.0 is not even allowed by os.bind, which silently converts it to :: instead (in inetAddresstoSockaddr). Therefore, accept reality and use :: instead of 0.0.0.0 in the Java layer as well. Specifically: 1. Change DatagramSocket's constructors to bind to :: instead of 0.0.0.0. This is a complete no-op, because os.bind() silently converts 0.0.0.0 into ::. Add a test for the other of the two codepaths. 2. Change InetSocketAddress so that an uninitialized object has an IP address of :: and not 0.0.0.0, and update its test. This is unlikely to break anything short of an app that explicitly depends on this behaviour, because os.bind() converts 0.0.0.0 to ::, and because any SocketAddress returned by any real socket will never contain 0.0.0.0 anyway. 3. Change Socket so that calling getLocalAddress() when there is no underlying socket file descriptor is will return :: instead of 0.0.0.0. This is more correct, because it's consistent with sockets that have been created, which will never have a local address of 0.0.0.0. Tested: vogar $(find libcore/*Socket*Test*) all passes on device. Bug: 18094870 Change-Id: I9d60710fe945a99d6a5e65430248a889008ef4b1
* | | | Merge "Get rid of rule to generate a file with a # in its name."Narayan Kamath2015-01-212-20/+0
|\ \ \ \ | |/ / / |/| | |
| * | | Get rid of rule to generate a file with a # in its name.Narayan Kamath2015-01-212-20/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Was only around to work around perforce issues, and we have a copy of this file checked in anyway. Also, gets rid of an unused constant referencing the name. Change-Id: Iddd5871130d779455f8ff960703945dc1d745e18
* | | Merge "Fix ProcessTest#getErrorStream."Narayan Kamath2015-01-211-1/+1
|\ \ \
| * | | Fix ProcessTest#getErrorStream.Narayan Kamath2015-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Broken by the move to toybox. Instead of double guessing the error message, just assume that all "cat" variants (host / target etc.) output the name of the "bad" paramater to the error stream. Change-Id: If19fa737e0d3a3dd023185fa23854da3022020fa