| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| | |
Change-Id: I70a591093557ce3dd0471bcc7e888d630c80bb88
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously we'd throw ArrayIndexOutOfBoundsException for U+2066..U+2069.
Now we'll return DIRECTIONALITY_UNDEFINED. I've exposed (via @hide) the
underlying icu4c implementation so that frameworks code at least can work
with the new explicit bidi formatting characters.
Bug: 15492712
Change-Id: I96583c7e1c6be26d3f1a857615a1042d58e9feaf
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Don't bother to reload the default SocketFactory if the requested
classname didn't change since the last time.
Also make the warning when classloading fails more terse. Most of the
time the ClassLoader is wrong, so giving them a hint via
ClassLoader#toString is sufficient.
Bug: 16468683
Change-Id: I36844e942ccadda993c9f5a1523b2a66280903f3
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Expose PR_GET_DUMPABLE and PR_SET_DUMPABLE via java.
This is a cherrypick of two commits from internal master:
* 1fc6b04adc87e752aa35bedb7617b5145d835d7c
* 514b1d21f66caff9f26fcf042882c5115b5431c4
Change-Id: Ibb60ed1d00c3a84fa77a34d0acc56cb995d14e1c
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As a result of improved benchmarking, the arraycopy function runs 35% faster
on average than a straight call to the native code for arrays of length 32 or shorter.
Bug: 7103825
Change-Id: I68600b01a6218d761be874528cfa70de56efdfdc
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This removes the workaround for broken TLS/SSL server certificates
that were being presented by android.clients.google.com in early 2012
(8576f309825e23add080f2a50345ec1884939c39). The server is presenting
better certificates these days and the workaround is no longer needed.
Bug: 5426333
Change-Id: I4e7be7bcf522f2d210a596aa03b86a19884e075a
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Thanks to apphelia@ for the report.
The readObject() implementation had hardcoded the
field order incorrectly leading to a couple of
fields being swapped on each serialization:
paramsAlg and sealAlg. This was wrong as far back
as 2009 so the class has likely never worked for
its intended purpose. Field order during
Serialization is primitives first, then fields.
Secondary ordering is alphabetical.
The purpose of overriding readObject() at all is for
safety in the event of compromised stream data.
It would be more appropriate to clone() rather than
readUnshared(). readUnshared() assumes a
corresponding writeUnshared(), which is not present.
The readUnshared() probably only works here because
the byte[] arrays typically are not shared anyway.
From reading latest guidelines on safe serialization
the code need not be order-specific: it can use
readFields(). s.defaultReadObject() could have been
used instead but the guidelines recommend against.
Performance is probably not a concern.
Until now nobody could have been using SealedObject
for its intended purpose otherwise they would have
noticed this bug (or they were always serializing /
deserializing an even number of times!).
Anybody attempting to use SealedObject on earlier
versions of Android will need to serialize /
deserialize twice to avoid the bug. After this fix
the class will work as intended.
Additional:
Some duplicated code has been extracted into methods,
and streams are now closed when they are finished
with. In reality this will have no effect
given the stream implementations involved.
Bug: https://code.google.com/p/android/issues/detail?id=73235
Change-Id: If745d6556437ae7839543e66dd15f912afd4ec98
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | | |
Thanks to Robbie Hott for the bug report.
Bug: https://code.google.com/p/android/issues/detail?id=71216
Change-Id: I402fa27e0b90c1c1d26169d79c7061e4a2caa138
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For locales whose language code is "und" we use Locale.ROOT
instead. This also fixes two other corner cases :
- We were using the wrong locale to fetch timezone strings
when the input locale was null. we now use the same locale
throughout by making sure we don't perform any subsititutions
in LocaleData.get.
- Adds a clearer comment about the broken serialization
behaviour.
bug: 15849709
Change-Id: I95e7eb0ccb7458711038ce9b1c76b3279acda9d6
|
| | |
| | |
| | |
| | |
| | | |
Bug: 15765976
Change-Id: Ic743168a54ff96e5403a9c73c27eeb7d482a01dc
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This prevents us from having to parse ICU locale IDs
or construct them in java. Note that the changes to
LocaleTest bring us in line with the spec (some of the
previous tests demonstrated wonky ICU4C behaviour we
didn't want).
This change includes a minor fix to unicode extension
parsing, we now accept keywords with empty values which
the spec allows.
bug: 15661724
bug: 15849709
Change-Id: If9417ab4cb545fdb8b9a0a47a7eade6ebbe33ba8
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \
| |/ /
|/| | |
|
| |/
| |
| |
| |
| |
| | |
Bug: 16449607
Change-Id: I4a854d55f49fe709965c6b6a769fb58c356627dc
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 01b6a878d10ee68db87c3d85d137e81a5257a78a.
Contains a fix for when the timezone ID is not found.
This includes a new test.
Change-Id: I2e5e669782ea6caf4e97153ed6b63ca6ee4ef50d
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit a6e8689807f5a8bb9470ce7c26a47455d2d0608d.
Change-Id: I17a0262d169db3418f2f8888195381f778975dc4
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This also fixes a typo in two TLS-PSK cipher suite names.
Bug: 15073623
Change-Id: I92d289c2b91862529faf6e06f2eb9b0a21d42b52
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I58ec1fafdf5524538ac14c52d561bf93d5a6c946
|
| |/ /
|/| |
| | |
| | |
| | |
| | | |
(cherry-pick of f39b5ca3c6378c3c36c63889577004b9693ea9c6.)
Change-Id: Idaf030cd369e728ec37df7107cd30062db899b7c
|
| | |
| | |
| | |
| | |
| | |
| | | |
(cherry-pick of 63744c884dd4b4f4307f2b021fb894af164972af.)
Change-Id: Ibf79a402e1bad98a262e380fcee3d35c127ae6d5
|
| | |
| | |
| | |
| | |
| | |
| | | |
(cherry picked from commit 36214feb86a0963b23f34c8c63584252bd757e19)
Change-Id: I96d5109c01e39255b9970f7a515ddd3575a50e56
|
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 4b999a474eb92e0b89a34de56f3f7979fd491aa1.
Change-Id: Ifd70798e74357ffe14cbc659ad49a9853b3be8c6
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|/ /
| |
| |
| |
| |
| | |
The generic version of arraycopy does not work. Remove it.
Change-Id: I524289874cfbf62ed0af3c91264180041342c3f1
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Enabled arraycopy to call native code when passed two objects.
Change-Id: I77f9455550acc53ab59ec2dc85cb1fe4d75583c9
|
|\ \ \ \
| |/ / /
| | | |
| | | | |
benchmarking."
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | | |
Build fix.
Change-Id: I49a566c3c34d2040e092689e52b0039c8195de03
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The function was deleted by
1f3014901704f3ae81538773b8a0b382945adc8d
Bug: 12491103
Change-Id: If75f1f05d6a72cac7b7a86b7616bae870615452e
|
|\ \ \ \
| |/ / / |
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|