Commit Graph

10821 Commits

Author SHA1 Message Date
Richard Ledley
309f009127 Merge "Linkify documentation updates." 2018-02-05 17:06:53 +00:00
TreeHugger Robot
2ea1ed2470 Merge "Fix missing JavaDoc of IMM#toggleSoftInput()" 2018-02-05 16:56:45 +00:00
Richard Ledley
3e43fc5623 Linkify documentation updates.
Test: Building succeeds.

Bug: 72562811

Change-Id: Idf8979107f487ca93fe970b689a16941565c22b5
2018-02-05 15:07:23 +00:00
TreeHugger Robot
1bb9f29909 Merge "Autofill compatibility mode." 2018-02-05 09:55:29 +00:00
Yohei Yukawa
3db07bb547 Fix missing JavaDoc of IMM#toggleSoftInput()
This CL addresses a typo in the JavaDoc of IMM#toggleSoftInput(),
which has prevented it from being treated as a valid JavaDoc.

Note that this CL removes @hide simply because it is too late.  The
method in question has already been exposed to developers since API
level 3 (Cupcake) because of the typo.

Bug: 13002424
Test: make -j doc-comment-check-docs
Change-Id: I3e42d433f20c56ee63373bb390aad59e3bd7ec4f
2018-02-05 15:26:25 +09:00
Svetoslav Ganov
24c90450fe Autofill compatibility mode.
Autofill helps users fill credentials, addresses, payment methods,
emails, etc without manually typing. When focus lands on a fillable
element the platform captures a snapshot of the screen content and
sends it to an autofill service for analysis and suggestions. The
screen snapshot is a structured representation of the screen content.
If this content is composed of standard widgets, autofill works
out-of-the-box. However, some apps do their own rendering and
the content in this case looks like a single view to the platform
while it may have semantic structure. For example, a view may render
a login page with two input test fields.

The platform exposes APIs for apps to report virtual view structure
allowing autofill services to handle apps that have virtual content.
As opposed to apps using standard widgets, this case requires the app
developer to implement the new APIs which may require a fair amount
of code and could be seen as a processes that could take some time.
The most prominent typs of apps that fall into this category are
browsers.

Until most apps rendering virtual content and specifically browsers
don't implement the virutal APIs, autofill providers need to fall-
back to using the accessibliity APIs to provide autofill support
for these apps. This requires developers to work against two sets
of APIs - autofill and accessibility - which is incovenient and error
prone. Also, users need to enable two plugins - autofill and
accessibility which is confusing. Additionally, the privacy and
perfomance impact of using the accessibility APIs cannot be addressed
while autofill providers need to use thes APis.

This change adds an autofill compatibility mode that would allow
autofill services to work with apps that don't implement the
virtual structure autofill APIs. The key idea is to locally enable
accessibility for the target package and remap accessibility to
autofill APIs and vise versa. This way an autofill provider codes
against a single set of APIs, the users enable a single plugin,
the privacy/performance implications of using the accessibility
APIs are addressed, the target app only takes a performance hit
since accessibility is enabled locally which is still more efficient
compared to the performance hit it would incur if accessibility is
enabled globally.

To enable compatibility mode an autofill service declares in its
metadata which packages it is interested in and also what is
the max version code of the package for which to enable compat
mode. Targeted versioning allows targeting only older versions of
the package that are known to not support autofill while newer
versions that are known to support autofill would work in normal
mode.

Since compatibility mode should be used only as a fallback we
have a white list setting with the packages for which this mode
can be requested. This allows applying policy to target only
apps that are known to not support autofill.

Test:
     cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases
     cts-tradefed run cts-dev -m CtsAccessibilityServiceTestCases

bug:72811034

Change-Id: I11f1580ced0f8b4300a10b3a5174a1758a5702a0
2018-02-02 19:34:26 -08:00
Jeff Sharkey
5491881d77 Merge "Pass in the user defined by Context." 2018-02-03 02:12:22 +00:00
Jeff Sharkey
ad357d1839 Pass in the user defined by Context.
The majority of Manager-style classes already use Context.getUserId()
when making calls into the OS, so clean up the remaining callers to
unify behind this strategy.

This gives @SystemApi developers a nice clean interface to interact
across user boundaries, instead of manually adding "AsUser" or
"ForUser" method variants, which would quickly become unsustainable.

