Commit Graph

10850 Commits

Author SHA1 Message Date
Phil Weaver
8583ae8a6a Add a11y titles for a few sysui windows
Adding for status bar, nav bar, and global actions dialog.
Also removing some extra code from global actions dialog
that populated window state changes. Apps in general don't
need this extra information, so we don't need to maintain
it in SysUi either.

In verifying the fix, I noticed that all windows were
considered anchored because of a mismatch between long and
int. Fixing that too.

Bug: 73131182
Test: With the testback a11y service, verified that these
titles do indeed appear in the window information provided
to accessibility services. Also noted that windows are no
longer reporting themselves as anchored.

Change-Id: Ie09fbb88250b3c9663d6c28001e0ce9f70c67954
2018-02-13 11:01:24 -08:00
TreeHugger Robot
ec053e07c1 Merge "New autofill APIs to get importantForAutofill mode on ViewNodes." 2018-02-12 19:04:42 +00:00
TreeHugger Robot
9036a88d95 Merge "Logging for linkify selections" 2018-02-12 14:44:35 +00:00
TreeHugger Robot
d591904d1d Merge "Fix size of parcelled TextClassification icons." 2018-02-12 12:17:58 +00:00
TreeHugger Robot
421822ce0f Merge "Clean up usage of COWArrayList in a11y code" 2018-02-09 22:17:41 +00:00
Eugene Susla
b7c8f2dc06 Clean up usage of COWArrayList in a11y code
The single usage we had was already mostly guarded by lock -
replaced with a regular list to prevent confusion

Fixes: 71795155
Test: atest CtsAccessibilityServiceTestCases
Change-Id: I1c3235aadb0db4907cbe92a17cc58d2c8a8b5564
2018-02-09 11:15:18 -08:00
TreeHugger Robot
09726a5d9d Merge "Added display name to DisplayInfo proto" 2018-02-09 06:16:25 +00:00
TreeHugger Robot
407445813a Merge "Draw text with a hairline stroke as if it is fill style" 2018-02-09 00:48:10 +00:00
TreeHugger Robot
40279e5407 Merge changes I6993325b,Icb5114fe
* changes:
  Frameworks: Annotate trivial @GuardedBy in services/core
  Frameworks: Annotate trivial @GuardedBy in core/java
2018-02-08 23:32:03 +00:00
Andrii Kulian
764e104e28 Added display name to DisplayInfo proto
Bug: 72048469
Test: ActivityManagerMultiDisplayTests
Change-Id: Ied6ed9ce26c8ea8fc49c645ecb86dc455255f947
2018-02-08 15:12:14 -08:00
Stan Iliev
7717e22c85 Draw text with a hairline stroke as if it is fill style
Dew to a side effect of HWUI opengl pipeline, the hairline stroke
is not respected, but it is drawn as a fill style. Implement the
same behaviour for skiagl pipeline with SDK API 27 and older.
On SDK released with Android P, the hairline stroke is respected.

Bug: 72494357
Test: Ran duolingo app
Change-Id: I48bdcf3ddec4bf65b5e93e01c5002177c4e3da90
2018-02-08 23:04:47 +00:00
Winson Chung
bc88614abe Merge "Revert "Revert "Exposing content insets and minimized home bounds for recents transition""" 2018-02-08 17:06:48 +00:00
Phil Weaver
6d8a63d771 Merge "Fix a11ynodeinfo parceling" 2018-02-08 16:52:43 +00:00
Andreas Gampe
3f24e69dbe Frameworks: Annotate trivial @GuardedBy in core/java
Add @GuardedBy for simple functions that require a single lock
and are named XYZLocked.

Bug: 73000847
Test: m
Test: m javac-check-framework RUN_ERROR_PRONE=true
Change-Id: Icb5114fea2ff2385e1cc7511121026099e05c0ee
2018-02-08 02:19:42 -08:00
felipeal
53308c1423 New autofill APIs to get importantForAutofill mode on ViewNodes.
Test: atest CtsAutoFillServiceTestCases:FatActivityTest

Fixes: 72834587

Change-Id: Ia30da4ba53175a5cc4da6837c60d379c8eda05a8
2018-02-08 10:50:15 +01:00
Winson Chung
584d652a1d Revert "Revert "Exposing content insets and minimized home bounds for recents transition""
This reverts commit bb5d97f00f.

Reason for revert: Launcher APK is landing shortly.

Test: Manual, swipe up to home in multi-window

