Commit Graph

302 Commits

Author SHA1 Message Date
Ameer Armaly
39f4c5967c Un-hide passthrough flag
We added a flag to restore the passthrough for multifinger gestures, but left it hidden for the QPR. It should be made public for S so TalkBack doesn't continue to use non-public APIs.
Fix: 187458811
Test: manual
Change-Id: I02fa6b9e4dacec131aac86adc54386ad7b6249ad
2021-05-13 17:40:49 +00:00
Danny Epstein
aafe4edd98 Allow getComponentName() to be used in tests
Add @TestApi annotation to AccessibilityServiceInfo.getComponentName().

Test: manual
Bug: 169601090
Change-Id: I83f1fdfafd49ec7c625ed2ebad399b15df191dcb
2021-04-12 16:07:53 -07:00
Hongming Jin
c49cac7386 Add trace for AccessibilityInteractionClient callback interfaces.
In an effort to reduce unnecessary String operations and Binder calls
from AccessibilityInteractionClient, also add channels to propagate
tracing state to AccessibilityInteractionClient through
AccessibilityManager.

Bug: 157601519
Test: adb shell cmd accessibility start-trace
      adb shell cmd accessibility stop-trace
Change-Id: Idfe220bc64a9c83679201b9a9a36b1c492f9d6cc
2021-04-02 12:15:14 -07:00
Bernardo Rufino
9b182c69f3 Merge "Add DISMISS_NOTIFICATION_SHADE action for a11y" into sc-dev 2021-03-15 15:39:18 +00:00
Bernardo Rufino
2c458b7cf6 Add DISMISS_NOTIFICATION_SHADE action for a11y
As discussed in b/159334261, although the current a11y use-cases for
closing the notification shade are already handled, it makes sense to
add an explicit global action for accessibility services to close the
notification shade (especially given there is one for opening the shade
already).

Added dependency to SystemActions, which required me to change add
SystemActions to SystemUIGoogleBinder (topic). I also added to
CarSystemUIBinder since SystemActions was also in their xml. I don't
know if I need to add to others (eg. Arc), please advise.

Bug: 159334261
Bug: 159105552
Test: With the shade opened, as a11y service send
      GLOBAL_ACTION_DISMISS_NOTIFICATION_SHADE and verify shade is
      closed.
Change-Id: If52a1763170d5a5efd6b4756794206fd8bfb18a0
2021-03-12 14:57:56 +00:00
ryanlwlin
5e3e603bbf Add a property for the declarition of accessibility purpose
AccessibilityService is a powerful service that could view the content
or control the device. However, some apps using it is not for
accessibility. We would like to add "isAccessibilityTool" property in
the xml to distinguish its purpose.
If the Accessibilityservices is not for users with disabilities,
system would inform the user after enabling for a period of time.

Bug: 176960226
Test: atest CtsAccessibilityTestCases#AccessibilityServiceInfoTest
Change-Id: I91327470ce39a28e701fa6841f9edccc1a92ffe4
2021-03-09 12:16:33 +08:00
Ameer Armaly
bc1a2bdc44 Move Gesture ID 43 from two-finger single tap and hold to two-finger triple tap and hold.
Bug: 178849493
Test: atest AccessibilityGestureDetectorTest

Change-Id: Ibb3826ba2afd2b932d8e1491b601157285f9d67a
2021-02-02 22:22:34 +00:00
Treehugger Robot
ea8b0e9eb8 Merge "Make me an owner of accessibility frameworks" am: f79a0fd564 am: b8ec02815b am: d65928539b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553965

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I505c172ee9d683a56abf517a14e31534b58d784c
2021-01-19 22:57:32 +00:00
Treehugger Robot
d65928539b Merge "Make me an owner of accessibility frameworks" am: f79a0fd564 am: b8ec02815b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553965

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic7d1237a3f2b08f6ce6017e29b189f1331b61bba
2021-01-19 22:43:42 +00:00
ryanlwlin
528811e0ef Make me an owner of accessibility frameworks
Test: Relying on treehugger. No functional changes.
Change-Id: Icc51b1b4e752289db1cbf24c2cd8e08a939fefec
2021-01-19 12:49:01 +08:00
Ameer Armaly
aac39ed526 Merge "Make AccessibilityGestureEvent.gestureIdToString public." 2020-12-23 21:21:39 +00:00
Ameer Armaly
97270e803d Make AccessibilityGestureEvent.gestureIdToString public.
This allows for better error reporting in tests and services.
Bug: 159651900
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest

