Commit Graph

1027 Commits

Author SHA1 Message Date
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
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
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
Cole Faust
9b3a5fc03b Merge "Fix array-related errorprone warnings" am: a1eb8cf128 am: 44f8576073 am: 91d6c5b564 am: 6a79ae2567
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2186016

Change-Id: I7052a1f7391ed6701fe0e1036c27368609032e35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-30 20:44:00 +00:00
Cole Faust
584140c83a Fix array-related errorprone warnings
The ArrayEquals, ArrayHashCode, ArrayToString, and
ArraysAsListPrimitiveArray errorprone findings were
demoted from errors to warnings. Fix existing
occurrences of them so they can be made errors again.

Bug: 242630963
Test: RUN_ERROR_PRONE=true m javac-check
Change-Id: Ia6f216cc36ad0a5758f39fd9b34962cd4adf9d8e
2022-08-25 10:57:12 -07:00
Daniel Hsieh
22783d8314 Logs the activated session duration for magnification. (2/2)
Uses the atom MagnificationFollowTypingFocusActivatedSessionReported in
westworld to log the activated session duration for the window magnifier
which its following typing focus is enabled.

The duration is accumulated by the time when the window magnifier and
the ime are all on. If one of them is off, we would pause the
accumulated timer. If a user moves the window magnifier to disables
this function, we would stop the accumulated timer and log the duration.

Bug: 216733714
Test: m statsd_testdrive & statsd_testdrive 453
      atest WindowMagnificationManagerTest
Change-Id: I994fc2a3ada8a90fde8b3a0b4f1cc8d7ec21638a
Merged-In: I994fc2a3ada8a90fde8b3a0b4f1cc8d7ec21638a
2022-08-19 06:39:59 +00:00
TreeHugger Robot
620e37edb9 Merge "Logs the activated session duration for magnification. (1/2)" into tm-qpr-dev 2022-08-19 00:32:18 +00:00
Daniel Hsieh
5b5226eb81 Logs the activated session duration for magnification. (1/2)
Uses the atom MagnificationTripleTapAndHoldActivatedSessionReported in
westworld to log the activated session duration for the window magnifier
which is triggered by the triple-tap-and-hold gesture.

The duration is from the window magnifier's enabled time to its disabled
time.

Bug: 216733714
Test: atest WindowMagnificationGestureHandlerTest
      m statsd_testdrive & statsd_testdrive 452
Change-Id: I423ac39c167c89b0b2db931a616cdd34d6eb151c
Merged-In: I423ac39c167c89b0b2db931a616cdd34d6eb151c
2022-08-18 18:31:16 +00:00
Mark Renouf
693478bd52 Code cleanup of ScreenshotRequest and usages
Make constructor visible for tests
Make all fields final (no setters, so already effectively final)
Remove mHasStatusBar and mHasNavBar (unused)
Remove overload 'takeScreenshot' method without a source param
Added missing @IntDef annotations to parameters

Bug: 231957192
Test: atest ScreenshotHelperTest SystemActionPerformerTest
Change-Id: Ief43bd0ba50dafac720ae18d00c3c99b8d31e2e1
2022-08-01 18:14:33 +00:00
Tyler Freeman
f7dcf990fd fix(magnification): don't crash when reciving unexpected motion events.
This fixes an issue where the device was crashing and rebooting when
triple tapping to activate magnification at the same time as covering
the proxmity sensor while on a voice call.

Bug: b/236875528

Test: manual:
1. Perform a voice call
2. While on voice call, execute the "Triple tap on screen" gesture,
holding down your finger on the last tap and then cover the proximity
sensor.
3. The device should not crash

Change-Id: I9415c5b378b32342c016b17dfcef12cde45ce237
2022-07-01 18:28:13 +00:00
Daniel Hsieh
6c00049c6c Merge "Gets node bound when the FLAG_RETRIEVE_INTERACTIVE_WINDOWS is unset" into tm-dev 2022-05-07 03:45:41 +00:00
Daniel Hsieh
81f7e655e5 Gets node bound when the FLAG_RETRIEVE_INTERACTIVE_WINDOWS is unset
Since the WindowInfo is null if the FLAG_RETRIEVE_INTERACTIVE_WINDOWS is
unset, we would fail to calculate the node bound correctly.

