Commit Graph

1147 Commits

Author SHA1 Message Date
Daniel Norman
0e2e7033f0 Merge changes from topic "a11y-motion"
* changes:
  Introduce AccessibilityService#onMotionEvent()
  Add a new @TestApi to inject InputEvents to the input filter.
2022-12-03 04:49:34 +00:00
Daniel Norman
a766c12eda Introduce AccessibilityService#onMotionEvent()
This API allows accessibility services to intercept motions events, to
expand device control capabilities to more types of input devices
such as watch rotary wheels and gamepad joysticks.

Unlike KeyEvents which are optionally consumed, for MotionEvents the
service must declare the event sources it wishes to consume and then
events from these sources are *always* consumed. The source list can be
changed by the service at runtime. By always consuming the requested
events we avoid the potential "wait and see" latency concerns that
onKeyEvent deals with.

Bug: 247550565
Test: atest AccessibilityEndtoEndTest
Test: use in an a11yservice to observe joystick events
Change-Id: Iea54b00b21f5348f50d94d6e2213df24c0c8a36a
2022-12-02 12:29:40 -08:00
Daniel Norman
83e20e8637 Add a new @TestApi to inject InputEvents to the input filter.
This is used by end-to-end tests exercising the input filter for generic
motion events.

Bug: 247550565
Test: atest AccessibilityEndToEndTest, using the dependent change topic
Change-Id: I2695ecb3919d8336dc3f6df1a525a53d84c03fec
2022-12-02 11:30:28 -08:00
Sally Yuen
77eb98c8ac Merge "Expose more SystemAPI methods on AccessibilityDisplayProxy" 2022-11-29 16:36:27 +00:00
sallyyuen
111ef0b932 Expose more SystemAPI methods on AccessibilityDisplayProxy
These are:
- onProxyConnected (equivalent to onServiceConnected)
- onAccessibilityEvent
- onInterrupt
- getWindows
- set/getInstalledAndEnabledServices

Connect the proxy client (IAccessibilityServiceClient) to a
proxy service connection
(ProxyAbstractAccessibilityServiceConnection) in ProxyManager,
so the A11yDisplayProxy can access the UI.

AccessibilityServices run on their own thread. To avoid using the
app's main thread, the app that registers the A11yDisplayProxy
can call it on a different thread. Add a note in the proxy class.

Future TODOs (b/254545943):

The a11y state returned to A11yManager includes state
of all proxies and AccessibilityServices.
Separation will require AccessibiilityManager to go from being a
process singleton to a per-display instance.

Input and a11y focus are singletons and may
shift between a proxy display and a display on the device.
Separation will require future changes.

ProxyManager behaves more like UiAutomationManager,
and centralizes proxy management. Separation into different user
states will require future refactoring.

Bug: 241429275
Test: atest AccessibilityDisplayProxyTest,
AccessibilityManagerServiceTest, manual test app that
registers/unregisters A11yDisplayProxy

Change-Id: I830c6613c2c2f8abcc2343c5110f4e7b7494fb0e
2022-11-28 13:07:14 -08:00
Ameer Armaly
3a8b193246 Create display accessibility overlay API.
Bug: 238840614
Test: atest AccessibilityOverlayTest
Change-Id: I90a6dfb9c27f67f49ca61c99bc6063d905154a86
2022-11-15 16:56:36 +00:00
Daniel Norman
32afd29346 Introduce A11yService#takeScreenshotOfWindow()
This enables accessibility services to take a screenshot of
a window without any overlay windows drawn on top, which is
beneficial for ML-based understanding of the visual content
in the window.

Bug: 249830826
Test: atest AccessibilityTakeScreenshotTest
Test: use in an a11y service, observe screenshots
      contain only content from the requested windows
      and no overlays
