Commit Graph

277 Commits

Author SHA1 Message Date
Ameer Armaly
2820f73943 Enable two-finger passthrough swipes.
Bug: 162521649
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: I9e6b691295a0fa006578d7b8ad8468579c66939c
2020-08-06 15:25:18 -07:00
Sally Yuen
f55b5b9620 Unhide global action constants
Bug: 158004529
Test: Builds
Change-Id: Ida65a458767417536975519b89afc2a81a9034e9
2020-06-24 18:03:41 +00:00
Sally Yuen
38401222ac Merge "Add GLOBAL_ACTION_ACCESSIBILITY_ALL_APPS" into rvc-dev am: 310bf3094a am: 47c5064448 am: f0866c2436 am: 23cdd538fb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11697460

Change-Id: I91d26054990c5682aa1d18fa1a31cb895b6a47a6
2020-06-03 04:29:03 +00:00
sallyyuen
ab76090f4b Add GLOBAL_ACTION_ACCESSIBILITY_ALL_APPS
This will allow a11y services to identify the all apps system actions by
id.

Bug: 157078174
Test: manual with all apps and talkback
Change-Id: Ice0969753d6ed789dca762f49859b17ea1de85e9
2020-06-01 20:15:15 -07:00
Sally Yuen
e2a64c2a4d Merge "Add triggering the accessibility shortcut as a system action" into rvc-dev am: a2172bb23d am: 1364309ddf am: 5bece41596 am: 2930431c81
Change-Id: I724f656b195582e8007cfc006ac4cd7d4b8eba50
2020-05-04 16:37:59 +00:00
sallyyuen
40dd559f9e Add triggering the accessibility shortcut as a system action
Holding down the volume keys triggers the shortcut, making it a
system-level action.

Bug: 154950547
Test: Tested with TalkBack
Change-Id: I2aac0162047f7900103eab472ff649d77836ca93
2020-05-01 15:01:55 -07:00
Sally Yuen
0618fe5dbf Merge "Fix system action API issues in SystemActions" into rvc-dev am: f8331a8a91 am: cb18d3a091 am: adc21f26d1 am: ee2aab3b66
Change-Id: I7880230362dc55b9bce3119a4adc3f653413d2f3
2020-04-27 23:15:50 +00:00
sallyyuen
93edd11724 Fix system action API issues in SystemActions
1) Actions are only registered when the service starts. If the locale
changes, the labels need to be translated, so re-register the actions
when this happens.

2) When its shortcut isn't visible the a11y menu action is a no-op. The
list should be an accurate representation of what actions are available.
Pass SystemActions into NavigationBarFragment, which keeps track of the
shortcut availability,  to unregister/register the action.

To do this, SystemActions exposes register/unregister to the fragment
and makes SYSTEM_ACTION_ID_ACCESSIBILITY_MENU public.

3) Remove Toggle Split Screen from SystemActions. The trigger isn't
system-level but is rather buried in the Recents UI in a button for each
app, and the a11y user can access this like everyone else.
SystemActionPerformer will still handle the legacy action call in
performSystemAction.

4) Rename "Accessibility Menu" to "On-screen Accessibility Shortcut"