Test: builds, boots
Bug: 72863821
Exempt-From-Owner-Approval: trivial changes
Change-Id: Ib772ec4438e57a2ad4950821b9432f9842998451
2018-02-03 02:11:45 +00:00
TreeHugger Robot
146ea7f702 Merge "Fix checks for showing InputMethod picker" 2018-02-02 22:36:37 +00:00
Stan Iliev
5aec67ca1b Use ImageDecoder for NinePatchDrawable and BitmapDrawable
Don't scale NinePatchDrawable if bitmap has no density.
Fixed bugs around density and input streams.

Update PointerIcon to account for the fact that BitmapDrawable no longer
scales its Bitmap up at decode time. PointerIcon now handles the
scaling. This is necessary because PointerIcon never draws its Bitmap.
Instead, native code uses the Bitmap's internal SkBitmap without
accounting for density.

Test: Ran CTS:
- CtsUiRenderingTestCases
- CtsGraphicsTestCases
- CtsViewTestCases

Change-Id: I030b4bb89c66b0102ccea2d85f5271197558d14e
2018-02-02 10:26:57 -05:00
TreeHugger Robot
6a5ede856f Merge "Create 1x1 dummy surface when zero size is specified for drag shadow" 2018-02-02 01:59:16 +00:00
Jan Althaus
b3dc010599 Merge "Updating TextClassifier factory model names" 2018-02-01 06:43:45 +00:00
Daichi Hirono
29cae8904f Create 1x1 dummy surface when zero size is specified for drag shadow
Since P, we cannot create zero size surface. For compatibility, we
create 1x1 dummy surface when the app claims zero size surface.

Bug: 72416622
Test: Invoke startDragAndDrop with zero size surface
Change-Id: Ifefd07e93389979eaa2a6fbe29abe5850fcdef34
2018-02-01 09:52:42 +09:00
TreeHugger Robot
70f93ee673 Merge "Add API to set tonal shadow color" 2018-01-31 23:17:12 +00:00
TreeHugger Robot
b0c854ef99 Merge "Fixing generateLinks and java docs" 2018-01-31 23:16:13 +00:00
Tarandeep Singh
eb5706183f Fix checks for showing InputMethod picker
When user tries to switch IME, IMMS.showInputMethodPickerFromClient()
is called. The call fails to validate in newly introduced
canShowInputMethodPickerLocked() in
I4f0fc21268200c64d12b31ca54416acfbf62f37b because
mCurClient.client != client.

This is happening since the new client never started input ever since
we prevented calls to startInputUncheckedLocked in
Ibf9dab3d9c138b5f04e053d41ee4fd248c78e4da.

The fix is to update mCurFocusedWindowClient.client instead of
mCurclient.client in canShowInputMethodPickerLocked()

Fixes: 72557082
Test: manually using the steps in bug
Test: atest InputMethodManagerTest
Change-Id: I4e21625c32a0ca1abc740229efb3c7fcd97141cc
2018-01-31 11:28:23 -08:00
John Reck
d8be4a0abe Add API to set tonal shadow color
Bug: 68211332
Test: HwAccelerationTests's coloredshadow demo & CTS test in topic
Change-Id: I09f5d1067b3200564a9d47219f70985edf3a2527
2018-01-31 11:28:11 -08:00
TreeHugger Robot
88640b594d Merge "Add View#mClipBounds to ViewDebug." 2018-01-31 17:42:26 +00:00
Jan Althaus
dd68de50fb Fixing generateLinks and java docs
Also fixed import order

Test: Ran framework core tests
Change-Id: I8e99cfc8bab8f7c9f18310634c9565200df43e7f
2018-01-31 17:55:57 +01:00
Jan Althaus
abb4fc8464 Updating TextClassifier factory model names
The smartselection token no longer accurately describes the purpose of the
model. This change brings the factory models in line with the path for the
updated model.

Test: Ran framework core tests and tested manually
Change-Id: I7641db313c94b99bb6960cf1efd24f796bb092a2
2018-01-31 13:43:11 +01:00
Abodunrinwa Toki
0172104cf3 Merge "Smart Linkify API" 2018-01-31 12:37:16 +00:00
Abodunrinwa Toki
3bb4436138 Implement TextClassifier.getLogger API
- Introduces getLogger() API.
 - A logger should run in the client's process. This helps us manage
   sessions specific to a client.
 - The logger exposes a tokenizer that clients may use to tokenize
   strings for logging purposes.
 - Logger subclasses need to provide a writeEvent() implementation.
 - SelectionEvent is serializable over IPC.
 - Logger takes care of the session management. It writes session
   specific information into the SelectionEvent.
 - We still keep the SmartSelectionEventTracker for now so clients
   can slowly move off of it. The plan is to delete it.
 - The plan is to include support other event types. e.g. link events.

