Commit Graph

603 Commits

Author SHA1 Message Date
Miranda Kephart
44cc1e274b Merge "Add screenshots logging" into rvc-dev 2020-04-21 16:58:54 +00:00
Winson Chung
18c1d27df9 Merge "Add shell command to trigger global action" into rvc-dev 2020-04-21 03:26:56 +00:00
Winson Chung
0f3a378bb5 Add shell command to trigger global action
Bug: 150817783
Test: adb shell cmd accessibility call-system-action <id>
Change-Id: Iaa85b7ada85d39305300b56b1a3725fcbfee4e95
2020-04-20 15:09:48 -07:00
sallyyuen
867c6d2786 Support sending KEYCODE_HEADSETHOOK KeyEvent from an a11y service
Add a private global action to be made public in S. A service can
trigger the event by calling performGlobalAction(10) in R.

Note: Currently 10 is being used by SystemActions for the Accessibility
shortcut. Update ag/10921262 to avoid a conflict.

Bug: 154038741
Test: Tested with modified TalkBack and Youtube play/pause
Change-Id: I3ca5d25948bfb3eb8520030484cb466ec7188784
2020-04-20 12:21:21 -07:00
Miranda Kephart
7b2c313da7 Add screenshots logging
Bug: 150710005
Test: manual
Change-Id: I54a37eb0a62234c6c53fc0f3c80e18e9ee269f12
2020-04-17 13:28:23 -04:00
Sally Yuen
1fb728d78e Merge "Revert "Laziliy initialize SystemActionPerformer"" into rvc-dev 2020-04-16 20:26:47 +00:00
Sally Yuen
73a4b26307 Revert "Laziliy initialize SystemActionPerformer"
This reverts commit d3ef403fc3.

Reason for revert: b/153947446
Bug: b/153947446, b/145909124

Change-Id: Idbab007a5e91361c019e206e37925656e710625f
2020-04-16 20:26:32 +00:00
Rhed Jao
8fcba0353e Fixes long press the a11y shortcut no response
An a11y service targeting sdk version > Q and requesting a11y button
should be turned on by the Settings when it's assigned to the a11y
shortcut by the user. An a11y button callback is sent to the a11y
service when the user long press the a11y shortcut.

This issue happened when an disabled a11y service is assigned to the
a11y shortcut, and upgraded to the target sdk version > Q. Framework
fails to send the callback and no response when user long press the
shortcut.

Turns on the a11y service and show up a toast to fix this issue.

Bug: 153517972
Test: atest AccessibilityShortcutControllerTest
Change-Id: Ie4fc9bbeaf08ba674cfe6382eab214b2a15c004c
2020-04-16 12:14:23 +08:00
Qasid Sadiq
693c69ca30 Merge "Use current user isntead of system user if no --user parameter is passed" into rvc-dev 2020-04-08 20:40:11 +00:00
Qasid Ahmad Sadiq
d0129ce59b Use current user isntead of system user if no --user parameter is passed
This is relevant when running cts tests in instant mode.
Certain tests were failing in non-system users in instant mode, which is particularlly consquential to auto.
THis fix will be cherry-picked back to their repo
Test: CTSAccessibility*, in both instant/non-instant, and with both system and secondary users.
Bug:146218533

Change-Id: I89937bd552d372adc5d96c51b24d1a2bb4a034e3
2020-04-08 01:51:05 -07:00
Rhed Jao
6651da4348 Merge "Fix a11y service targeting sdk version doesn't update" into rvc-dev 2020-04-08 01:54:46 +00:00
Sally Yuen
63f5570796 Merge "Laziliy initialize SystemActionPerformer" into rvc-dev 2020-04-06 23:55:54 +00:00
Jacky Kao
aa8f5cb671 Merge "Supporting multi-display for takeScreenshot()" into rvc-dev 2020-04-06 09:03:42 +00:00
sallyyuen
d3ef403fc3 Laziliy initialize SystemActionPerformer
Tests indicate starting up AccessibilityManagerService takes 5ms longer
than expected and may be due to ag/9726764. Unsure how that change
could cause it, but we can take action and avoid initializing
SystemActionPerformer on start up.

Bug: 145909124
Test: builds and registers actions
Change-Id: Id7b8d5bfc450f96691b1810bf701644a0b1ef637
2020-04-03 14:50:02 -07:00
Rhed Jao
f74e5ccbe5 Fix a11y service targeting sdk version doesn't update
The accessibility service connection uses old service info
to create connection while the system is trying to rebind the
enabled services after packages finished updated. The root
cause is we always reloaded the installed service info after
the a11y services were rebound. To fix this issue, always
reloads the installed service info before rebinds the services.