Change-Id: Ic886aeace9cb2984a472273858281b4f2c3a0e46
2022-11-11 18:07:10 +00:00
Sally Yuen
fa16d9b083 Merge "Add AccessibilityDisplayProxy and register/unregister methods" 2022-11-01 19:38:20 +00:00
sallyyuen
d86f7e729b Add AccessibilityDisplayProxy and register/unregister methods
An A11yDisplayProxy will be used by Exo to listen to UI changes and
perform actions on the UI.

For a Display that is shown on a ChromeBook/client device,
a privileged app like Exo, or an app with SystemAPI privileges and
the MANAGE_ACCESSIBILITY permission, should call
A11yManager.registerA11yProxy and A11yManager.unRegisterA11yProxy to
enable/disable a11y.

The app will only have visibility in the specified proxy display.

Currently only few A11yProxy methods are exposed. When the proxy is
plugged into the system via ProxyAccessibilityServiceConnection
other methods will be exposed. (See link in comments)

Bug: 241429275
Test: atest A11yProxyTest(cts), atest A11yManagerTest(unit)
Change-Id: I019732e50e6beba0af7f5898a07b44d25e03416b
2022-10-26 15:12:54 -07:00
Ameer Armaly
aafcd5c884 AccessibilityInputFilter: retain service gesture detection state when rebuilding.
Otherwise, as soon as we rebuild the input filter e.g. enable magnification, service gesture detection gets turned off.

Bug: 243487199
Test: atest TouchInteractionControllerTest
Change-Id: Ifdfaffd2ff2addc7a4dd7d69cf6128947efdacea
2022-10-25 20:51:57 +00:00
TreeHugger Robot
e05e9da6bb Merge "Remove disabled a11yservices from the binding services list." 2022-10-24 18:10:45 +00:00
Daniel Norman
3a5a791dfe Remove disabled a11yservices from the binding services list.
This could cause race conditions if a service connection is exited after
starting binding but before finishing binding.
If the service is mid-initialization when it gets disabled then there is
already logic to prevent full initialization and to exit the connection.

Bug: 252884894
Test: atest AccessibilityPrivacySourceTest --iterations 30
Change-Id: Ib5aa761bb4c9189df53d04d7dc5329aece650141
2022-10-21 12:17:04 -07:00
Daniel Norman
ddc6e2ca3a Merge "Disable all A11yServices from an uninstalled package." into rvc-dev am: e6d10db58e am: 9e3a6a622a am: 994e8238bf am: 6f79c2effa am: f75b18a23e am: 3e56f76fa2 am: e411ff2cef
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20123964

Change-Id: Idaddd5120f7070b8047bdf3d758b87615f20b9c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-17 23:10:30 +00:00
Daniel Norman
3e56f76fa2 Merge "Disable all A11yServices from an uninstalled package." into rvc-dev am: e6d10db58e am: 9e3a6a622a am: 994e8238bf am: 6f79c2effa am: f75b18a23e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20123964

Change-Id: I4673501e0ecb092baac388c1281ebd6b07de88a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-17 22:06:47 +00:00
Daniel Norman
f75b18a23e Merge "Disable all A11yServices from an uninstalled package." into rvc-dev am: e6d10db58e am: 9e3a6a622a am: 994e8238bf am: 6f79c2effa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20123964

Change-Id: Iacfa5277d2310c7fd0bb2106f63696a8783cbac3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-17 21:39:52 +00:00
Daniel Norman
994e8238bf Merge "Disable all A11yServices from an uninstalled package." into rvc-dev am: e6d10db58e am: 9e3a6a622a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20123964

Change-Id: I0696a78491bc4c31995f64e988ec6407b06871d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-17 20:36:33 +00:00
sallyyuen
a4f4a831d6 [EXO] Create a service connection for proxies
A proxy will give a privileged app access to a11y data typically available to AccessibilityServices. (Refer to the design doc linked in the comments for more information.)

A proxy will easily be able to set modify a list of service infos
depending on what a11y services/features are running on the client
device.

Introduce the system connection for a proxy:

- The service connection needs to maintain a single info that
represents this proxy-supplied list, so merge list values.

