Commit Graph

436 Commits

Author SHA1 Message Date
Phil Weaver
f4d1789b81 Merge "a11y: don't crash the system when illegal component name encounted" 2019-10-31 01:29:30 +00:00
Ian Kasprzak
686504cdf0 [DO NOT MERGE] Include exclude-rules in all TEST_MAPPING config instances.
Due to b/117880789, when TEST_MAPPING configs merge for ATP testing
the exclusion rules get dropped unless their included everywhere.

BUG: 139535125
BUG: 117880789
BUG: 139536812

Test: Forrest
Exempt-From-Owner-Approval: Disabling known failing TEST_MAPPING tests
for AOSP push to Q.

Change-Id: I275cdb78c17c6d2edb02945a41704ae6e3730217
2019-08-30 13:42:26 -07:00
Ian Kasprzak
1a5bb83588 [DO NOT MERGE] Cleanup TEST_MAPPING disables from ag/9285495
- Moved exclude filters to existing stanzas
- Removed new stanzas added w/ filters
- Removed un-needed filters because existing "include-filter"
  already excludes failing tests.

Disabling in preparation for merge to aosp-master (Q release).

Disabling the following tests:
FrameworksCoreTests:android.view.textclassifier.TextClassifierTest#testSuggetsConversationActions_deduplicate
CtsAppTestCases:android.app.cts.ServiceTest#testAppZygoteServices
CtsAppTestCases:android.app.cts.SystemFeaturesTest#testLocationFeatures
CtsProviderTestCases:android.provider.cts.MediaStore_Images_ThumbnailsTest

Test: Forrest
Exempt-From-Owner-Approval: Disabling known failing TEST_MAPPING tests
for AOSP push to Q.

Change-Id: I4dc2408c5bc6d421654f871c5d63d402c1d96d91
2019-08-29 10:38:56 -07:00
Raman Tenneti
f997c75d69 [DO NOT MERGE] Disabled the following tests in TEST_MAPPING:
FrameworksCoreTests:android.view.textclassifier.TextClassifierTest#testSuggetsConversationActions_deduplicate
CtsAppTestCases:android.app.cts.ServiceTest#testAppZygoteServices
CtsAppTestCases:android.app.cts.SystemFeaturesTest#testLocationFeatures
CtsProviderTestCases:android.provider.cts.MediaStore_Images_ThumbnailsTest

Disabling in preparation for merge to aosp-master (Q release).

