We now use ICU's new functionality for casing edits to preserve
the spans while applying AllCapsTransformationMethod.
Test: Manual
Test: CTS tests added and pass
Bug: 7198872
Bug: 19047649
Bug: 19713814
Bug: 34853618
Bug: https://code.google.com/p/android/issues/detail?id=67509
Change-Id: I0df388e79894961efb272d497f1dcc0570a6c085
By I9ccafe7a53935960566243e2856e166878ca59ae, FontManager was gone.
So FontConfig is no longer need to be parcelable.
We can drop Parcel interface from FontVariationAxis.
Bug: N/A
Test: N/A
Change-Id: I33e92abf1e1063af312f0b7d9d6b8bd938d09c0e
FindAddress method only ever worked on US addresses and being a part
of WebView API, it required the users that did not use WebView otherwise
to pay a heavy penalty. Further, it was also used by Linkify.
The new way to find addresses is using TextClassifier.
Bug: 22362008
Test: WebView.findAddress.
Change-Id: I772961bd20bff4817a060f14a843abeceb55ac92
Update SpannableStringBuilder, SpannedString and SpannableString classes
so that they don’t enforce paragraph constraint for copy constructors.
If a paragraph constraint is not satisfied for a span, that span is not
copied. Before this change it would throw an exception.
Test: New tests added for SpannableStringBuilder and SpannableString
cts-tradefed run cts -m CtsTextTestCases
Bug: 36511794
Change-Id: I62abf08a8d4fe7e342ed97b8e8c3a577a9397e39
Because English time patterns use uppercase letters by default (and a
comma to separate date and time when both are represented), we were
concluding they need internationalized input. Although they
literally do, let's keep the world simple and assume they don't need
internationalized input.
Compared to Nougat, we will now accept uppercase AM and PM and comma
for English if the IME allows them, we just continue to not signal
that an internationalized layout is needed.
Test: CTS tests pass
Bug: https://code.google.com/p/android/issues/detail?id=2626
Bug: https://code.google.com/p/android/issues/detail?id=82993
Bug: 8319249
Bug: 33276673
Bug: 34394455
Bug: 37079150
Change-Id: I82bfde323ba49ae1a27ff5c2e729063b7d81dcc8
Since the characters that need to be entered for an internationalized
input type may not be available on the old non-internationalized
layouts, switch to the full text layout if there are any such
characters.
TextView is also modified to call the locale-aware listeners if
the target SDK is set to O or later.
Test: Manual
Bug: https://code.google.com/p/android/issues/detail?id=2626
Bug: https://code.google.com/p/android/issues/detail?id=82993
Bug: 8319249
Bug: 33276673
Bug: 34394455
Change-Id: I544bf0cc893a475ab5bf88cbad01cb981c6fef91
This CL cleans up APIs around font variation settings.
- Remove FontConfig and FontManager public API.
- Remove FontManagerService from system service.
- Extract inner class FontConfig.Axis as top-level class FontVariationAxis.
This is used by Typeface.Builder public API to create new Typeface.
- Introduce and expose FontVariationAxis utility functions from/to string.
- Throws if the invalid font variation settings is passed.
Test: android.text.cts.FontVariationAxisTest passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.cts.PaintTest passes
Change-Id: I9ccafe7a53935960566243e2856e166878ca59ae
In BidiFormatter and AndroidBidi, treat emojis new to
Unicode 10.0/Emoji 5 as bidi class ON.
Test: Manual
Bug: 32952475
Change-Id: I1a40c6ee2b6e9d91c9d1e5b64faca6d16301fe93
Currently there are over 170 font files are installed in system directory.
Opening 170+ files and keep them is not unacceptable. Pass URI instead.
At the same time, this CL hides full font path from FontConfig since
/system/fonts directory will be deprecated in future.
Bug: 36660849
Test: android.text.cts.FontManagerTest passed
Change-Id: I1d216dc9c6dec702a4ce3b946bfda6dcbe12b7fe
(cherry picked from commit 455f1bfc05)
These APIs are necessary to construct Typeface from various combination
TTC index, variation settings, etc.
Bug: 33062398
Test: android.graphics.cts.TypefaceTest passes
Change-Id: Ie069700ed4f67efbec55331bef867f94d58e2a61
Introduce Builder class for creating Typeface from various
sources with optional TTC index and font variation settings.
Bug: 33062398
Test: Manually verified new Builder create Typeface.
Change-Id: Ia23ee6a73516707d854c7387fe75fbb22f80673d
Overrides have been added to update the data to Emoji 5.0, since our
version of ICU only supports Emoji 4.0.
Test: CTS tests continue to pass.
Bug: 27365282
Bug: 30874706
Change-Id: I7c791e1e75ea3510b36f258c1e1c7184051d6d3a
These had remained in Emoji.java although they were removed from Unicode
emoji. The data still needs to be updated to Emoji 5.0, but that will be
done in another CL.
Test: not needed
Bug: 28678294
Change-Id: I491c4bba107b960fb1efccbe19630ab274aa6e29
This CL contains following clean up:
- Hide unnecessary constructors.
- Change List<XX> to XX[] since actually all fields are immutable.
- Change font's variant type from String to int.
- Decouple resource related members to FontResourcesParser.
- Add NonNull/Nullable to all fields.
Test: ran android.content.res.FontResourcesParserTest
Change-Id: If456266ffff86d41342572a19662cc8f3cd13181
If a layout had an ellipsis and in addition also indents,
the indents were ignored and the text would go over the indents.
Test: runtest -x cts/tests/tests/text/src/android/text/cts/StaticLayoutTest.java
Test: runtest -x cts/tests/tests/text/src/android/text/cts/DynamicLayoutTest.java
Test: runtest -x cts/tests/tests/widget/src/android/widget/cts/TextViewTest.java
Change-Id: I4cc89dad8301f6b1bb46a479395fd72c8476e477
Fixes: 36081667
By supporting multiple filters per one request we should be able to cover
multiple kinds of use cases such as:
- Letting the user select from a list of devices of more then one medium
type (e.g. Bluetooth and BLE)
- Allowing to provide multiple criteria for any field (e.g. filtering by
more than one service UUID)
Bug: 30932767
Test: Provide multiple filters and ensure that devices matching either are
shown in the list to choose from.
Ensure wifi SSIDs are shown in the list if wifi filter is provided
Change-Id: I0a978787551a1ee5750ec5544b241d3bbfed5a7c
This CL checks for existance (and readability) of hyphenation pattern
files before trying to read them. The main impact is reducing the
spam in the log due to the failure of calling RandomAccessFile() with
non-existing paths.
Test: Manual
Bug: 31727175
Bug: 36023892
Change-Id: I6963790fa205ab16d4ece548e4cbb0c15e279a14
By supporting multiple filters per one request we should be able to cover
multiple kinds of use cases such as:
- Letting the user select from a list of devices of more then one medium
type (e.g. Bluetooth and BLE)
- Allowing to provide multiple criteria for any field (e.g. filtering by
more than one service UUID)
Bug: 30932767
Test: Provide multiple filters and ensure that devices matching either are
shown in the list to choose from.
Ensure wifi SSIDs are shown in the list if wifi filter is provided
Change-Id: I6621da388e2bf4ed97c5af2692629a321d0b63c7
To do this, the developer must specify the set of certificate
hashes that represent the authority's app. This allows us to
verify that the authority we find is indeed the one intended
by the developer.
Bug: 35025705
Test: runtest --path frameworks/base/core/tests/coretests/src/android/provider/FontsContractTest.java
runtest --path frameworks/base/core/tests/coretests/src/android/content/res/FontResourcesParserTest.java
CTS attached to topic
Change-Id: I605f9a93bbca8705936ead08efb4a5b4fdcc4882
With this change, different languages can have a different minimum
length for suffix and prefixes when hyphenating. Previously, the
defaults used for English, 2 and 3, were used for every language.
Bug: 35712376
Test: Manual: German text can now break after two characters
Change-Id: Ia12d448a42bf2fab7c0bf5e85f8e27a4fb7f77d8
This adds better support for Arabic script languages, Armenian,
Catalan, Hebrew, Kannada, Malayalam, Polish, Tamil, and Telugu by
adding various hyphenation types and edits appropriate for the
locales.
The actual implementations are in Minikin. This CL takes care of the
changes needed in frameworks, to support different end-of-line and
start-of-line hyphen edits.
Two bugs in TextLine.java are also fixed:
1. Where hyphen edits on non-spanned texts were not eliminated in
handleRun() when they should have. This had manifested itself in
double hyphenation in some bidi paragraphs.
2. Some no op assignments and comparions around the change for the
above bug are removed.
Test: thorough manual testing for various cases
Bug: 19756624
Bug: 19950445
Bug: 19955011
Bug: 25623243
Bug: 26154469
Bug: 26154471
Bug: 33387871
Bug: 33560754
Bug: 33752592
Bug: 33754204
Change-Id: I48c047d1f6a75c39a78a6ea38a0a3282f63326ec
Patterns for Bulgarian (bg) and Church Slavonic (cu) are now loaded
too.
Also make changes to fontchain_lint.py, so it knows the script for Bulgarian
and Church Slavonic is Cyrillic.
Test: make -j works and creates .hyb files for bg and cu
Change-Id: I0586f6c49380279ef88fe952b5cfd2d3594c5524
Implement support for downloadable font requests in xml. Given the
xml fonts feature in O, this adds support to not only declare
local font files as font resources, but also Downloadable fonts
from a fonts provider.
A provider returns a font family (of one or more files) given a
query, so the new attributes are added to the font-family tag.
Additionally, add support to pre-declare downloadable font resources
in the Android Manifest. These will then be fetched at app startup
time so they are available to use from the Typeface cache asap.
When retrieving downloadable fonts via resources, the cache is
checked to see if the font is already there and is used, otherwise
a request is sent to the provider and the default font is returned
as we need a result synchronously.
To do this, the developer declares an additional fonts xml resource
file with the list of fonts to preload and links it in the manifest
with a meta-data tag.
E.g.:
res/font/mydownloadedfont.xml
<font-family xmlns:android="http://schemas.android.com/apk/res/android"
android:fontProviderAuthority="com.example.test.fontprovider"
android:fontProviderQuery="myrequestedfont">
</font-family>
res/font/preloaded_fonts.xml
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font android:font="@font/mydownloadedfont" />
</font-family>
and in the AndroidManifest.xml
<meta-data android:name="preloaded_fonts"
android:resource="@font/preloaded_fonts" />
Bug: 34660500, 34658116
Test: WIP, need to add more
Change-Id: I1d92555e115e241bf23b59e6f5c6cca6c7361de7
Reverts the change which adds a gesture detector in
TextView for detecting clicks on ClickableSpans. A click
is considered MotionEvent.ACTION_UP. Revert needed because
the singleTapUp refactoring has a potential to break
existing apps.
Bug: 23692690
Test: attached in the same topic
Change-Id: Ife47fd0608480130123091bc60a7e9dd1efe8785
The previous implementation assumed ASCII digits, and a fixed set of
separators and signs.
The following classes have been internationalized: DigitsKeyListener,
DateKeyListener, TimeKeyListener, and DateTimeKeyListener.
DialerKeyListener is not modified yet, due to concerns about the
handling of non-ASCII digits by dialing-related parts of Android.
Even with this CL, characters outside BMP and multi-character signs
and decimal separators are still not supported, due to limitations in
android.view.KeyEvent and android.view.KeyCharacterMap.
Test: cts-tradefed run cts-dev --module CtsTextTestCases --test android.text.method.cts.*KeyListenerTest
Bug: https://code.google.com/p/android/issues/detail?id=2626
Bug: https://code.google.com/p/android/issues/detail?id=82993
Bug: 8319249
Bug: 33276673
Bug: 33643035
Bug: 34394455
Change-Id: I1cf87d0d9d1b383f5265c07ecd63b5767f9a68ca
Package change from android.text to android.view.textclassifier.
This change was delayed until the native library code was updated
to reflect this package change.
Test: cts-tradefed run cts-dev -m CtsViewTestCases -t android.view.textclassifier.cts.TextClassificationManagerTest
Bug: 34777495
Change-Id: I723aaf79f8fbed4758bb4ee6727dfb6a8e35bf99
This introduces an API for apps that support companion devices to provide a
more streamlined flow for pairing and setting up the device
Bug: 30932767
Test: Using a toy app, invoke the newly introduced API (CompanionDeviceManager),
and go through the flow. Ensure filtering works, and device is returned to
the calling app. Ensure the calling app can pair to the selected device.
Change-Id: I0aeb653afd65e4adead13ea9c7248ec20971b04a
Previously (post Android N) we decided to introduce
a gesture detector in textView and trigger the onClick()
over a clickable span when onSingleTapConfirmed was
called. The problem is that onSingleTapConfirmed also
waits for double tap timeout to make sure (to confirm).
This has a chance to break some apps so relax the
rule to only look for onSingleTapUp.
* the bug for which the initial change was made is
still fixed
* slightly amended the ClickableSpan JavaDoc to
specify that the onClick gets triggered if the
span is selected when clicked (note that this
behavior is unchanged since ClickableSpan exists,
added just an extra hint to devs)
Bug: 23692690
Test: in the attached CL (same topic)
Change-Id: Iead434aa558301d61879c27edc48dc4148ca187f