Bug: 152817355
Test: All a11y related cts tests
Change-Id: Iab424940fc47b5a5f44096d67dc7bdfe2d43c5be
2020-04-02 12:11:52 +08:00
Menghan Li
fea8d184c2 Merge "Accessibility Service & Shortcut Redesign - Remove “volume key shortcut” setting (5/n)" into rvc-dev 2020-03-26 00:21:50 +00:00
Jacky Kao
316477c399 Supporting multi-display for takeScreenshot()
Creating a new API, screenshotWithoutSecureLayer(), to get the
graphic buffer of screenshot for all displays including non-default
display and virtual one. We can use it to support multi-display
of takeScreenshot() API.

Bug: 145893483
Test: a11y CTS & unit tests
Test: manual testing to take screenshot of second display which is a
monitor with chrome cast

Change-Id: I474c71f7e01d57b5a318b2a5bfb690a2e01c128c
2020-03-25 13:46:11 +08:00
menghanli
390f8f9be9 Accessibility Service & Shortcut Redesign - Remove “volume key shortcut” setting (5/n)
- Target to fix migration issue to support a user revoked the accessibility shortcut before upgrading to R, but wants to to apply new hardware shortcut design in R.
- The switchbar of accessibility_shortcut_enabled was removed in (1/n), so we should also remove related checker in controller.

Bug: 142529032
Test: atest AccessibilityShortcutControllerTest
Change-Id: I48f8d88c4192e894b9e210221e5dc7e701344623
2020-03-25 07:46:41 +08:00
ryanlwlin
443b8fb803 [DO NOT MERGE] Fix incorrect order of Accessibility events
The Accessibility events order for gesture end and touch interaction
end are exchanged in following conditons:
1. touching duration is very short.
2. Hover exit events comes right away after receving
action_up.
It leads to incorrect state of touchExplorer and sending incorrect
hoverevent in next touch-interaction.

Bug: 150171638
Test: atest FrameworksServicesTests:com.android.server.accessibility.gestures
Test: atest android.accessibilityservice.cts.TouchExplorerTest
Test: manual test
Change-Id: Ia60d51414dd63a2a30be61372e8fbd2e3d9f723f
2020-03-24 11:05:49 +08:00
Jacky Kao
658dd8047d Merge "Reply error through callback for takeScreenshot()" into rvc-dev 2020-03-20 04:12:24 +00:00
Jacky Kao
6c8bdbb511 Reply error through callback for takeScreenshot()
Passing the error code through callback to the caller.

Bug: 150865445
Test: a11y CTS & unit tests
Change-Id: I8ca75908289a9fbd888689788a982f68cc7392ad
2020-03-20 08:40:55 +08:00
Jackal Guo
8681ea30eb Using parent windowId instead
AccessibilityWindowManager would get null interactive region since
embedded hierarchy doesn't have window. Because interactive region
is null, A11yInteractionController#adjustIsVisibleToUserIfNeeded
wouldn't adjust its visibility to false. This results in that the
visibility of A11yNodeInfo on embedded hierarchy may be incorrect.

Bug: 151203875
Test: a11y CTS & unit tests
Change-Id: I7d61a15994bf726e708e597d0363904fdb32f183
2020-03-11 18:27:08 +08:00
Heemin Seog
d1bbc14732 Merge "Replace TYPE_STATUS_BAR_PANEL with TYPE_STATUS_BAR_ADDITIONAL" into rvc-dev 2020-03-04 17:06:50 +00:00
Jacky Kao
4082aa2e19 Drop the hardware buffer
Closing the hardware buffer after sending over to the requesting app,
and adding the document that the app developer has to close the buffer
ASAP.

Bug: 150174095
Test: atest AccessibilityTakeScreenshotTest
Change-Id: I8e759a7d83c0a9adfd1b37d0bbf515c9babde7a4
2020-03-02 08:21:47 +08:00
Jacky Kao
979600dce1 Add a rate limitation of takeScreenshot() API
Adding the rate limitation of takeScreenshot() API is one time
per second to avoid the system health impact.

Bug: 149968870
Test: a11y CTS & unit tests
Change-Id: Iaedafda9b9a5a56941952df54e62d76a92936b1d
2020-03-02 08:21:11 +08:00
Heemin Seog
2cf45dd224 Replace TYPE_STATUS_BAR_PANEL with TYPE_STATUS_BAR_ADDITIONAL
Deprecate TYPE_STATUS_BAR_PANEL. Currently
TYPE_STATUS_BAR_ADDITIONAL maps to the same z order as
TYPE_NOTIFICATION_SHADE. This will be updated in a subsequent CL.

Also move everything in TYPE_STATUS_BAR_PANEL to
TYPE_STATUS_BAR_SUB_PANEL so that it remains above the notification
shade / keyguard layer. TYPE_STATUS_BAR_PANEL will no longer be valid.