Test: Forrest (atest)
L55600000358896983, L81400000359164936
BUG: 139704630
BUG: 139535570
BUG: 139536812
BUG: 139535125
BUG: 139305203
Change-Id: I9be2efd464fe031a0269fa5a3913ddb4959ba05d
Exempt-From-Owner-Approval: Disabling known failing TEST_MAPPING tests for AOSP push to Q.
2019-08-28 23:48:13 +00:00
wangmingming1
58dc31737c a11y: don't crash the system when illegal component name encounted
Bug: https://issuetracker.google.com/issues/139695999
Test: A11y unit tests (I did't find a way to reproduce the bug)

Change-Id: I0aa8f417b157ca3d96b61b8d9356dd65df360dae
Signed-off-by: wangmingming1 <wangmingming1@xiaomi.com>
2019-08-20 17:33:24 +08:00
mincheli
b7507a9997 Adjust event location when two-finger dragging in TouchExplorer
To scroll on the screen when using TalkBack, a user need to dragging two
finger pointers. If the dragging pointer are closer that a given distance
we use the location of the primary one. Otherwise, we should adjust the
event location to take the middle between the two finger pointers.

Bug: 126354276
Test: atest TouchExplorerTest
Change-Id: I9e95ccec964d7930498febdd02731b94826fbb7b
2019-04-25 13:40:03 +08:00
Jackal Guo
efc894eeec Merge "Race condition while injecting ACTION_OUTSIDE" into qt-dev 2019-04-24 05:47:11 +00:00
Jackal Guo
8bcc0a9846 Race condition while injecting ACTION_OUTSIDE
In order to dismiss dialog in accessibility, we would also send
ACTION_OUTSIDE while performing ACTION_CLICK. However, the result
of performing ACTION_CLICK in AccessibilityInteractionClient may
be overwritten by the result of performing ACTION_OUTSIDE. This
causes that TouchExplorer may get incorrect result and follow-up
behavior is different.

Bug: 127902192
Test: a11y CTS & unit tests
Test: After enabling Talkback, manually test on 'View Terms' page
      in ManagedProvisioning to check if the section heading can
      be expanded/collapsed by double tap.

Change-Id: Id6b1f63ea87418c66bf1aebdea829f656581e8ed
2019-04-23 03:29:47 +00:00
Sara Kato
0fdbae3c46 Add @Nullable annotation to getAccessibilityWindowId
Bug: 126701062
Test: None
Change-Id: I7d13d56f5ffb303431f7e82418134d6f17275ef5
2019-04-19 12:04:51 +00:00
Jackal Guo
5ed20a7782 Don't cancel injected event when mouse event arrives
Currently, MotionEventInjector would cancel any injected gesture when
any MotionEvent arrives. For user using an external device to control
the pointer movement, it's almost impossible to perform the gestures.
Any slightly unintended movement results in the cancellation of the
gesture.

However, if MotionEventInjector keeps sending mouse movement events
when gesture is performing, dispatch logic would be confused and it
causes the gesture malfunction. Therefore, ignore movement events
from mouse when there is an ongoing gesture since click event from
mouse should be intended.

Bug: 116459737
Test: add a new test case in MotionEventInjectorTest
Test: a11y CTS & unit tests
Change-Id: I2c2be8cf565ba15d1a9cd6bc8c45b695c1309b56
Merged-In: I2c2be8cf565ba15d1a9cd6bc8c45b695c1309b56
2019-04-11 02:50:01 +00:00
Rhed Jao
a82d7831b4 Merge "Fix unbind a11y service fail" 2019-04-03 03:10:03 +00:00
Phil Weaver
c0c7efc442 Add null check to destroyUiAutomationService
Fixes: 129704196
Test: atest UiAutomationManagerTest, atest CtsUiAutomationTestCases
Change-Id: I257c4f7321e9b3b54efe45e46ede50b010494c6e
2019-04-02 09:15:14 -07:00
Rhed Jao
69d13b1522 Fix unbind a11y service fail
Bug: 128422953
Test: all a11y cts & framework tests
Change-Id: I391c81b97f73805f375fd3ab36759dfc826847ec
2019-04-02 21:52:40 +08:00
TreeHugger Robot
cdc6650063 Merge "Dumps bound and enabled services in a11yManagerService" 2019-04-01 06:57:14 +00:00
Rhed Jao
d3547af8fe Dumps bound and enabled services in a11yManagerService
Bug: 128422953
Test: dumpsys accessibility
Change-Id: I2f1fd441818d0a7bd379a9e7d325bcb63b64c620
2019-03-29 16:11:51 +08:00
Rhed Jao
6c8a43b685 Update active window when a11y client is removed
Bug: 119844696
Test: all a11y cts & framework tests
Change-Id: I9d826db034d2a61d61304fce9dcfc9ef4d319058
2019-03-25 20:58:51 +08:00
Jackal Guo
43be31120d Remove unpaired AccessibilityEvent
After a failed gesture, TouchExplorer was trying to announce
the transition to touch exploration mode. Since TouchExplorer
doesn't enter this mode, stop notifying a11y services.

Besides, don't announce the end of the touch interaction if users
don't lift the fingers.

Bug: 118724767
Test: A11y CTS & unit test
Change-Id: I0320c47ac82e5371ef20c5bd16ef2d059ebad6f6
2019-03-18 14:58:27 +08:00
Michal Karpinski
e069b0022f Add new BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS binding flag
and the mechanism to use it

Since both starts and bindings might be contributing to the service
being whitelisted, track the state in ServiceRecord and update
the parent process accordingly when changes happen.

While we're at it, add that flag for bindings to accessibility
services, voice interaction services and QSTiles.

Also, make the timeout constant configurable for start-based
whitelisting.

Bug: 124298522
Bug: 123495976 (accessibility services)
Bug: 123337181 (paying via NFC, like Google Pay)
Bug: 122887611 (binding to InCallService)
Bug: 127774234 (binding to QSTile)
Bug: 124288681 (binding to voice interaction services)
Test: atest WmTests:ActivityStarterTests
Test: atest AccessibilityServiceConnectionTest
Test: manual with:
1) notifications from calendar and dynamite to test service starts
whitelisting
2) enabling talkback and livetranscribe to test service bindings
whitelisting
3) adding the LastPass QSTile and clicking on it
Change-Id: I8b6f23f999683920411ca40ab5b25c688a4f7055
2019-03-13 11:29:12 +00:00
Phil Weaver
f1c246619f Merge "Add owners for accessibility" am: bbbeba3c02 am: a525ea4436
am: c36e36b87e

