- Remove the LocaleList#getPrimary() API. It had become confusing
after locale negotiation was completely implemented. For example,
it could create the confusion that calling getPrimary() on the
default locale list would provide the default locale, etc.
- Use the adjusted locale list from LocaleList.getAdjustedDefault()
in Paints created with no locale list provided.
- Change LocaleList#get() to treat out of bound indexes from both
negative indexes and too large indexes the same way.
Bug: 26984092
Bug: 26193251
Bug: 26834387
Change-Id: I75f77aea6b75e38793ed8477e5e5a4420d5e6d85
This CL runs VectorDrawable animation on RenderThread. The changes in this CL
include:
- Convert all the animators in AnimatorSet for AVD into a set of RenderNodeAnimators.
- Hook up the new animators with RenderThread
- Add drawOp in RecordingCanvas for drawing VD so that during the animation
on RenderThread, all the property changes on VD can be reflected on the screen.
TODO:
- Implement reverse and reset for AVD.
Change-Id: I2df1d754f2db0ad098d9c15dde4bb2bdfafc2315
The existing DENSITY_DEVICE gets updated by ActivityThread following
configuration changes that affect density, so just a docs update there.
Bug: 26854123
Change-Id: I69dfca99a6038ed9cf8b2f2c007cdbc4a399dd8a
Previously, locale resolution happened at Resources level, which
could result in different Resources in the same app using different
locales.
This change moves the locale negotiation to ResourcesManager, which
remembers the locales supported by each Resources as they are
created, and negotiates the locale based on their union.
It also makes sure that the old model of apps getting the default
locale by accessing it through the Configuration's locale attribute
continues to work, since the negotiated locale will be moved to the
top of the list before Resources are created and when they are
updated with a Configuration change.
Bug: 25800576
Bug: 26404653
Change-Id: I0dd81df288327fd8d1229188c9544ee2209c161a
* Add support for determining script from language and region.
* Add support for determining special parents of locales.
* Add support for smart comparison of locales with only a difference
in region, using the locale parentage tree.
* Fix LocaleData.matchScore() to not fallback to old locale matching
behavior if we can't determine a script.
* Allow four-character variant codes. (Previously, only five- to
eight-character variant codes were allowed.)
Bug: 7296673
Bug: 26589793
Change-Id: Ibde0a48c0564ff383b41068095a5cbacfe7b94bc
This makes Package Manager check whether an APK is signed using APK
Signature Scheme v2 and, if it is, verify the APK's signatures using
that scheme rather than the usual JAR signature scheme.
APK Signature Scheme v2 is a whole-file signature scheme which aims
to protect every single bit of the APK as opposed to the JAR signature
scheme which protects only the names and uncompressed contents of ZIP
entries.
The two main goals of APK Signature Scheme v2 are:
1. Detect any unauthorized modifications to the APK. This is achieved
by making the signature cover every byte of the APK being signed.
2. Enable much faster signature and integrity verification. This is
achieved by requiring only a minimal amount of APK parsing before
the signature is verified, thus completely bypassing ZIP entry
decompression and by making integrity verification parallelizable
by employing a hash tree.
Bug: 25794543
Change-Id: If59fe013f2e62bac7677bb20e65f6061b91eec2e
Two setters are added, a hidden one for fast unsafe calls when the
input is known to be OK, and a public one for normal users.
A hidden constructor is also added for adjusting locale lists and
moving a locale to the front.
Finally, an indexOf method is added. It's only used in testing now,
but it's potentially useful for others too.
Bug: 26404035
Change-Id: I4ab3140134325456a8c3df1b126ccc6f8e3f43fd
In practice, a lot of apps provide English resources as their default
resources, so assume that English is always supported.
With this change, users can safely set secondary locales after
English in their preferred locale lists. Such settings would help
the apps (and parts of the system that are aware of multiple locales)
consider the user's familiarity with the secondary locale or the
user's preference for glyphs forms in the secondary locale. This
change makes sure that no app unintentionally switches to such
secondary locales.
Note that this doesn't break from the tradition of previous releases.
Traditionally, if the user had set the system locale to English, they
would get the default resources when the app didn't explicitly
provide English resources. This will continue to be the case where
the user's locale list has English in it before another supported
language. (English will be the first locale in most cases.)
Bug: 26192817
Change-Id: I2c1a003760299157786c1b3f9fb116ce18db3b8c
The suggested TODO is no longer deemed necessary (and is too
expensive to do for all LocaleLists). LocaleLists get (and will get)
passed down to the native level through strings that are the result
of calls to toLanguageTags(), which is pre-computed at construction
time. Users who need to interact with the native level can do their
own caching, such as in commit
cfc607cf57.
Change-Id: I665f3b28eaf8df309bf1aec96f9d237aeb72865c
Introduced a new regular expression to autolink URLs. Previous regular
expression used the protocol as an optional rule. The new expression
applies separate rules for strings that do not start with a known
protocol and strings that do start with a known protocol.
- In order to reuse previous regular expression definitions for
different parts of a URL, created constants for different parts of
WEB_URL expression.
- Separated the test cases for WEB_URL in order to remove the suppress
command and make them running again.
- Fixed failing tests for punycode urls, which were causing existing
tests to fail.
- Introduced new a regular expression for URL matching.
- Changed the protocol rule to be case insensitive.
- Updated IANA TLDs.
- Added tests for the new regular expression.
- Added tests for Linkify.
- Bug 9622849 is partially fixed.
Bug: 25727599
Bug: 9622849
Bug: 24500693
Bug: 23189367
Bug: 24543148
Change-Id: Ifd62455d342ca7adb22996246ff652e1d5944bec
Also:
1. Add AssetManager method for finding non-system locales: This is
used in per-app locale negotiation. (Normally,
AssetManager#getLocales() returns both system and non-system
locales.)
2. Match pseudolocales correctly in locale negotiation.
Bug: 25800576
Bug: 26236938
Change-Id: I116caf3a91c290deb4ad68b291c65b7035b18dd4
- Refactored VPathRenderer & VectorDrawableState
- Moved all the VD rendering into native
- Set up hooks for VD's property changes in JNI for animated VD
TODO: JNI calls can be further reduced when we convert the animation
in AVD to use RenderNodeAnimator, in which case animation will be
driven from native and therefore most of the JNI hooks for changing
VD's properties during animation will no longer be needed.
Change-Id: I52021f4d7bea057b83ace54085d870dd45acae0f
To avoid long stacktraces being truncated, add code to split up
large chunks along line breaks.
Introduce LineBreakBufferedWriter to chunk up log output. Add a
core test for it.
Change-Id: I34160fbce853c21329f7fa109a9c42506b2066af
Previously printing a duration where a unit (except ms) was one and the
next smallest unit was zero would result in the duration being being
expressed in the next smallest unit. For example 1m0s0ms would be
formatted as 60s0ms.
Update testFormatHugeDuration to supporting times > 999 days
The implementation was fixed in 3d1933c45f
Cherry-picked from f9a80cbbfe
Change-Id: I9d609f7a0f82755ea653a205293a6e3785a10d1e
This reverts commit 9c2f0d751d.
The original commit, 17b2b2d458, had
missed adding api/test-current.txt.
Change-Id: I26a6325b3cee4c2412ee599f002cc6addb35d36f
The algorithm tries to find the first locale in the locale list
(usually from the user preference) that somewhat matches one of the
locales supported (usually from the list of locales supported by the
system or an app).
Locales match if both their language and their likely script is the
same. Otherwise they don't.
Bug: 25800576
Change-Id: I4fbc3f44ab16d41efebbf941e94a0bb30d598f82
This is a preparation work to pass LocaleList from TextView to IMEs via
EditorInfo.
Marshalling and unmrshlling LocaleList via Parcel is actually not so
difficult. We can reuse its internal data representation "localeTags"
as a canonical serialization format.
As for implementation, there are two choices. One is making LocaleList
Parcelable and the other is having a utility method to do that.
This CL uses Parcelable approach so that not only Framework but also
application developers can reuse the code.
Bug: 22859862
Change-Id: Ib28363bd5ff74228d2abeaa95004ec8bed72bddd
An upcoming change will remove "synchronized" from the API docs. This change
documents those cases where the guarantees can be determined from code
inspection.
Bug: 25767152
Change-Id: I75083ce01513ed315222304fe3f34190d40748cb
Also add a placeholder method for locale negotiation to LocaleList,
to be filled later.
There is no change in behavior expected by this CL yet. But once we
support setting the first locale to something the system doesn't
support, and implement the locale negotiation, this will cause the
system locale to be set to the first supported locale, instead of
just the default from Settings.
Change-Id: Iec983a5707daffb5bf54eac79ff0856a96631960
Introduced PathData in Java, which is effectively a thin layer around the
native instance. PathData holds the verbs and points which is being used
in path morphing/interpolation. The verbs and points can be interpreted
into skia path commands, which is now done in native and therefore saves
a handful of JNI calls during path creation.
Removed the old PathDataNode mechanism and changed the PathEvaluator
to use PathData instead.
Also added tests and a microbench. Also ran CTS tests for VectorDrawable
and AnimatedVectorDrawable, and passed all of the existing tests.
Change-Id: Ia166f5172ff031fe18b154327967f911a62caec1
These simple utility classes (used internally since Property was first introduced
way back in Jellybean) are the best way to avoid autoboxing when using the Property
approach to ObjectAnimator. But since their hidden, developers have to use the
autoboxing version (Property, the superclass) or know to come up with their own
primitive-optimized property subclasses.
This CL simply un-hides these two classes to make them usable outside of the framework.
Issue #21722783 Make [Int|Float]Property public
Change-Id: I7f3a456d108bf48587d711255d3577cce3ac5e24
There are two improvements in reporting size configurations:
1) duplicates are removed;
2) smallest width is reported separately;
Change-Id: I8f8235c99e6eefcae178e8d61e79ad0c4d6f1144
Also, compute LocaleList's string representation at construction.
This is to further push the cost of doing costly operations related
to LocaleLists to construction time.
Change-Id: Ia55b8ce66b1088ff54cb42eb1e11149b5bd10f17
Also propagates XML attrs from time picker to radial view during
construction, which allows the hour colors & etc. to be changed
inline without needing to set the timePickerStyle theme attribute.
Bug: 20333885
Change-Id: Ib42b9f5b93b5d6ce1dcbaa05f99cef40c9f9a9d3
When seeking forward in the Parcel, adding the extracted size to the Parcel.dataPosition()
can result in an overflow. Guard against this.
Bug:23909429
Change-Id: If37cdebbf05a92810300363d1a6ecd8b42b6da26
Previously printing a duration where a unit (except ms) was one and the
next smallest unit was zero would result in the duration being being
expressed in the next smallest unit. For example 1m0s0ms would be
formatted as 60s0ms.
Update testFormatHugeDuration to supporting times > 999 days
The implementation was fixed in 3d1933c45f
Change-Id: I9d609f7a0f82755ea653a205293a6e3785a10d1e