The reason behind this failure is that the accessibility framework only
tracks windows when the FLAG_RETRIEVE_INTERACTIVE_WINDOWS is set.

As being a short term solution, we could retrieve the transformation matrix
and magnification spec from WindowState, making us have this CL.

However, as a long term solution, we should keep tracking WindowInfo in
DisplayWindowsObserver whether the flag is set or unset and mitigate the
additional system overhead.

Bug: 229379635
Test: atest android.accessibilityservice.cts
      atest com.android.server.accessibility
      We use a test apk to test the node bound value when the flag is
      unset equals to the value from WindowInfo when the flag is set.
Change-Id: I02e7e74d027dc65605f5e8fcc10d3c808e316476
2022-05-06 08:33:11 +00:00
Ryan Lin
a7f5aa5be7 Merge "Fix invalid active window if accessibility framework doesn't track windows" into tm-dev 2022-05-04 02:56:26 +00:00
ryanlwlin
4339880c1e Fix invalid active window if accessibility framework doesn't track
windows

If accessibility framework doesn't track windows, the active window
is updated when receving window_state_changed event. ViewRootImpl
sends this event when performing traversal first time, however the
focused window token is not updated yet from InputManagerService.
To fix the regression issue, we fallback to the legacy approach for
short term solution.

Test: atest android.accessibilityservice.cts
Bug: 228442331
Change-Id: I032a73b9f4cf408a5dd6cae8a87bd26131ebdbfa
2022-04-29 15:12:47 +08:00
ryanlwlin
57a1da433a Postpone window_state_changed events until the window is added
ViewRootImpl sends window_state_changed event to notify
AccessibilityService that itself is visible on the screen. However,
the corresponding window is not available from accessibility framework
perspective because the window information is from SurfaceFlinger process
now, so the window is added only when it is really visible on the screen.

To ensure accessibilityService could get the node or the window when
receiving this event, we postpone this event until the corresponding
window is added. We also set a timeout to send those pending events.

Bug: 228442331
Bug: 226371995
Test: atest CtsAccessibilityServiceTestCases
      manual test: write a sample AccessibilityService to test the apis
      when receving window_state_changed events
Change-Id: I92cf2ddb9de90c050cf145f746a53f31d3a5df83
2022-04-29 14:53:56 +08:00
Yohei Yukawa
c60176c1f3 Let A11yIME use its own IPC definitions
This is a follow up CL to our previuos CL [1], which enabled
AccessibilityService to use a subset of InputConnection APIs.

In that CL we have reused existing AIDL interfaces that were designed
and maintained for IMEs for simplicity, where a non trivial amount of
unnecessary IPC endpoints were included.

From the security and maintainability viewpoints, however, exposing
unnecessary IPC endpoints is discouraged in general.  To address such
concerns this CL introduces a set of dedicated IPC definitions for
A11yIME so that we do not need to reuse IPCs for IMEs.

This CL also stops passing InputBinding object to A11yIME process as
it contains IInputContext Binder Proxy, which can still be used to
directly invoke fallback InputConnection.  This is doable now because
A11yIME no longer relies on fallback InputConnection [2].

This CL is should not have any observable changes in the semantics.
End-to-end CTS tests guarantee that everything is still working as
intended now and in the future.

 [1]: Ia651a811093a939d00c081be1961e24ed3ad0356
      fb17e5ae7a
 [2]: I2af3cd50444d8ddf25aa0f6479238156914e6fff
      dc635efb68