Change-Id: Iaa5653b02e99a149186a99f3fda28111263aa2ad
2019-02-11 17:12:54 -08:00
Phil Weaver
6ac1a60bf1 Add owners for accessibility
Test: Relying on treehugger. No functional changes.
Change-Id: I2511b04e56301bd34a8eaced7be8dd8582cc3cc7
2019-02-07 10:52:13 -08:00
Jackal Guo
57a5b295f9 Merge "Add critical event to relevantEvents." 2019-01-31 01:07:07 +00:00
Jackal Guo
8b8cb1e252 Add critical event to relevantEvents.
When no WindowsForAccessibilityCallback is registered or no a11y
service watches events affected the active window, mActiveWindowId
won't be updated accordingly. This causes some a11y events can't
be dispatched due to mismatch of window id.

We need to add TYPE_WINDOW_STATE_CHANGED event to relevantEvents
in order to keep mActiveWindowId up-to-date once the packages are
not excluded from whitelist.

Bug: 118096360
Test: a11y CTS & unit test
Change-Id: Id139572cd350ba5d1b1927fe1fc94dc0d8ec6279
2019-01-30 18:07:29 +08:00
Rhed Jao
098876f547 Merge "Improve clear a11y forcus for A11yManagerService" 2019-01-30 08:01:13 +00:00
Jackal Guo
bfaeaf3607 Merge "Adding AppOps data for Accessibility" 2019-01-29 03:17:23 +00:00
Jackal Guo
8dc791e678 Adding AppOps data for Accessibility
Support to expose the apps accessing accessibility features in the
permission hub. Start logging each time any data goes to services.

Bug: 122615167
Test: a11y CTS & unit test
Change-Id: I21f92dad8b3ec2e59a8ad6d180dc466357347784
2019-01-28 15:54:24 +08:00
Jackal Guo
d6e8dba7e9 Using actual display id
For MagnificationGestureHandler, enable the support for multi-display
by giving actual display id instead of default one.

Bug: 112273690
Test: A11y CTS & unit test
Test: manual
Change-Id: I0f1e844e491f39d35b75ab398ff9481680610fc9
2019-01-24 14:41:06 +08:00
Jackal Guo
a275d99547 Merge "Support A11yInputFilter on multi-display" 2019-01-24 05:43:07 +00:00
Rhed Jao
be6a92d6b2 Merge "Fix delay when multi-tap out of distance slop." 2019-01-23 05:58:13 +00:00
Jackal Guo
8b729932db Support A11yInputFilter on multi-display
In order to support multi-display, some event handlers need to be
plural. Based on the characteristic of each event handler, only
the event handler that needs to deal with concurrent events from
different display needs multi-instance.