- Populate properties for each listed info that are default populated
for services installed on the device. This will prevent exceptions if
an app accesses these properties.

- Make setAccessibilityTool a SystemAPI, so a proxy can set this if it
needs to, since it cannot set this before runtime.

Test: builds, atest ProxyAccessibilityServiceConnectionTest
Bug: 241429275
Change-Id: Id99e2fa08be567738751d7a9a84f0014279924a1
2022-10-17 20:16:28 +00:00
Daniel Norman
9e3a6a622a Merge "Disable all A11yServices from an uninstalled package." into rvc-dev am: e6d10db58e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20123964

Change-Id: I81f0c31df2d07a2f1b9a8747bb06640e167871df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-17 20:07:33 +00:00
Sally Yuen
4c547e7645 Merge "[EXO] Add aidl methods for registering and unregistering a proxy" 2022-10-07 20:37:32 +00:00
Sally Yuen
260a7285ba Merge "[EXO] Add aidl methods to set installed and enabled a11y services" 2022-10-07 20:36:48 +00:00
Daniel Norman
e1f343acde Disable all A11yServices from an uninstalled package.
Previous logic would exit the loop after removing the first service
matching the uninstalled package.

Bug: 243378132
Test: atest AccessibilityEndToEndTest
Test: m sts;
      sts-tradefed run sts-dynamic-develop -m \
        CtsAccessibilityServiceTestCases
Change-Id: I4ba30345d8600674ee8a9ea3ff411aecbf3655a3
2022-10-07 19:20:34 +00:00
sallyyuen
ab5975c6af [EXO] Add aidl methods for registering and unregistering a proxy
- Implement register/unregisterProxy minimally. These are mostly
  validity checks. Future CLs will expose the SystemAPI methods on
  A11yManager so an app can call through to these.
- Introduce a ProxyManager skeleton. This will be populated and tested
  in future CLs.

Bug: 241429275
Test: builds, atest AccessibilityManagerServiceTest

Change-Id: Idebf46590b5a129381a34496de67ed18d43369ed
2022-10-07 09:44:33 -07:00
Anna Galusza
0f08a15142 Merge "Revert "Create a new input filter to handle touch input for Software Cursor. Logic will be added in follow-up CLs. Software Cursor is a new accessibility feature that enables the user to control an on-screen mouse using swipes and taps on the touch screen."" 2022-10-07 02:40:53 +00:00
Anna Galusza
77da1c0e34 Revert "Create a new input filter to handle touch input for Software Cursor. Logic will be added in follow-up CLs. Software Cursor is a new accessibility feature that enables the user to control an on-screen mouse using swipes and taps on the touch screen."
This reverts commit 5d163960ab.

Reason for revert: Software Cursor will not launch in Android U

Change-Id: I7e97905ff5490e458209fe0bcfb0ebbcd8415fdd
2022-10-06 23:19:57 +00:00
sallyyuen
4496d8d5c3 [EXO] Add aidl methods to set installed and enabled a11y services
This will simplify the management of active a11y services when dealing
with proxies.

Test: builds
Bug: 241429275

Change-Id: I6785b9bea218946e95941453d637198bb0230a78
2022-10-05 12:28:36 -07:00
Yohei Yukawa
1dd7a06383 Add AccessibilityManagerInternal#isTouchExplorationEnabled()
This is a follow up CL to our previous CL [1], which added a
method invocation of

  AccessibilityManager#isTouchExplorationEnabled()

from InputMethodManagerService.  The issue is that it is not clear
about which user we are querying.  In order to avoid future
confusions, it would make much more sense if we have a more dedicated
internal method in AccessibilityManagerInternal as we planned.

Bug: 207007377
Fix: 219056452
Test: presubmit
Change-Id: I99a1b6706c51709e82ca31449753b35919e7247c
2022-10-03 18:04:31 -07:00
Daniel Norman
fda797c958 Adds more OWNERS to a11y FW dirs. am: b6dc971384 am: 4292755d27 am: 2325eb5313 am: e9dd122ce4 am: ce09a229dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2234907