Change-Id: I5d9050e51265bd4ca5ea2c28b7533571d03990f7
2018-02-07 17:51:29 -08:00
TreeHugger Robot
b8efd65ac3 Merge "Stop accepting zero size drag shadow for P." 2018-02-08 01:12:48 +00:00
Phil Weaver
6307240b8f Fix a11ynodeinfo parceling
The pane title was not parceled and unparceled symmetrically.
Fixing that.

Also, the CTS test that should have caught this error is broken.
Providing a test API to do parceling without recycling, so
parceling can be tested in isolation.

Bug: 73084962

Test: Updated CTS AccessibilityNodeInfoTest used to pass. After
the fix to parcel in isolation, the test failed. Fixing the pane
title parceling allows the test to pass again.

Change-Id: I161ce93f8bdea5d5dd2d28cd38b58633f7742e56
2018-02-07 15:47:33 -08:00
Abodunrinwa Toki
ef7cb2c0fc Fix size of parcelled TextClassification icons.
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationTest
Change-Id: I02d659c127ebccb16d0150b7b70587a9d786331e
2018-02-07 22:34:30 +00:00
felipeal
fd3f8f6f4b Minor improvements on autofill compat mode:
- Added missing fields such as viewResourceId, maxTextLength, and hint.
- Set input type class for passwords.

Test: manual verification
Bug: 72811034

Change-Id: I60dc7a368726d298f43e1f84b28561140ba10329
2018-02-07 11:54:12 +01:00
Winson Chung
67f31199fb Exposing content insets and minimized home bounds for recents transition
- In order to calculate the final target rect and window clip for the
  app currently transitioning into the task view in launcher (similar to
  how we did in SysUI), we need to provide the content insets and bounds
  for both the app and launcher (whose activity may not yet have been
  shown).  For the existing recents transition, this was calculated
  internally in the AppTransition aspect-scaled transition, but now that
  we are implementing this via remote animations, the same information is
  needed in the implementation of the recents animation runner.

Bug: 70294936
Test: Swipe up from launcher with window transitions when in multi window
Change-Id: I2afc6bdfe112cc7bb1b07ba65213653f6f0634f9
2018-02-06 16:15:41 -08:00
TreeHugger Robot
98517be352 Merge "Revert "Remove @hide from ViewGroup debug methods"" 2018-02-06 22:45:40 +00:00
TreeHugger Robot
ea26b2a470 Merge "Allowing models to support multiple languages" 2018-02-06 14:51:03 +00:00
TreeHugger Robot
738471a962 Merge "Make phone number actions dependent on user privileges" 2018-02-06 11:01:53 +00:00
Jan Althaus
ef0156d707 Allowing models to support multiple languages
Note that there are edge cases where this diverges from O behaviour.
Specifically in the case where there is a more specific factory than
update model.
For example: system language is "en-us", factory model is v3 "en-us",
update model is v4 "en". In O, we would have selected the factory model,
now we select the update one.

This also fixes a bug that caused model versions to not get logged.

Test: Ran framework core tests, and tested manually.
Bug: 72427364
Change-Id: Ied35335512563e2cbaaeb5790b425b1e9fffbaa8
2018-02-06 11:52:47 +01:00
Alan Viverette
2d7771ca60 Revert "Remove @hide from ViewGroup debug methods"
This reverts commit 1244815e8f.

Bug: 71555179
Test: make
Change-Id: Ibfd97660e5f91fc7fac13b66efa8aa587ba20b4e
2018-02-05 19:14:14 +00:00
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
Jan Althaus
92c6decbb8 Logging for linkify selections
Bug: 67629726, 70246800
Test: Manually validated, ran CTS tests, and framework tests
Change-Id: Icd41f1e171767bc466f47c87a6ab611185745fd4
2018-02-05 16:56:52 +01: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
Daichi Hirono
ec96d0d3fd Stop accepting zero size drag shadow for P.
Since P SurfaceControl does not accept zero size, thus we also stop
creating zero size drag shadow image.

Bug: 72416622
Test: Invoke startDragAndDrop with zero size shadow
Change-Id: I28f9cac419348a2550ac4db7de9016df82fc6385
2018-02-05 11:16:52 +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
Jan Althaus
05e0051d1d Make phone number actions dependent on user privileges
Bug: 69000125
Test: Tested following the instructions on the bug
Change-Id: I60e927b32df76e328edb8666c9c8fd3dde46064d
2018-02-02 15:29:18 +01: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