Fix: 215633021
Fix: 215636776
Test: atest CtsInputMethodTestCases:AccessibilityInputMethodTest
Test: atest CtsAccessibilityServiceTestCases:AccessibilityInputConnectionTest
Test: atest CtsAccessibilityServiceTestCases:AccessibilityImeTest
Change-Id: I5ff2e804cbcf90828370a0612ff54111130bdff4
2022-04-18 08:59:44 -07:00
Ryan Lin
565d2b1b85 Merge changes from topic "nodebounds" into tm-dev
* changes:
  remove embeddedMatrix usage for PIP menu
  Change node bounds procedure based on SufaceFlinger Callback
2022-04-14 01:55:04 +00:00
ryanlwlin
7bdc82af7c Change node bounds procedure based on SufaceFlinger Callback
The attachInfo from ViewRootImpl is not reliable
for DisplayArea manipulation or windowless window.

To fix this problem, we use the transform matrix of
InputWindowHandle, which could transform the bounds
from window coorindate to screen coordinate. We also
transfrom the bounds to logical display coordinates
with the associated display matrix.

Besides, we also record the magnification spec of the window,
which could get the bounds before magnification. We use
this value to decide the property 'visibleToUser'.

Bug: 200797785
Test: atest android.accessibilityservice.cts WindowInfoTest
      atest com.android.server.accessibility
Change-Id: I0917b04fe8b027fb2bd932a6f0604ba1449ebc66
2022-04-12 22:24:21 +08:00
Minche Li
b26d2ae80b Merge "Notifies magnification change for the transitioning target mode" into tm-dev 2022-04-12 01:10:41 +00:00
mincheli
d560a73ca9 Notifies magnification change for the transitioning target mode
When the magnification settings mode or config mode transitions,
MagnificationController would
1. Disables the current magnification mode. Then
2. Starts to enable the target magnification mode.

To prevent the magnification change callback send twice during the
mode transition, MagnificationController should only notify the
change of the transitioning target mode and ignore the notifcation
change for the disabling magnification mode.

And when WindowMagnification resets or disables by
WindowMagnificationController#deleteWindowMagnification(),
it should notify source bounds empty when magnification is deleted.

And when FullscreenMagnification resets and the animator is animating,
FullScreenMagnificationController should notify magnification
change.

Bug: 209701404
Bug: 210636326
Test: atest AccessibilityMagnificationTest,
    atest WindowMagnificationControllerTest,
    atest com.android.server.accessibility.magnification
Change-Id: Ief718614d80177a4a076eddc708a7ecfc4dfb73f
2022-04-11 08:54:53 +00:00
Ryan Lin
545ce7554b Merge "Eanble sending non-A11yTool notification dyanmically" into tm-dev 2022-04-11 04:34:50 +00:00
Ameer Armaly
7cb26674cc TouchExplorer: allow service to initiate touch exploration and there are no pointers on the screen
We need to be able to initiate touch exploration even if there are no pointers on the screen in order to reliably cover the case where a user just taps the screen.
The user expects to hear if they have tapped on anything.
Bug: 223673301
Test: manual. Tap on the screen and confirm that talkback reads the item in that position.

Change-Id: Id96fa8bd7f000ea153f45024e06915a43ca80826
2022-04-08 13:43:31 -07:00
ryanlwlin
1e14c67b0f Eanble sending non-A11yTool notification dyanmically
non-A11yTool notification is going to be integranted
in PermissionController. We will stop secheduling intent
and sending notification if the safety center is enabled, and
reschedule the intents for none-Accessibility servicewhen the
flag is flipped to true.

Bug: 221369374
Test: atest AccessibilitySecurityPolicyTest
      atest PolicyWarningUIControllerTest
      manual test
Change-Id: I5ab46da053e5ded5422ac932ca3de969c89b8c21
2022-04-08 17:05:57 +08:00
Daniel Hsieh
b26c4316cb Supports multiple-display on activated mode recording.
In previous, we only use a variable to record the state of magnification
mode. Therefore, it would be confused when there are multiple displays.

Now, we use sparse array to keep the state of current magnification mode
and last magnification activated modes with corresponding displayId,
making us have ability to distinguish different modes in different
displayId.