Change-Id: Ic65ff7100ade77bbf26d538a033e9e000e6b9bcc
2020-12-22 20:15:45 +00:00
Jacky Kao
ad119d9a78 Keep changed focus data after service disable
Since in reality only one service at a time (and maybe ever) will care
about these focus data, letting services change these parameters and
leaving it alone even that service is disable.

Bug: 175732114
Test: a11y CTS & unit tests
Change-Id: Ic1f9d29c35ebccbabb6b35b9f113920b992af0df
2020-12-22 08:37:30 +08:00
Jacky Kao
9e73bfc2f3 Allow A11yService to customize accessibility focus
1. Define and implement new APIs to set and get the stroke width
and color of the A11y focus rectangle.
2. New an AccessibilityFocusApperanceData variable with the default
value in the A11yUserState class, and it would be used in the A11y
framework.
3. When A11y services sets the stroke width and color of the focus
rectangle, A11yUserState will apply the same value through
A11yServiceConnection and notify this change to A11yManager.
4. When A11y services customized the data is disabled, reseting the
data in the A11yUserState and notifying this change to A11yManager.
5. When the ViewRootImpl gets the A11yFocusDrawable, it changes the
strokewidth and the color of this drawable based on the value from
A11yManager.

Bug: 141144573
Test: a11y CTS & unit tests

Change-Id: I1493f17f7cc25744e1435c9070218c6f7efa8bcf
2020-12-04 09:55:11 +08:00
Ameer Armaly
fbab59f523 Stop setting flag to enable two-finger passthrough swipes.
Bug: 162521649
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: I7718ac2ae86d46aa05d45a1ac3abc556e000e39d
(cherry picked from commit 0295f94356)
2020-11-19 13:00:46 -08:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Mathew Inwood
5f0edaaaf5 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I8285daa8530260251ecad6f3f38f98e263629ca7
Change-Id: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
2020-11-02 10:30:09 +00:00
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Ameer Armaly
b6fafa6052 Add API to record touch interactions.
Bug: 159651900
Test: manually enable the flag and turn on debugging. Observe motion events being dispatched as part of the AccessibilityGestureEvent.
Change-Id: Ia27dcfd3b3fe0af423d9b10054ba69a6914e0f78
2020-10-21 00:00:30 +00:00
Roman Kalukiewicz
24403f7ef2 Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00
Ameer Armaly
0295f94356 [DO NOT MERGE ] Stop setting flag to enable two-finger passthrough swipes.
Bug: 162521649
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: I7718ac2ae86d46aa05d45a1ac3abc556e000e39d
2020-10-13 20:27:26 +00:00
Ameer Armaly
abfaf269a9 [DO NOT MERGE] Enable two-finger passthrough swipes.
Bug: 162521649
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: I9e6b691295a0fa006578d7b8ad8468579c66939c
2020-10-11 08:04:42 -07:00
Ameer Armaly
ba854db8c5 Add gesture ids 43-45.
GESTURE_2_FINGER_SINGLE_TAP_AND_HOLD = 43
GESTURE_3_FINGER_SINGLE_TAP_AND_HOLD = 44
GESTURE_3_FINGER_TRIPLE_TAP_AND_HOLD = 45

Bug: 169189474
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: Icaed2bbfcea35d42bf3fdf0cee9bfdf8ac819438
2020-10-01 14:08:08 -07:00
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