As part of the work on having more flexible inset mapping (for Android
Automotive) we want to use the TYPE_STATUS_BAR_ADDITIONAL to be used
for system bars in different places (i.e. Status Bar on the left side of
the screen).

Bug: 140423092
Bug: 145242835
Test: boot (sdk_gphone_x86, hawk), existing tests (atest SystemUITests)
Change-Id: I0ce3c4152fd05a948c06ed1a96c3ba279bd7097a
2020-02-26 14:11:53 -08:00
Automerger Merge Worker
33b8bf685a Merge "Make me an owner of accessibility frameworks" am: 269d57b7da am: 6374aaf5c5 am: 865c89c5a3
Change-Id: I88fd0443d59c45ad625af9d72f05d8de8e4cb783
2020-02-20 04:29:31 +00:00
Automerger Merge Worker
6374aaf5c5 Merge "Make me an owner of accessibility frameworks" am: 269d57b7da
Change-Id: Ibf012b4b2221ceee9d616b78aae7971ddd042cc6
2020-02-20 00:24:03 +00:00
Qasid Ahmad Sadiq
88d52e8ca6 Make me an owner of accessibility frameworks
Test: Relying on treehugger. No functional changes.
Change-Id: If0e88345001ec286bd0a9a01314dba53e45dc6ac
2020-02-19 14:02:07 -08:00
TreeHugger Robot
fd33a24650 Merge "Fix failure in postsubmit" 2020-02-19 09:45:20 +00:00
Ryan Lin
687fb4bcc1 Merge "Don't notify display removed if it's a private virtual display" 2020-02-19 09:42:56 +00:00
ryanlwlin
6a34da5a64 Don't notify display removed if it's a private virtual display
Some operation will be done When displays are removed/Added,
but virtual private display should be excluded.

Bug: 148760652
Test: manual test:1.Enable the magnification from a11y setting
2. Enable the select to speak and read text on images
3.Tap the a11y shortcut to select to speak the content
4. check if the content is selected correctly.
Change-Id: I8e0fbc4da7cbb6b9c5bf5366115b3863be5243bb
2020-02-19 15:15:10 +08:00
Jackal Guo
1eac68b121 Fix failure in postsubmit
There are some package-pricate classes and methods in a11y framework
so we use DexmakerShareClassLoaderRule to mock them. However, this
results in some unexpected excpetions during testing. Change some of
them to public with @VisibleForTesting annotation, and remove the
DexmakerShareClassLoaderRule to avoid the exception.

Bug: 149362507
Test: atest FrameworksServicesTests:com.android.server.accessibility
Change-Id: I1e526ca79cf14b3d394ee132480dcd8c226ae69a
2020-02-19 13:57:36 +08:00
Ameer Armaly
cc13292c06 Add passthrough functionality for touch exploration and gesture detection.
Bug: 136131815:
Test: atest GestureManifoldTest AccessibilityGestureDetectorTest TouchExplorerTest
Change-Id: I8c6b7a333dcb9a4949387a7a683e2dc229d2b18f
2020-02-18 23:52:44 +00:00
Minche Li
bd73dfa88e Merge "Update the current user id for MagnificationController" 2020-02-18 11:56:47 +00:00
mincheli
acf5b57d0a Update the current user id for MagnificationController
If the cached user ID is not updated after switching user,
the persistent magnification scale setting would be the
last user's manginification scale setting.

Bug: 148831149
Test: atest MagnificationControllerTest
Change-Id: Icef2834cb482bef753191feaf988b28831a2e691
2020-02-15 16:44:33 +08:00
Jacky Kao
075a8094b4 Merge "Improvement for takeScreenshot() API" 2020-02-14 04:35:01 +00:00
Jacky Kao
5519738da5 Improvement for takeScreenshot() API
1. Modify the related documentations.
2. Make the timestamp got from framework side.
3. Use the ParcelableColorSpace class.

Bug: 149271120
Test: a11y CTS & unit tests
Change-Id: I2aedf67f8ed7d949322b23b59eaa383e53ecb594
2020-02-14 09:36:00 +08:00
Ameer Armaly
259daddeea Add multi-finger double tap and hold gestures.
This CL includes two, three and four finger double-tap and hold.

Bug: 136131815
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest
Change-Id: I4c0a95a4ac2d13e0a7e2c7920df619063ec1cfc0
2020-02-13 11:23:36 -08:00
Jackal Guo
a459b199c1 Support accessibility on embedded hierarchies (2/n)
Introduce AccessibilityEmbeddedConnection. This interface provides
to the host view to the latter can interact with the view hierarchy
in SurfaceControlViewHost.