Bug: 64914512
Bug: 67609167
Test: See topic
Change-Id: Ic9470cf8f969add8a4c6570f78603d0b118956cd
2018-01-31 10:09:54 +00:00
Abodunrinwa Toki
fe20cdd910 Smart Linkify API
Uses the TextClassifier to generate links on a background thread.
The links are applied on the calling thread.

Test: see topic
Bug: 67629726
Change-Id: I0f1940a2ffbf19f4436c0a20b0c62e6bbc03cd7a
2018-01-31 09:42:36 +00:00
TreeHugger Robot
8420d5e596 Merge "Introduce a TextClassifierManagerService." 2018-01-31 05:26:27 +00:00
TreeHugger Robot
5b44673751 Merge "New Autofill APIs for UserData id." 2018-01-31 00:45:33 +00:00
TreeHugger Robot
72482d91b2 Merge "Updating the text classifier model path" 2018-01-30 21:50:35 +00:00
TreeHugger Robot
906fe08da4 Merge "ViewRootImpl: Notify SurfaceHolder.Callback if the surface size changed" 2018-01-30 17:15:46 +00:00
Jan Althaus
67d234d726 Updating the text classifier model path
The lib2 implementation of libtextclassifier is incompatible with models
for lib1. To avoid trying to load a lib1 model and failing (which happens
when devices are upgraded from O to P), we need a new update model path.
Using this opportunity to remove smartselection from the filename, which
isn't appropriate any more given what the model is used for.

Test: Ran core framework tests
Change-Id: I79a80d10d920019f5091fe9884f370149d39fe88
2018-01-30 16:57:19 +01:00
Adrian Roos
dcf50a4f4e ViewRootImpl: Notify SurfaceHolder.Callback if the surface size changed
Bug: 72492508
Test: Add SurfaceHolder window, rotate screen, verify surfaceChanged is called
Change-Id: Ifd7d4577367d8bd65e4a9f246bc29d667ecf0cc3
2018-01-30 15:23:17 +00:00
Abodunrinwa Toki
d32906c202 Introduce a TextClassifierManagerService.
Apps wanting to use a TextClassifier service (instead of an
in-app-process TextClassifier) bind to this service. The service
binds to and reroutes calls to a configured system TextClassifierService.

TextClassifierManagerService manages the lifecycle of the configured
TextClassifierService and binds/unbinds to preserve system health.

A configurable TextClassifierService extends TextClassifierService,
declares an android.textclassifier.TextClassifierService intent, and
requires a permission that is only granted to the system so only the
system may bind to it.

The TextClassifierManagerService implements a similar interface to
TextClassifierService (i.e. ITextClassifierService) but doesn't have to.
This is done for simplicity sake and things may change in the future.

The configuration of the default service is in config.xml.
OEMs may change this with a config overlay.
If no TextClassifierService is specified, the default in app process
TextClassifierImpl is used.

Bug: 67609167
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: tbd
Change-Id: I8e7bd6d12aa1a772897529c3b12f47f48757cfe6
2018-01-29 17:16:21 -08:00
Felipe Leme
f0baef7460 New Autofill APIs for UserData id.
Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest CtsAutoFillServiceTestCases:UserDataTest

Bug: 70407264

Change-Id: Id49efc88e1ccbfa2634bcb6ccaa3371f6fd2ed4e
2018-01-29 11:10:22 -08:00
Amin Shaikh
dc8ecca78f Add View#mClipBounds to ViewDebug.
Bug: 72543200
Test: verified hierarchyviewer displays clipBounds property
Change-Id: I4b7d0a40f836acadbc2cfcae07f6270b32c1f47d
2018-01-29 18:53:26 +00:00
Mihai Popa
d0166532b4 Merge "[Magnifier-16] Clamp to surface against distortion" 2018-01-29 12:14:25 +00:00
Mihai Popa
3589c2c643 [Magnifier-16] Clamp to surface against distortion
Previously, we were only making sure that the magnified content belongs
to the view the magnifier is attached to. However, when the view was
laid out partially outside the screen, we would pixel copy from outside
the surface the view is attached to. This would lead to the user seeing
a distorted content in the magnifier, in cases when the magnified view
lies outside the screen. This CL addresses this issue, by clamping the
pixel copy coordinates inside the surface we copy the magnifier content
from.

