Commit Graph

1130 Commits

Author SHA1 Message Date
Eugene Susla
36e866b8e0 Support multiple filters per association request
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
2017-03-09 17:52:49 -08:00
Hector Tellez
d66c95fa90 Revert "Support multiple filters per association request"
This reverts commit e70e6aa62c.

Change-Id: I12857cbbea0a0c74521191ab5e3713db230626ab
2017-03-09 17:55:43 +00:00
Eugene Susla
e70e6aa62c Support multiple filters per association request
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
2017-03-08 16:52:14 -08:00
Clara Bayarri
3c4be77db9 Support non-system Font Providers
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
2017-03-07 14:59:33 +00:00
Roozbeh Pournader
a59c3feb8d Customizable minimum suffix/prefix length for hyphenation
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
2017-03-06 13:51:28 -08:00
Roozbeh Pournader
46c6f4c5ea Frameworks support for hyphenation for various complex cases
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
2017-03-03 15:34:42 -08:00
Roozbeh Pournader
033b2226ba Load hyphenation patterns for Bulgarian and Church Slavonic
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
2017-02-22 23:39:24 -08:00
Siyamed Sinir
e09e529085 Merge "Revert "Don't copy NoCopySpans in SpannableStringInternal"" 2017-02-22 19:28:07 +00:00
Siyamed Sinir
fa4a02c13f Revert "Don't copy NoCopySpans in SpannableStringInternal"
This reverts commit 5de4fb641a.

Bug: 34712634
Fixes: 35363881

Change-Id: I7311e1201152bde052511869c60a0d0c1c5b3242
2017-02-22 03:52:06 +00:00
TreeHugger Robot
5653fb10a7 Merge "Introduce Backspace implemenation for flag emoji sequence." 2017-02-16 05:00:49 +00:00
Andrei Stingaceanu
302fe9098b Merge "TextView/LinkMovementMethod/ClickableSpan - touch up revert" 2017-02-15 14:28:55 +00:00
TreeHugger Robot
02761acc67 Merge "Declarative downloadable fonts" 2017-02-14 15:39:04 +00:00
Clara Bayarri
4b5a4d221f Declarative downloadable fonts
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
2017-02-14 13:32:41 +00:00
TreeHugger Robot
60bcd2485d Merge "Internationalize subclasses of NumberKeyListener" 2017-02-13 18:41:58 +00:00
Andrei Stingaceanu
d834c58252 TextView/LinkMovementMethod/ClickableSpan - touch up revert
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
2017-02-10 12:55:01 +00:00
Seigo Nonaka
d5eff80a77 Introduce Backspace implemenation for flag emoji sequence.
Also introduce some test cases to CoreTest.

Test: ran FrameworksCoreTest
Change-Id: I4e237155a6fa7567937c8d089459c0780f868ffc
2017-02-10 13:41:23 +09:00
Roozbeh Pournader
3484ba8fdc Internationalize subclasses of NumberKeyListener
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
2017-02-09 19:26:53 -08:00
Abodunrinwa Toki
f67f0a584e Change package for LangId and SmartSelection.
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
2017-02-10 00:57:01 +00:00
TreeHugger Robot
c534f4ca8a Merge "Remove unnecessary if-else statement from TextUtils#isEmpty. " 2017-02-08 09:42:48 +00:00
Andrei Stingaceanu
155c3a88ac Merge "Clickable spans - trigger onClick onSingleTapUp" 2017-02-07 11:19:53 +00:00
Amin Shaikh
d4196c9e8b Remove unnecessary if-else statement from TextUtils#isEmpty.
Test: runtest frameworks-core

Change-Id: Ibcdc67130570775650fe8affda961227319c6641
2017-02-07 01:13:31 +00:00
Eugene Susla
6ed45d8cd3 CompanionDeviceManager
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
2017-02-06 12:50:55 -08:00
Andrei Stingaceanu
f0ebee91f8 Clickable spans - trigger onClick onSingleTapUp
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
2017-02-06 17:03:28 +00:00
Siyamed Sinir
5de4fb641a Don't copy NoCopySpans in SpannableStringInternal
Bug: 34712634
Test: 
Added new tests to cts.SpannableStringTest and cts.SpannedStringTest
android.text.cts.SpannableStringTest
android.text.cts.SpannedStringTest
android.text.cts.SpannableStringBuilderTest
android.text.SpannableStringTest
android.text.SpannedTest