Test: a11y CTS & unit tests
Test: atest SystemUITests
Change-Id: I76379fb82aad09ee20609d81bd5b1dda15931905
2019-01-23 12:53:35 +08:00
Rhed Jao
dcc2b928fb Merge "Enable multi-display support for magnification controller" 2019-01-23 03:34:54 +00:00
Rhed Jao
0232d29e7b Fix delay when multi-tap out of distance slop.
Triple tap gesture didn't consider the case when user tap quickly
and out of distance slop. Just send out all delay motion events
if we detect a tap with out of the distance slop.

Bug: 122623669
Test: atest MagnificationGestureHandlerTest
Change-Id: Iadd05441e10f720f57297b6091f4acff5d198b7c
2019-01-22 18:52:49 +08:00
Christine Franks
88ec096b72 Merge "Move a11y color transforms to ColorDisplayService" 2019-01-18 23:08:37 +00:00
Rhed Jao
02655dc38c Enable multi-display support for magnification controller
1) New api for a11y service to specify display id and return
per display magnification controller.
2) Updae MagnificationController to support multi-display.
3) Update AccessibilityController to support multi-display
magnifier.

Bug: 112273690
Test: atest MagnificationControllerTest
Test: atest MagnificationGestureHandlerTest
Test: atest CtsAccessibilityTestCases
Test: atest CtsAccessibilityServiceTestCases

Change-Id: I643a8f96e7d57f729daf8df7f26c9014b1dfd476
2019-01-18 16:53:32 +08:00
Jackal Guo
e9d09ea04f Merge "Transit to exploration state after gesture isn't recognized" 2019-01-17 08:08:19 +00:00
Christine Franks
9114f46d36 Move a11y color transforms to ColorDisplayService
Bug: 111215474
Test: atest FrameworksServicesTests:ColorDisplayServiceTest and
atest FrameworksServicesTests:AccessibilityManagerTest
Change-Id: I264192f23fa3eeb821e1570be5c016824f3c3215
2019-01-14 14:13:14 -08:00
Gilbert Lee
0b2f7babbb Merge "Adjust maximum accessibility magnification scale from 5x to 8x" 2019-01-14 02:34:29 +00:00
Rhed Jao
23813d90a5 Improve clear a11y forcus for A11yManagerService
Clear a11y focus needs to find focused a11y node, and
perform clear a11y focus action in a11y client. It takes
2 binder calls and needs to wait for result in each call.

This patch combines two actions, and skip waiting block to
improve stability problem.

Bug: 109719681
Test: atest CtsAccessibilityServiceTestCases
Test: atest AccessibilityInteractionControllerTest
Change-Id: I418af0d9d58923d5cbca1b55934271130abd0254
2019-01-08 17:53:51 +08:00
Gilbert Lee
d38d699054 Adjust maximum accessibility magnification scale from 5x to 8x
Bug: 76414773
Test: Manual
      atest FrameworksServicesTests:com.android.server.accessibility

Change-Id: I558c641bc65ba07a6544d439c8616a7e5d6960b4
2019-01-08 13:04:27 +08:00
KOUSHIK PANUGANTI
cdc0d02e07 Migrate frameworks/base/services/accessibility to androidx.test
See go/jetpack-test-android-migration

Test: make checkbuild
Change-Id: Ie1d3ec69ffc61bb70b27ec78276aace5cef4bffa
2018-12-18 16:13:29 -08:00
Yuki Awano
ca4c57439d Add getAccessibilityWindowId system process API
- Add an API to get accessibility window id from window token. This API
  can be called only from a system process.

Bug: 119794051
Test: None
Change-Id: I37db50209efeb81f3e3502d84fd53fedec695f99
2018-12-10 13:36:56 +09:00
Robert Carr
51141c0a60 ScreenMagnifier: Track SurfaceFlinger Input
Surface scaling is now automatically/in-general applied to input
coordinates and so the accessibility service doesn't need to do
it's own scaling. We also track the renaming of "scaleFactor"
to "globalScaleFactor"