Bug: 152636060, 152635646, 154833492
Test: Manual TalkBack test
Change-Id: I9b037f91c8d3b6f193fc9aee95ef73b7f3fbf315
2020-04-27 13:05:57 -07:00
Jason Hsu
1a991ab3f9 Merge "Return empty for empty string in AccessibilityShortcutInfro#loadHtmlDescription" into rvc-dev am: 9e0ada13c8 am: 1bd8509d0c am: 670c2ff34c am: 3d89fd5c28
Change-Id: Ibcedac6d36670401a64319587a920d6f426f0565
2020-04-21 10:43:50 +00:00
Jason Hsu
5a01f52930 Merge "Allow one of description or htmlDescription attribute provided for AccessibilityShortcutInfo" into rvc-dev am: 61f191f198 am: 8b76ed3ce0 am: 4c0c9351b4 am: 8fb143ef20
Change-Id: I492cbe5eb1253b78e44f2f35e26356457cc00e5e
2020-04-21 10:43:36 +00:00
Jason Hsu
9e0ada13c8 Merge "Return empty for empty string in AccessibilityShortcutInfro#loadHtmlDescription" into rvc-dev 2020-04-21 09:41:59 +00:00
Jason Hsu
61f191f198 Merge "Allow one of description or htmlDescription attribute provided for AccessibilityShortcutInfo" into rvc-dev 2020-04-21 09:41:14 +00:00
Jacky Kao
5dc99c6f58 Merge "Supporting multi-display for takeScreenshot() on master" 2020-04-20 23:35:58 +00:00
Sally Yuen
ebbaa23cef Merge "Support sending KEYCODE_HEADSETHOOK KeyEvent from an a11y service" into rvc-dev am: fdea871287 am: 2e4c291096 am: 319cee5020 am: 8b724cd5e2
Change-Id: I10c4cdd229c45b9e02963af7b657585c198ec3ac
2020-04-20 23:26:58 +00: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
jasonwshsu
066a544d06 Return empty for empty string in AccessibilityShortcutInfro#loadHtmlDescription
* Follow the behavior to return empty if given string is empty
	- AccessibilityServiceInfo#loadDescription
	- AccessibilityServiceInfo#loadHtmlDescription
	- AccessibilityShortcutInfo#loadDescription
	- AccessibilityShortcutInfo#loadHtmlDescription

Bug: 154092127
Test: manual test
Change-Id: I77f455945c569c81cb00127a7913bae4db1b3d1c
2020-04-20 14:57:40 +00:00
jasonwshsu
72dfaf89d7 Allow one of description or htmlDescription attribute provided for AccessibilityShortcutInfo
* Only two of them are empty should throw parser error

Bug: 154092127
Test: manual test
Change-Id: I038dbb054f4302b9f5e2c3246fb9539c77533339
2020-04-20 21:59:24 +08:00
Jacky Kao
3ff343554a Supporting multi-display for takeScreenshot() on master
Based on the change of this patch, ag/10633571,
Convert ScreenshotGraphicBuffer to ScreenshotHardwareBuffer, on
master branch only, re-porting this CL, ag/10700743, from rvc-dev
to master.

Bug: 153398112
Test: a11y CTS & unit tests
Change-Id: Iee1ed715f8912569c8db4a7297ee5ef4990e9e70
2020-04-17 07:46:26 +08:00
Automerger Merge Worker
0ea0caa75c Merge "Merge "Make the system action API more clear with documentation" into rvc-dev am: 3987ae1ad8 am: 66f5db1e8e" into rvc-d1-dev-plus-aosp am: 9b9021593e am: 7ff11732a8
Change-Id: I0248361a05abde1f23587d1e600db6f3ff491d49
2020-04-07 01:01:15 +00:00
Sally Yuen
3987ae1ad8 Merge "Make the system action API more clear with documentation" into rvc-dev 2020-04-06 23:54:03 +00:00
sallyyuen
ca5c921416 Make the system action API more clear with documentation
Bug: 149755168
Test: N/A
Change-Id: I2c82ce755d3c94d0514f49da0cc770c83dafbad1
2020-04-03 09:23:29 -07:00
Robert Berry
793b0f4bcb Sync granularity of gestures with vsync
Gesture dispatch should match the refresh rate of the Display, in order
to create smooth animations. The previous behavior was to split gestures
up into 100ms steps. Retain that behavior for AccessibilityService
instances that are targeting pre-R. For R, split gestures up into enough
steps to closely track refresh rate.

Test: manual
Bug: 150190594
Change-Id: I80b24227f86916945abf7ff8bfb60a91fc12f50e
2020-03-30 13:45:02 -04: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
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
Jacky Kao
0ad1f82733 Throw IllegalArgumentException for takeScreenshot()
Throw IllegalArgumentException for non default display
since it’s unsupported

Bug: 150865445
Test: a11y CTS & unit tests
Change-Id: Iac0602e444d23b28ea05d29dd4605c7a821b641a
2020-03-12 07:56:57 +08:00
Jackal Guo
2d627ec8f3 Merge "Update Javadoc" into rvc-dev 2020-03-05 01:11:23 +00:00
Jason Hsu
6820d68e25 Merge "Support settings activity for accessibility shortcut target" into rvc-dev 2020-03-04 12:13:42 +00:00
Jackal Guo
fd2eab0067 Update Javadoc
Note the limitation on embedded hierarchy.