Change-Id: I34e4ef4798b8d26fa8770c0021acb52b4047095e
2017-01-30 18:43:47 -08:00
Abodunrinwa Toki
67024f1b8f Merge "Implement TextClassification system service." 2017-01-30 19:12:50 +00:00
TreeHugger Robot
fe98ad919b Merge "Implement .xml font resource support" 2017-01-30 09:37:13 +00:00
Clara Bayarri
ed00bfdfae Implement .xml font resource support
This change implements the loading and parsing
of xml type font resources, and makes sure it is
used properly by TextView styles.

Test: run cts -m CtsContentTestCases -t android.content.res.cts.ResourcesTest
run cts -m CtsWidgetTestCases -t android.widget.cts.TextViewTest#testFontResources*

Change-Id: I5a2930b3ba7dad67d9607e9036a5dde6bab0c5a4
2017-01-27 20:16:48 +00:00
Elliot Waite
0ce4b0e4c3 Fix @links in reference docs. am: 54de77470d am: ab978c035e am: 28ba4722a9
am: 9b21265b2c

Change-Id: If246ebdb36cf2832d5a6c42cbe752e290b6fb6e8
2017-01-26 04:49:33 +00:00
Elliot Waite
9b21265b2c Fix @links in reference docs. am: 54de77470d am: ab978c035e
am: 28ba4722a9

Change-Id: I98177a8cf0a20677e140406bb7371474ca259e5b
2017-01-26 04:44:54 +00:00
Elliot Waite
54de77470d Fix @links in reference docs.
Change-Id: I40cea46efd80c448640ff69753698fe8404da40b
2017-01-25 17:00:55 -08:00
Siyamed Sinir
9ab25678f9 Make SpannableStringBuilder.getSpans thread-safe
am: 4234144a2b

Change-Id: I9d1c2d93d6f22465c88e35df28d75f07bcc687b3
2017-01-24 22:27:28 +00:00
Siyamed Sinir
3d9238ec63 Fix SpannableStringBuilder getSpans sort am: 051caedcaa
am: 1764efad93

Change-Id: I33b2f25901330e79bbc166a318f71d5124d0b332
2017-01-24 22:14:44 +00:00
Siyamed Sinir
7afe571bd7 Merge "Make SpannableStringBuilder.getSpans thread-safe" 2017-01-24 22:12:17 +00:00
Abodunrinwa Toki
43e0350922 Implement TextClassification-related methods.
Implements TextClassificationManager.detectLanguages
 Implements TextClassifier interface

Bug: 34661057
Test: See: Ic2a5eceeaec4cd2943c6c753084df46d30511fee
Change-Id: Ic640b96f48bcad7cdd8c4dfac354b008a7ae3961
2017-01-24 15:13:04 +00:00
Abodunrinwa Toki
f001fefff3 Update TextAssistant interface.
Rename to TextClassifier
Move to android.view.textclassifier package
Adds getTextClassifierInfo(...)
Changes addLinks(...) to getLinks(...)

This CL also integrates this interface with framework components
and passes a context to TextClassificationManager.

Test: Tests will be added with implementation.
Bug: 34661057
Change-Id: If9e90f034ebb702c1f78e72b6a844f39eebf738f
2017-01-24 15:01:24 +00:00
Siyamed Sinir
4234144a2b Make SpannableStringBuilder.getSpans thread-safe
Add cached int buffers for sorting.

Test: All CtsTextTestCases

Merged-In: Ice0b3c3fffc541b26aca94c93fd01e30e13efe2e

Bug: 33609774
Change-Id: Ib728654a384cfc072d1c190611e4553aa8957fa8
2017-01-23 14:39:35 -08:00
Siyamed Sinir
1bcdcebf68 Make SpannableStringBuilder.getSpans thread-safe
Add cached int buffers for sorting.

Test: All CtsTextTestCases

Bug: 33609774
Change-Id: Ice0b3c3fffc541b26aca94c93fd01e30e13efe2e
2017-01-23 14:35:27 -08:00
Clara Bayarri
04d72abde1 Expose fonts.xml via public API with a service
This change creates a new FontManagerService, in charge of providing
font management data. It exposes a public API to retrieve the
information in fonts.xml without accessing it directly. To do this,
it also refactors FontListParser's internal classes into a new public
FontConfig class holding all the font data.