Bug: 80101428
Bug: 113136004
Bug: 111440400
Test: Magnifier works
Change-Id: Ib6a0ad7df56c7d040497d6f352abe3d74c38a49f
2018-11-27 18:06:36 -08:00
Rhed Jao
6c7522aecc Fix uiautomator failed to get active window.
A11y clients do not get correct RelevantEventTypes value
immediately, after a11y state turn on. This impact a11y clients
sending a11y events.

Bug: 112870790
Test: Manual - adb shell uiautomator dump
Test: atest CtsAccessibilityServiceTestCases
Change-Id: I6c55e4cd8e8823c2741628c38f94ab627ba74295
2018-11-19 11:19:38 +08:00
Rhed Jao
41118f33b1 Update a11y recommended timeout api.
Update api name to getRecommendedTimeoutMillis.
Api returns timeout for interactive or non-interactive controls.
Also provide the options for a11y service to specify two kinds of
timeout.

Bug: 111210981
Test: atest SettingsBackupTest
Test: atest AccessibilityManagerTest
Test: atest AccessibilityServiceInfoTest
Change-Id: I37d35796fd72bb4d6628a6bb33b111987f321552
2018-11-09 10:24:07 +08:00
Jackal Guo
5f766d81c5 Transit to exploration state after gesture isn't recognized
When gesture detection fails, TouchExplorer will try to transit to
exploration state once user is still touching the screen. However,
it resets the state right after it tries to transit to exploration
state currently.

Bug: 118724767
Test: A11y CTS & unit test
Change-Id: Ifcf931233da7cfcaf5b6c608bcd1c26e3a7a904a
2018-11-01 19:13:22 +08:00
Phil Weaver
667c2d0fa6 Clean up a11y bindInstantService and package check
Two orthogonal changes:
1. Making bindInstantService property internal to UserState and
putting a permission check on the setter.

Having the setter in SecurityPolicy didn't make sense to me
since the field was public anyway.

I'm removing the permission check on the getter for the system,
since the field is checked anyway in getInstalledA11yServices.
So it seems like it's possible to determine the value of this
value without the permission. It also just doesn't seem like
reading this value has any security implications.

I'm doing this as part of pulling SecurityPolicy out of AMS. It
felt silly to have a permission check that was only enforced
if the caller went out of its way to have it enforced.

2. Making list of valid packages independent of the caller.

Bug: 110715236
Fixes: 118701258
Test: A11y CTS
Change-Id: I43ad0b3f3e30eae1c2a3582db672217d957919df
2018-10-30 14:29:47 -07:00
Phil Weaver
27beee50d3 Make performAccessibilityShortcut a SystemAPI
Also create a new MANAGE_ACCESSIBILITY permission to
perform the shortcut.

Bug: 116118615
Test: make, activate accessibility shortcut
Change-Id: Ic65a0cdf7393429e14cb98f4fb0734d20069b05a
2018-10-30 10:10:41 -07:00
sanryhuang
95d6d82b13 Enable Per-display support on MagnificationController.
Refactor
1. Create DisplayMagnification to support multi-display
2. Using PooledLambda to simplify the existing code

Bug: 112273690
Test: MagnificationControllerTest, MagnificationGestureHandlerTest and
Manual test.

Change-Id: I19436b4671421dc58c0036e55f75178c1f413e9e
2018-10-22 20:55:24 +08:00
Jackal Guo
a1300eb05c Merge "Add null check for WindowInfo" 2018-10-10 23:32:22 +00:00
Jackal Guo
e97db706ce Add null check for WindowInfo
The WindowInfo may be null if the target window can't be found in
current mWindowInfoById. Add null guard to prevent from NPE here.

Bug: 116652152
Test: atest CtsAccessibilityServiceTestCases
Test: atest CtsAccessibilityTestCases
Change-Id: Iaf2446e66420289be4154e90fbe213bbca9fd41f
2018-10-09 17:59:26 +08:00
TreeHugger Robot
f4c7bdd1a6 Merge "Add synchronization to UiAutomationManager." 2018-10-08 20:48:38 +00:00