Bug: 149199973
Test: build pass (m -j docs)
Change-Id: I2be24ecb79f35a7ded913e37d8e8c32511f760f3
2020-03-04 11:51:47 +08:00
Jacky Kao
494960e818 Merge "Drop the hardware buffer" into rvc-dev 2020-03-03 02:50:40 +00:00
Jacky Kao
78afcedf9f Merge "Add a rate limitation of takeScreenshot() API" into rvc-dev 2020-03-03 01:06:40 +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
Rhed Jao
27c781d917 Support settings activity for accessibility shortcut target
Bug: 150277218
Test: atest AccessibilityShortcutInfoTest
Change-Id: I9afc6b2c917b0abe7bb4f5969dd665ba31157c7c
2020-02-27 12:33:26 +08:00
Peter_Liang
01a592bfd1 Remove the public APIs for allow rich content.
1. Mark @hide for "Drawable loadAnimatedImage(Context)" and "String loadHtmlDescription(PackageManager)".
2. Move common function into util.

Bug: 149516547
Bug: 142532186
Test: maunal test
Change-Id: I4f734a496938f64bcde990268e11a2d1a5be4771
Merged-In: I4f734a496938f64bcde990268e11a2d1a5be4771
(cherry picked from commit a2f7f84938)
2020-02-27 04:19:53 +00:00
Peter_Liang
193da54391 Fine-tune the public APIs of allow rich content in Accessibility Settings for security.
1. Add some checkers and java doc:
  - loadHtmlDescription
    It filters the <img> tag which do not meet the custom specification and the <a> tag.
  - loadAnimatedImage
    It checks the resource whether to exceed the screen size.

Bug: 149516547
Test: atest AccessibilityShortcutInfoTest & manual test
Change-Id: I8ecad186fc9e4bb6799ded296805cdc5353c5010
Merged-In: I8ecad186fc9e4bb6799ded296805cdc5353c5010
(cherry picked from commit c6e3836915)
2020-02-25 09:05:12 +00:00
PETER LIANG
cd94c1871e Merge "Revise the parameter of public API for allow rich content." 2020-02-20 20:30:45 +00: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
Peter_Liang
f532a2351b Revise the parameter of public API for allow rich content.
Change "loadAnimatedImage(PackageManager)" to "loadAnimatedImage(Context)"

Bug: 142532186
Test: manual test
Change-Id: I3a6f61fbcd06e73d17cc20ea60effa6e84f0db7b
2020-02-20 02:46:03 +00:00
PETER LIANG
2187f9e855 Merge "Revise the modifier and naming of public APIs for allow rich content." 2020-02-19 23:51:48 +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
Peter_Liang
81332eff4a Revise the modifier and naming of public APIs for allow rich content.
Change "int getAnimatedImageRes()" to "Drawable loadAnimatedImage(PackageManager packageManager)"

Bug: 142532186
Test: atest AccessibilityShortcutInfoTest & manual test
Change-Id: I2583a5c2427449bca68af29a0a40215dd0cb9085
2020-02-19 21:41:10 +08:00
TreeHugger Robot
f348b9f3bf Merge "Increase granularity of gesture dispatch to 60fps" 2020-02-19 13:21:46 +00: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
Robert Berry
a8c7d84013 Increase granularity of gesture dispatch to 60fps
This is essential if AccessibilityService instances want to animate the
gestures being dispatched (e.g., displaying an overlay showing where the
virtual "finger" is moving).

Test: manual
Bug: 149753602
Change-Id: Ic508c6bd8b4cefa052be9adcac749859c382147a
2020-02-18 17:37:30 -05:00
PETER LIANG
c0570cf0a8 Merge "Change the attribute format of htmlDescription." 2020-02-14 08:47:47 +00: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
Peter_Liang
515b989fb8 Change the attribute format of htmlDescription.
After the discussion, shouldn't let developers use the general
string which is non resource id. And only support the resource id string.

Bug: 142532186
Test: manual test
Change-Id: I912effc500c72d2ac83cc344f4e4099f6f469652
2020-02-13 21:08:39 +08:00
Rhed Jao
0132d90b3f Merge "Support rich content for accessibility shortcut target" 2020-02-11 00:18:28 +00:00