Change-Id: I2c582e4fe76438d51e99a0b2b1f22319badce3f2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 21:48:59 +00:00
Daniel Norman
ce09a229dd Adds more OWNERS to a11y FW dirs. am: b6dc971384 am: 4292755d27 am: 2325eb5313 am: e9dd122ce4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2234907

Change-Id: I005464c49af46492ee791c3068ec1e21cdaea18f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 21:18:45 +00:00
Daniel Norman
2325eb5313 Adds more OWNERS to a11y FW dirs. am: b6dc971384 am: 4292755d27
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2234907

Change-Id: I9a70dc471223f0cd68bfeaeecdb6c0b6ac033efa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 19:43:37 +00:00
Daniel Norman
4292755d27 Adds more OWNERS to a11y FW dirs. am: b6dc971384
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2234907

Change-Id: I1bb6e091fa3c14b8e8f52f5da2e986ebd129570f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 19:04:04 +00:00
Automerger Merge Worker
ab6fa94619 Merge "Merge "Stops updating A11yUserState on ACTION_USER_PRESENT." am: f38f9ca575 am: 7ba78da385 am: 10e870c773" into tm-d1-dev-plus-aosp am: bd5a58afb8 am: 9b2f48141b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2232548

Change-Id: I6489fcf2ba4b1ee1d5bde89cb62cac4c8703a748
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-28 19:12:55 +00:00
Automerger Merge Worker
9b2f48141b Merge "Merge "Stops updating A11yUserState on ACTION_USER_PRESENT." am: f38f9ca575 am: 7ba78da385 am: 10e870c773" into tm-d1-dev-plus-aosp am: bd5a58afb8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2232548

Change-Id: I4f86ca428dbf28c18a1d3acc8f0e00f178167579
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-28 18:51:27 +00:00
Daniel Norman
10e870c773 Merge "Stops updating A11yUserState on ACTION_USER_PRESENT." am: f38f9ca575 am: 7ba78da385
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2232548

Change-Id: I854f49866ec379ff83c5d52311a1f5fac8c3051b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-28 17:33:55 +00:00
Daniel Norman
b6dc971384 Adds more OWNERS to a11y FW dirs.
Bug: n/a
Test: n/a
Change-Id: I1331e89caf4942d2118e644ed3f9710daa66be95
2022-09-28 09:15:49 -07:00
Daniel Norman
5a041e439e Stops updating A11yUserState on ACTION_USER_PRESENT.
This was useful when the A11yUserState was temporarily modified
while the keyguard was on. However, ever since the a11y gesture
from commit 106fe73205
the A11yUserState is no longer temporarily modified this way.

Bug: 247045101
Test: a11y presubmit tests
Change-Id: I6fde21fe84cea3cae5f0dfa86fcd811a22542cc5
2022-09-27 23:19:04 +00:00
Daniel Norman
d4c1132482 Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev am: 6505ed1695 am: 7588fa6866 am: 10c659e317 am: 73089d0c3a am: 18628f192f am: cf886522f8 am: 70f81ff108 am: ef85e63542 am: d5d9652c4e am: ea127ffb59
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19815423

Change-Id: I9705924e02c5945f1df3cba0e7f8845601298281
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-19 22:47:49 +00:00
Daniel Norman
ea127ffb59 Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev am: 6505ed1695 am: 7588fa6866 am: 10c659e317 am: 73089d0c3a am: 18628f192f am: cf886522f8 am: 70f81ff108 am: ef85e63542 am: d5d9652c4e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19815423

Change-Id: I944e505d87b6f1ef2358fedd607935197bbbcc68
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-19 22:08:45 +00:00
Daniel Norman
3aba2351fc Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev am: 6505ed1695 am: 7588fa6866 am: 10c659e317 am: 73089d0c3a am: 18628f192f am: cf886522f8 am: 70f81ff108 am: ef85e63542 am: 9429727ee3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19815423