getSystemFonts() returns all the available information in fonts.xml
as well as file descriptors for all the fonts. This allows us to
share the memory consumed by these files between all clients.

Bug: 34190490
Test: See attached CTS change in topic
Change-Id: I0e922f8bcc9a197a1988d04071eb485328d66fb7
2017-01-23 15:02:23 +00:00
Abodunrinwa Toki
c565e1d3ce Implement TextClassification system service.
- This service provides the TextClassificationManager access to the
  classification model file.
  See: Icb82b707c9c1b4dcb739f44d888bbc43bc3b03bb
- This service is started at boot time.
  See: Ie4a597bc5c6c4140afbcf7feaa9dd237a3fd5fef

Test: Manually tested. Also see: Ic2a5eceeaec4cd2943c6c753084df46d30511fee
Bug: 32503402
Change-Id: Ic428d00f291e268211866b3fc6b7acbc3eb04e1e
2017-01-20 20:22:16 +00:00
Siyamed Sinir
051caedcaa Fix SpannableStringBuilder getSpans sort
Sort function was broken for odd number of elements.

Test: Added new CTS tests.

Bug: 33567024
Change-Id: I7457dee6ac279c6aab5b92431b347dc1f16a8fa0
2017-01-19 13:10:36 -08:00
Keisuke Kuroyanagi
846946ec06 Merge "Make selection end handle stick to selection at line end." 2017-01-13 06:39:22 +00:00
Keisuke Kuroyanagi
7c263ddd58 Make selection end handle stick to selection at line end.
At line break, one offset can be mapped to two phisical
position: previous line end and next line start.
Previously, all cursor handles are placed at next line
start.
With this CL, selection end handle is placed at the
previous line end in such cases.

Test: FrameworksCoreTests
Bug: 21305922

Change-Id: I00d9f9a0cd417ca92534e93b3d3f655cd62f25d3
2017-01-12 19:24:18 +09:00
Phil Weaver
74bf350176 Merge "Accessibility support for ClickableSpan" 2017-01-11 16:42:29 +00:00
Phil Weaver
193520e3df Accessibility support for ClickableSpan
Bug: 17726921
Test: Adding CTS tests for new behavior in linked CL.
Change-Id: Ifa85c309106d5ef29bb130edff9e2e0b88547a8f
2017-01-09 18:12:30 -08:00
Seigo Nonaka
09da71a6dc Introduce full justification.
Adds a new get/setJustify API to TextView and StaticLayout.Builder for
justification, and fully justifies text when it's enabled.

This is based on a patch by Raph Levien (raph@google.com).

Bug: 31707212
Test: Manually done and CTS will introduced with
      I0f3bbf39d60a66b71b30e1351f7c741208f05dce passes.
Change-Id: Icbfab2faa11a6a0b52e6f0a77a9c9b5ef6e191da
2017-01-05 18:14:15 +09:00
TreeHugger Robot
d837ed2c99 Merge "Fix getLineExtent for hyphen width." 2016-12-31 04:10:02 +00:00
Roozbeh Pournader
f6952b8331 Expand characters temporarily skipped in spellchecking
An earlier patch (I4d09576a31df551c96f820242fd2cbc675506dae)
special-cased apostrophe as a character to defer spellchecking on,
since it could cause a word break which could later get removed.

This patch updates that earlier patch to include all characters that
could cause such a behavior according the Unicode word breaking
algorithm defined in UAX #29.

Bug: 17641350
Bug: 17673522
Test: manual
Change-Id: I4029e3d91dfcf96665b003f6fdd30d1208b0ac7c
2016-12-19 11:31:07 -08:00
Seigo Nonaka
9863f67469 Fix getLineExtent for hyphen width.
Need to set hyphen edit before measuring line.

Bug: 33388205
Test: Manually done
Change-Id: I32b1639d03ddd9bddb1f3ab34b577544ae358a6a
2016-12-19 10:35:38 +09:00
Roozbeh Pournader
ff53f923e9 Merge "Use TextDirectionHeuristics to detect text direction in Html" 2016-12-15 22:00:38 +00:00
Roozbeh Pournader
2beaa2e45e Merge "Use ICU for formatting in DateUtils.formatDuration" 2016-12-15 21:59:46 +00:00