Bug: 72039853
Bug: 63531115
Test: bit CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: Iddab05c98b615259938e0d3a3320b98b3b13b246
2018-01-29 12:13:21 +00:00
TreeHugger Robot
231cb066ab Merge "Small fixes for TextClassifierImpl" 2018-01-27 23:39:52 +00:00
TreeHugger Robot
8036428c56 Merge "Revert "Move A11y events throttling away from View(RootImpl)"" 2018-01-27 03:45:39 +00:00
Eugene Susla
72c510f1c4 Revert "Move A11y events throttling away from View(RootImpl)"
This reverts commit e4d31b3c10.

Fixes: 71904218
Test: presubmit
Change-Id: Id73bde1a0c11696cf561c84cde027cdca4c6a00f
2018-01-26 11:32:25 -08:00
TreeHugger Robot
7849ab7137 Merge "Revert "Add developer setting to set the default GPU renderer."" 2018-01-26 17:50:55 +00:00
Jan Althaus
b7f7d36977 Small fixes for TextClassifierImpl
- Incorrect nullable annotation for Options
- Bad model output validation (start==end would pass, causing crashes in
    TextSelection constructor.
- Fix for potential null pointer exceptions in intent label generation.
- Fixed missing label for adding to contacts

Test: Manually verified add contact intent
Change-Id: I4ce0fdd1b1826caa11050a0dc808c9f8b28f90c2
2018-01-26 13:52:47 +01:00
TreeHugger Robot
b0db811fe9 Merge "Statsd and frameworks reference proto enums" 2018-01-26 05:02:35 +00:00
Bookatz
1a1b0464cb Statsd and frameworks reference proto enums
For frameworks constants that don't have intrinsic meaning (i.e. their actual
value and order don't matter), so that it is unlikely that their values
will be changed:
This cl introduces proto enums representing some constants found in
the Android codebase, and connects the two.

By using the Proto enum as the source-of-truth, it means that Java and
proto can be kept in sync. Otherwise, when the Java frameworks code
changes, it silently breaks the protos from working properly, since the enums
are wrong. By having the Java code reference the proto enums, it ensures
that everything is in sync. The values of the constants are unchanged.
But future changes to these constants will need to be done in the proto
file, which the Java file merely references.

The protos are necessary for incidentd and statsd and, in the future,
possibly dumpsys. In this way, the logging mechanism is much less likely
to get broken when new constants are added, and we can be ensured that
the logging accurately reflects the underlying codebase.

Bug: 69478930
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases
Test: cts-tradefed run cts-dev -m CtsIncidentHostTestCases
Change-Id: If79032c34b2799db1e3e70cb47b1312fd72092b9
2018-01-25 15:47:57 -08:00
Winson Chung
a89ffedaa3 Revert "Revert "3/ Add input consumer to capture touches during a Recents transition""
This reverts commit 86733be8f6.

Reason for revert: Testing relanding changes with ag/3515280

Change-Id: I37172d809db48622040d5fa41c4d4dcd077a9328
2018-01-25 13:44:44 -08:00
Winson Chung
e2d721781f Revert "Revert "2/ Add support for remote Recents animation""
This reverts commit 9f8518e532.

Reason for revert: Testing relanding changes with ag/3515280

Change-Id: I410bd752c815a5b998a719453def01e00a9d47c8
2018-01-25 13:44:44 -08:00
TreeHugger Robot
e2975162dc Merge "Adding intent generation for dates and flights" 2018-01-25 18:28:25 +00:00
TreeHugger Robot
48726eae32 Merge "Remove unused system api Window.setDisableWallpaperTouchEvents" 2018-01-25 18:05:15 +00:00
Wale Ogunwale
20f65bbdcd Remove unused system api Window.setDisableWallpaperTouchEvents
Test: builds
Change-Id: Ifd3e271a4af0bc4066747be9a147470498c39e5b
Fixes: 62263432
2018-01-25 08:12:48 -08:00
Jorim Jaggi
9f8518e532 Revert "2/ Add support for remote Recents animation"
This reverts commit 0026a5152c.

Breaks presubmits
2018-01-25 15:21:54 +01:00
Jorim Jaggi
86733be8f6 Revert "3/ Add input consumer to capture touches during a Recents transition"
This reverts commit fc78fe9acc.

Breaks presubmits
2018-01-25 15:21:38 +01:00
Jan Althaus
705b9e9a1b Adding intent generation for dates and flights
Bug: 67667478
Test: Added, and manually verified intent handling
Change-Id: Ib9e5a0df651690c852b7f44f226ffa768ce524e1
2018-01-25 12:22:04 +01:00
TreeHugger Robot
6d8cefdde9 Merge "Set ActivityView background to current top task's color" 2018-01-25 06:52:42 +00:00