Change-Id: I2f50e818228b66ddb0516530d8c8c10854e3a226
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-19 22:08:24 +00:00
Daniel Norman
0ac6337d21 Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev am: 6505ed1695 am: 7588fa6866 am: 10c659e317 am: 73089d0c3a am: 18628f192f am: cf886522f8 am: 70f81ff108 am: ef85e63542
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19815423

Change-Id: Ia2dd5dda431493505e07438238fa6b5490d9632e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-19 21:38:20 +00:00
Daniel Norman
ef85e63542 Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev am: 6505ed1695 am: 7588fa6866 am: 10c659e317 am: 73089d0c3a am: 18628f192f am: cf886522f8 am: 70f81ff108
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19815423

Change-Id: Idd1ba2a33d452de717742cd3bc068af775b7baa8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-19 21:10:25 +00:00
Daniel Norman
70f81ff108 Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev am: 6505ed1695 am: 7588fa6866 am: 10c659e317 am: 73089d0c3a am: 18628f192f am: cf886522f8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19815423

Change-Id: I94dd2597a8504959f47822a101abe2aa514cd979
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-19 20:45:38 +00:00
Daniel Norman
18628f192f Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev am: 6505ed1695 am: 7588fa6866 am: 10c659e317 am: 73089d0c3a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19815423

Change-Id: I7c652c1b5920bd5a226ec4f987f4d38dbbc60f1a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-19 19:50:57 +00:00
Daniel Norman
73089d0c3a Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev am: 6505ed1695 am: 7588fa6866 am: 10c659e317
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19815423

Change-Id: I9f9dca5eccac9bc82357e1322b3d3534a86e6ac0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-19 19:21:10 +00:00
Daniel Norman
10c659e317 Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev am: 6505ed1695 am: 7588fa6866
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19815423

Change-Id: I7e0febed51091e07af6be4157d081c837a719589
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-19 18:43:22 +00:00
Daniel Norman
7588fa6866 Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev am: 6505ed1695
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19815423

Change-Id: Ia708dba5893575578ae7a383dd823a3726b5aab4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-19 18:18:04 +00:00
Chavi Weingarten
2b7f2aee30 Migrate screen capture code to ScreenCapture file
Test: ScreenshotTests
Bug: 242714168
Change-Id: I8061f1717cc4e293ee07672d6d415c2c36010ccd
2022-09-14 15:35:46 +00:00
TreeHugger Robot
7b1c680e16 Merge "Populate display id in A11yWindowManager" 2022-09-08 08:56:55 +00:00
Hiroki Sato
58b04e9947 Populate display id in A11yWindowManager
When window is removed, there can be a race between a11y and wm,
and sometimes A11yManagerService#sendA11yEvent cannot get a correct
display id.

There's also a case where a11y events for windowless windows don't have
a display id.

This change fixes the issue by populating display id in
A11yWindowManager#DisplayWindowsObserver for windows change events.

Bug: 240888087
Test: AccessibilityWindowManagerTest
Test: CtsAccessibilityServiceTestCases

Change-Id: I441d98e4431913ae24ab354423828d2a031b27b4
2022-09-08 15:11:45 +09:00
Daniel Norman
2bc4d49c2b Include all enabled services when FEEDBACK_ALL_MASK.
Bug: 243849844
Test: m sts;
      sts-tradefed run sts-dynamic-develop -m CtsAccessibilityTestCases
Change-Id: I4f93e06d1066085bd64e8f09882de2f4a72a0633
2022-09-01 20:17:54 +00:00
Anna Galusza
2b0a65c5ed Merge "Create a new input filter to handle touch input for Software Cursor. Logic will be added in follow-up CLs. Software Cursor is a new accessibility feature that enables the user to control an on-screen mouse using swipes and taps on the touch screen." 2022-09-01 18:14:00 +00:00