Bug: 182227245
Test: atest MagnificationControllerTest
      atest MagnificationProcessorTest
      atest FullScreenMagnificationGestureHandlerTest
      atest MagnificationConfigTest
Change-Id: I239faab22bb6abe3e6cadde9b09eba496c4688c0
2022-04-07 08:17:35 +00:00
Jacky Kao
6f4f706150 Don't allow an external service to be an A11y service
When some applications create an external service and register this service
to be an A11y service, then this service can kill the system and restart
it continuously.
This is a security vulnerability and we add not allow an external service
to register as an A11y service to fix it.

Bug: 216115176
Test: a11y CTS & unit tests
Change-Id: If75b9c300df73e98be92d6c14d69301cc377b205
2022-03-31 06:23:13 +00:00
Ameer Armaly
2a7ab6e857 Service Gesture Detection: copy motion events when sending to the service.
Sending without copying causes some motion events to get duplicated in the service's motion event stream.
Fix: 223674686
Bug: 223673301
Test: Manual. Perform three-finger swipes and insure they work as expected.

Change-Id: Ie94ef06605902f2b3be5fb426511d5c80cf1ac09
2022-03-25 10:42:33 -07:00
Sally Yuen
017c695c8c Merge "Use volatile keyword instead of lock" into tm-dev 2022-03-25 16:27:09 +00:00
Minche Li
e4b18075e2 Merge "Fallback magnification mode settings if window magnification feature is not supported" into tm-dev 2022-03-25 02:24:01 +00:00
Sally
5660d2e7ee Use volatile keyword instead of lock
The tracing check can cause lock contention

Bug: 225403116
Test: Builds
Change-Id: I75cc4b88acf9917485dbd9ebe122b103bd245ac9
2022-03-24 16:07:36 +00:00
Ameer Armaly
c21d842c1a Service Gesture Detection: don't lock when executing double tap in the framework.
Only lock when obtaining the input filter to avoid deadlock when bringing up talkback settings.
Fix:223673816
Test: Manual. Bring up talkback settings and insure that there is no ten second wait.

Change-Id: Ic26a3a08a7c67b096a7995332e3ed5096fde4847
2022-03-24 14:59:24 +00:00
mincheli
bbbbc3660f Fallback magnification mode settings if window magnification feature is not supported
When the platform does not support window magnification feature,
AccessibilityManagerService should fallback magnification mode
settings if the magnification mode of userState is window mode
that is invalid.

Bug: 213414385
Test: manual test
Change-Id: I810131f7b1925b6b010c21d822b521d29ee3a646
2022-03-24 22:15:44 +08:00
Ameer Armaly
f26d0418b0 Merge "TouchExplorer: do not crash when the user lifts a finger while dragging." into tm-dev 2022-03-22 17:06:19 +00:00
Ryan Lin
55eb3067b2 Merge "Revert "Adds install source checks for accessibility service"" into tm-dev 2022-03-22 01:30:39 +00:00
Ryan Lin
44b2ae6375 Merge "Transfrom connectionState to string" into tm-dev 2022-03-21 06:19:29 +00:00
TreeHugger Robot
44738ca8a0 Merge "Makes GesturesObserver#clear as a private method." into tm-dev 2022-03-19 02:10:25 +00:00
Yinglei Wang
da6d14b9e9 Merge "resolve possible Imf lock and a11y mLock deadlock" into tm-dev 2022-03-18 17:54:30 +00:00
Daniel Hsieh
bf250af771 Makes GesturesObserver#clear as a private method.
In the previous version, GesturesObserver#clear would be called by
MagnificationGesturesObserver, making the matchers' state be clear by
outside class. It would make the matchers' state not consistency in
GesturesObserver#onMotionEvent. Especially, when the matcher is
completed and becomes STATE_GESTURE_COMPLETED, it would be clear as
STATE_CLEAR by MagnificationGesturesObserver#clear which would trigger
GesturesObserver#clear. It would make the GesturesObserver keep going to
check other matchers since matcher.getState() !=
GestureMatcher.STATE_GESTURE_COMPLETED and wouldn't early return.