Bug: 137593247
Test: a11y CTS & unit tests
Change-Id: I9c4f5478c5ecd3bda7f688fa23660f372b59512b
2020-02-11 08:56:10 +08:00
Jacky Kao
76c7f54d15 Merge "Changing the return type of takeScreenshot() (2/n)" 2020-02-07 00:01:49 +00:00
Jacky Kao
2fffd22b76 Changing the return type of takeScreenshot() (2/n)
Implementing the new return type for A11y services to take
the screenshot of the specified display.
boolean takeScreenshot(int displayId,
@NonNull @CallbackExecutor Executor executor,
@NonNull Consumer<ScreenshotResult> callback)
The return type is a new class, ScreenshotResult, including
hardwareBuffer, colorSpace, and timestamp. A11y services could
use the method, Bitmap#wrapHardwareBuffer, to obtain the bitmap.

Bug: 10931661
Test: a11y CTS & unit tests
Change-Id: I03eae10f0970d0e11e02c9d3f4031c4096b7b5b4
2020-02-06 16:29:05 +08:00
Ameer Armaly
ec5eb82a6d Add four-finger gestures.
This CL includes the following gestures:
1) Four-finger single / double / triple tap.
2) Four-finger swipe up / down / left / right.

Bug: 136131815
Test: atest GestureManifoldTest AccessibilityGestureDetectorTest TouchExplorerTest
Change-Id: If5b4bfc680423f0672452b9aa440c8f18333f565
2020-02-05 11:13:12 -08:00
Ameer Armaly
6dc501b986 Fix crash when a motion event doesn't include locations for all pointers.
When performing a multi-finger gesture, if one finger goes up before the rest of the fingers have finished moving, we need to account for that finger not being present in subsequent motion events.

Bug: 148880038
Bug:136131815
Test: Enable talkback. Enable debugging in TouchExplorer. Perform multi-finger gestures in such a way that one finger goes up just before the other fingers finish moving. Inspect logs.
Test: atest GestureManifoldTest AccessibilityGestureDetectorTest TouchExplorerTest
Change-Id: Ic3158301be657f39232db9f5b3006f87d8d83c4f
2020-02-05 11:12:25 -08:00
Phil Weaver
a8486be97d Merge "Add tests for ending TouchExplorer dragging" 2020-02-03 18:41:41 +00:00
Ameer Armaly
b66d226377 One-finger swipe: remove unnecessary allocations.
Part of the old swipe code, which was copied over to the new swipe detector, used GesturePoint objects because it needed to track the time of each entry in the gesture path. This is no longer necessary because we use handlers to cancel the gesture on a delay. This change makes the whole class use PointF which avoids allocating a new PointF for some subset of the GesturePoints during the gesture recognition process.

Bug: 136131815
Test: atest GestureManifoldTest AccessibilityGestureDetectorTest TouchExplorerTest
Change-Id: I1c89122d7f27b52a25e777667e34fec246d5c21f
2020-02-02 03:56:29 +00:00
Ameer Armaly
8fa1dd2aad Add one-direction multi-finger swipes.
Bug: 136131815
Bug: 142277518
Bug: 142277280
Test: atest GestureManifoldTest AccessibilityGestureDetectorTest TouchExplorerTest
Change-Id: I3e6997c863d50e3f2d8638ca57b508676f0909a1
2020-02-02 03:56:05 +00:00
Phil Weaver
a5bfdb2df5 Add tests for ending TouchExplorer dragging
Increasing test coverage.

In the process, found a bug in dispatching up events for
multiple fingers. It was sending an action_up for each
pointer rather than a pointer up.

Bug: 148690104
Test: atest TouchExplorerTest
Change-Id: I04353bd4ad222d6bc4096a62de48b1fe00363b3a
2020-01-31 17:40:45 -08:00
Hongming Jin
6b62158ad5 Allow recents components to register/unregister system action.
Bug: 136286274
Test: atest AccessibilityManagerServiceTest
      atest AccessibilitySecurityPolicyTest
Change-Id: I8926f8c52995d6997c7ed601ebe30d1a1f209347
2020-01-29 13:38:08 -08:00
Dieter Hsu
3cbd098e7a Implement multi-finger multi-tap gesture matchers for accessibility
This matcher would detect following gestures when accessibility flag
flagRequestMultiFingerGestures enabled:

- 2-finger single tap
- 2-finger double tap
- 2-finger triple tap
- 3-finger single tap
- 3-finger double tap
- 3-finger triple tap

Bug: 142277684
Bug: 142276516
Bug: 136131815
Test: atest AccessibilityGestureDetectorTest TouchExplorerTest GestureManifoldTest

Change-Id: I0aa6e858520d0b36c81df6fe08fd86d7d0803d5a
2020-01-28 13:24:12 -08:00