Therefore, we make GesturesObserver#clear as a private method and make
it to manager its matchers' state.

Bug: 206061247
Test: atest GesturesObserverTest
      atest MagnificationGesturesObserverTest
      atest MagnificationGestureHandlerTest
      atest WindowMagnificationGestureHandlerTest
Change-Id: I19294e231f969d7dd54b50dc9a2deb36d06b532a
2022-03-18 15:59:52 +00:00
ryanlwlin
c162b50804 Transfrom connectionState to string
We print the readable string instead of integer value
to improve debugging efficiency.

Bug: 214785717
Test: build pass

Change-Id: I0f8ac7cd545674455019433d76db374cd6696387
2022-03-18 15:17:57 +08:00
yingleiw
2db234db5f resolve possible Imf lock and a11y mLock deadlock
When IMF calls into A11yManagerService, A11yMannagerService
will post the call to main handler so the function call
returns without holding the a11y mLock.

Fix: 218182733

Test: atest AccessibilityImeTest

Change-Id: I3f7fcb1906b4084b2458ce2b65bb6fec8e9c6ae1
2022-03-16 12:41:05 -07:00
Ameer Armaly
466c18a33b TouchExplorer: do not crash when the user lifts a finger while dragging.
Fix: 223396885
Test: Manual. Perform two-finger drag repeatedly.
Test: atest TouchExplorerTest
Change-Id: I5e5d8c69e4d1541048c91fbda20ff9d27912d21b
2022-03-16 09:26:12 -07:00
Daniel Hsieh
2b7842fc75 Offsets an additional distance for requestRectangleOnScreen.
In previous, requestRectangleOnScreen would only apply the shortest
movement on the magnifier to the rectangle. However, it will make typing
words out of the screen. Therefore, we add an additional distance for
moving the magnifier to help a user know the surrounding context.

Bug: 148882866
Test: atest FullScreenMagnificationControllerTest
Change-Id: Iee7a4f13395ed8acf3ffa7df759542fcb08190f8
2022-03-16 05:05:20 +00:00
yingleiw
89da511a1f handle dynamically set AccessibilityServiceInfo.FLAG_INPUT_METHOD_EDITOR
When the flag is set dynmatically, we need to create the InputMethod()
instance and request to bind ime. If the flag is unset, we clear the
InputMethod() instance and unbind ime.

Fix: 218193835
Test: Tested with talkback. When the flag is not set, we can't use
ime. When the flag is set, we can use ime again (dynamically set
flags).
Change-Id: Ied48d452108a593e8e4ee5c67c3208acbc87335e

Change-Id: I2a85c64b089983807cb7627de9b8512e8f716426
(cherry picked from commit 14e78228a1)
2022-03-09 03:39:27 +00:00
Ameer Armaly
0d352887e2 Fix service touch exploration.
We were queueing up ACTION_HOVER_EXIT when initiating touch exploration which doesn't make sense. ACTION_HOVER_EXIT only makes sense on ACTION_UP when touch exploring.

Fix: 219814318
Fix: 220387502
Test: Verify that entering a pin works as expected.
Test: Verify that touch exploration does not get stuck often, only occasionally per b/215654623
Change-Id: Iab29f7736ab4ff3ea24c26109073481a876ffb58
2022-03-04 15:48:59 -08:00
ryanlwlin
d323c922ff Revert "Adds install source checks for accessibility service"
This reverts commit f1f2c84756.
The stragery is chaged, we don't need to check the installer
nor if it is sytem app. We also delete the tests that are
obsolete.

Bug: 221318082
Test: AccessibilitySecurityPolicyTest, PolicyWarningUIControllerTest
Change-Id: Ide89213dbf90cdb57001e5b05a2eeefc35f6adee
2022-03-04 15:53:00 +08:00