The split-screen behavior is changed, so systemui doesn't
support this action with a single activity. We don't handle
this action by default from sc-v2. If SystemUI has any behavior
changed, they could register this action to support it.
Bug: 207056257
Test: presubmit pass
Change-Id: If569eff1ac52601e6b88324d7b47630a53e198f2
The A11yInputFilter is an input filter for implementing many
accessibility features on multi-display. When any display is
added or removed, all features of all displays would be reset
now.
To avoid server side bad user experience, we should only reset
the features and the event stream state based on the changed
display which is added or removed.
Bug: 187996964
Test: a11y CTS & unit tests
Merged-In: I39ae59e12690240adbb0e81338dcb4c736a92197
Change-Id: I39ae59e12690240adbb0e81338dcb4c736a92197
(cherry picked from commit e6014fc060)
This flag indicates that the event was modified or generated by an
accessibility service.
It allows apps to tell apart real hardware events, events that are
injected (device id == -1), and events coming from accessibility (has
flag is_accessibility_event).
Events that have gone into accessibility, and got reinjected without
being modified will not be distinguishable from real hardware events.
In the next release, we will make FLAG_IS_ACCESSIBILITY_EVENT public
api. Until then, applications will have to hard-code its value (0x800)
to use it. The value is the same for both KeyEvents and MotionEvents for
convenience.
Bug: 175069843
Bug: 152399927
Test: atest VerifiedMotionEventTest VerifiedKeyEventTest
Test: atest AccessibilityGestureDispatchTest
Test: atest inputflinger_tests libinput_tests GamepadWithAccessibilityTest
Change-Id: I38ac2ab8e19e32cad927742c623f14f43ea0c588
Root cause:
Upon running into the method "UiAutomationManager.registerUiTestAutomationServiceLocked", after assigning "mUiAutomationService" with newly created object, the calling of "mUiAutomationService.onAdded()" may throw an exception which simply skipping the next code line "mUiAutomationService.mServiceInterface.asBinder().linkToDeath", which preventing it from getting notification when the "mServiceInterface" process dies, then, the "mUiAutomationService" will never have a chance to be clean-up-ed. And, next time, upon running into registerUiTestAutomationServiceLocked again, it has to complain "already registered".
Solution:
Move the line "mUiAutomationService.onAdded()" to after the line "linkToDeath", so that, the possible exception will not prohibit the linkToDeath operation.
Bug: 192317057
Test: monkey test for one day and one night
Co-authored-by: Zheng Xiaoying <zheng.xiaoying@gm.com>
Signed-off-by: Jintao Zhu <zhujtcsieee@gmail.com>
Change-Id: Ife4584804910290fac70dbe6d6934333f9a7486a
* Logs the atom AccessibilityShortcutReported in westworld
Bug: 189860801
Test: make statsd_testdrive && statsd_testdrive 266
Change-Id: I4e5814cb6a1d877af540e278de5ffa398d6d0351
The display size is changed after folding/unfolding the device.
We need to refetch the size to draw the correct boundary on
the screen. Display#realSize is not updated in time, so we get the
bounds directly from windowConfiguration.
Bug: 190007130
Test: manual test
Change-Id: I942e333f62510650eec8b49d77ccf46a85a7457e
If the app targets API level 30, the returned installed
AccessibilityServiceInfo would based on its own package visiblity.
Using packageManagerInternal#filterAppAccess to determine whether
we need to fitler the service or not.
Bug: 179699353
Test: manual - use the test apk and check the log
atest AppEnumerationTests
Change-Id: Ieea089e10410a9d9feeb4a741c871c43547b1861
All input events coming into inputfilter from
InputDispatcher will now have FLAG_INPUTFILTER_TRUSTED set by default.
It is now up to the inputfilter (a11y) to remove this flag when appropriate.
One such case is where an unknown a11y service is injecting the events.
From auditing the a11y code, the only such place is MotionEventInjector.
Therefore, label all events coming out of MotionEventInjector as
"untrusted" by removing this new flag INPUTFILTER_TRUSTED.
Separately, a11y should be distinguishable from regularly injected input
events. To tell apart the events injected by a11y, add a new flag,
FLAG_INJECTED_FROM_ACCESSIBILITY. This flag requests InputDispatcher to
apply the device id = -2 for the injected events.
Test: atest CtsInputTestCases:android.input.cts.GamepadWithAccessibilityTest
Test: atest MotionEventInjectorTest
Bug: 175069843
Change-Id: I12d4a7bd6fbab8af202f5ae88b6be97ff9e1754c
Whenever an app makes a Text toast, this gets routed through systemUI
starting from R. Two A11yManagerClients are registered with
A11yManagerService for every toast. Since clients aren't removed until
the process is killed, there are a bunch of clients from systemui
hanging around and potentially cause the system to crash.
We add a way here to explicitly unregister a client
Test: build and flash,
atest android.view.accessibility.AccessibilityManagerTest
Bug: 189010828
Change-Id: I3f71bac475b4539c7be5b328adeb0be35a0b5543
1. For fixing the crash due to mutl-register callback, we avoid using
the display context when un-registering the callback. Instead, we
remove the observer mapping if the display exists along with the
observer of any embedded displays that are children of the
un-registered one.
2. When an display registers its callback first, and then got its
reparent window, there's an displayWindowObserver for it in the
A11yWindowManager. But it didn't be used because it's an embedded
display and any windows change on it will be notified through the
callback of its parent display. So we add a callback to remove
this un-used displayWindowObservers in the A11yWindowManager when
this display is an embedded one.
Bug: 143114102
Test: a11y CTS & unit tests
Merged-In: I00fd1f45c0b4e362143a8d82f31264ff202f0967
(cherry picked from commit 5b8b737755)
ContextImpl checks the incorrect Context usage in S.
If non-ui context access window service, it would throw an
IllegalAccessException.
And the bug happened because the GestureDectectors in
PanningScalingHandler.class don't have the correct context.
So we have to apply using uiContext for the GestureDectectors
and MagnificationGestureHandler.
Bug: 185154435
Test: none
Change-Id: I942192011526d0e4ce68e6121855bd321c499f56
Adds install source checks for accessibility services. An
accessibility category service must be installed from the
given allow list or not from the default installer if no
allow list provided.
Bug: 182959209
Test: atest AccessibilitySecurityPolicyTest
Change-Id: I023c15b9ebd87785e2f7eb1e218bec4ad006e52f
This is the re re..re-merging of ag/12923546 (where most of that original
message is posted below). This includes various bug fixes.
Slow prefetch requests would block user interactive requests, creating
noticeable sluggishness and unresponsiveness in accessibility services,
especially on the web.
Let's make it so a user interactive requests stops prefetching.
We can't interrupt an API call, but we can stop in between API calls.
On the service side, we have to separate the prefetch callbacks from the
find callback. And we have to make it asynchronous. It does dispatch
intothe main thread, so the AccessibilityCache can remain single threaded.
When the calls are interrupted on the application side,
returnPendingFindAccessibilityNodeInfosInPrefetch checks the find
requests that are waiting in the queue, to see if they can be addressed
by the prefetch results. If they can be, we don't have to call into
potentially non-performant application code. We don't check requests
that have differing prefetch flags (FLAG_INCLUDE_NOT_IMPORTANT_VIEWS,
FLAG_REPORT_VIEW_IDS) that would result in different caches. We satisfy
at most one pending request.
We also make mPendingFindNodeByIdMessages thread-safe and ensure in
ActionReplacingCallback we don't return null results. Merged
ag/13246536, ag/13256330
Messages should be added to PrivateHandler and
mPendingFindNodeIdMessages at the same time to avoid a race condition
where we try removing a message from the handler before it's actually
enqueued. This was causing double recycling
We call into AccessibilityCache from the Binder thread, now that the
cache doesn’t call out to the app main thread with a lock(ag/14020225)
Added tests to verify AccessibilityInteractionController interactions
Test: atest AccessibilityInteractionControllerNodeRequestsTest
atest CtsAccessibilityServiceTestCases CtsAccessibilityTestCases
CtsUiAutomationTestCases
FrameworksServicesTests:com.android.server.accessibility
FrameworksCoreTests:com.android.internal.accessibility
FrameworksCoreTests:android.view.accessibility
Bug: b/184076735
Change-Id: Iaad1b9100655ec86a788ba1c89edd2dd8a7df1f6
Send componentName via extra instead of idenfifier for Accessibility
usage notification intents because the identifier is used to identify
different intents only. The formal way to send data is via extra, thus
the notification can be launched by adb command.
Bug: 176965357
Test: enable a11y service and execute adb command below.
adb shell am broadcast -a PolicyWarningUIController.ACTION_SEND_NOTIFICATION
-p android --receiver-permission android.permission.MANAGE_ACCESSIBILITY
--ei android.intent.extra.USER_ID 0
--ecn android.intent.extra.COMPONENT_NAME xxx/yyy
Change-Id: I898b66efc05f0144981dd16bd92d719c756b4c2d
For targetSdk < S. For S, they can use the new
GLOBAL_ACTION_DISMISS_NOTIFICATION_SHADE action to dismiss the
notification shade.
Bug: 159334261
Test: Send Intent.ACSD from an a11y service and verify shade is
collapsed when targetSdk < S, and exception thrown when targetSdk
S+.
Change-Id: I0e4be3faef8efa53a0b8a08263e842e0c4b1553e
To switch magnification mode, a user has to click the magnifcation
button UI. However magnification button UI is visible only when
there is an user touch interaction or the magnification shortcut
triggered event.
However some a11y services like switch-access or voice-access
can only interact with magnification UI by performing
accessibility actions. To make magnification button showing and
able to interact with a user, we also trigger updating
magnification button UI when an accessibility action is performed.
Bug: 179442890
Test: atest WindowMagnificationControllerTest;
atest WindowMagnificationTest;atest MagnificationControllerTest;atest WindowMagnificationManagerTest
Change-Id: I8d762096c9cb6a4421d024a7a1af99b3a48a3462
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
Display magnifier could be magipulated by public API. This request
should be treated as an user interaction. We should also update the
magnification button in such circumstance.
Besides, we also disable display magnification that is requested
by AccessibilityService when window magnification is enabled.
In the test part, we also verify the shorct trigged in full-screen
mode.
Bug: 179446412
Test: atest MagnificationControllerTest
manually Test: Use voice access to controll display magnifier
and chek if switch button is shown.
Change-Id: I729ea6fbf921ba6bd735c62198a2b8caee6ec4d7
Change icon to a11y asset and change string based on
String doc
Bug: 174336318
Test: 1. adb shell settings put secure \
accessibility_show_window_magnification_prompt 1
2. use full-screen magnification to see if it works well
atest WindowMagnificationPromptControllerTest
Change-Id: I110ca30b95e268bcad5e9109d7715e854118f0db
Uses the atom MagnificationModeWithImeOnReported in westworld to log
the activated mode when the IME window is shown on the screen.
Adding a new callback API in the MagnificationCallback to monitor the
IME window visibility changes. The A11y framework registers the
callback when the magnification is enabled. It logs the related
data when it receives the IME window visibility changes through
this callback and the magnification is in the activation.
Bug: 154021596
Test: a11y CTS & unit tests
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive 346
Merged-In: I49b02e00d5a1131b388eeb923440f59a2b4f81a6
Change-Id: I49b02e00d5a1131b388eeb923440f59a2b4f81a6
(cherry picked from commit 1aa113d8dd)
* changes:
Updates magnification button after magnification mode transition is done
Also regarded as magnification activated when it is forced to show magnification bounds
Prompts a notification for the non-accessibility category service after
24 hours enabled to alert users the service has powerful permissions to
view and control the device. And the notification won't be resend to
the same service by saving the dismiss record to Settings.
Bug: 176965357
Test: atest AccessibilitySecurityPolicyTest
atest PolicyWarningUIControllerTest
and manually test
Change-Id: Id5daf7b14dc88cf3f71a53f46fa9a8f1dee91822
Magnification button may be incorrect after magnification mode
transition is done. So just update magnification button with the target
mode after magnification mode transition is done.
The new UI behavior would keep magnification button showing when
the magnification mode transition is happened.
Bug: 181000039
Test: atest MagnificationControllerTest
Change-Id: Icbe34aead2e63c8a65c3238bdc62ebb30974ac6a
When fullscreen magnification is showing initially, it would force to
show magnification bounds but not not be magnifying first.
Then a user has to perform one tap to make the magnifier scaling.
For this case, we also think that it is magnification activated when the
magnification bounds are showing but not magnifying.
Bug: 181597348
Test: atest MagnificationControllerTest;atest FullScreenMagnificationControllerTest
Change-Id: I90b34cc25aca636d4ac84f6627d1a674faecbb1c
Uses the atom MagnificationUsageReported in westworld to log the
activated mode and its duration of the magnification.
The timing of logging the MagnificationUsageReported is
when the magnification feature is deactivated.
Bug: 154021596
Test: a11y CTS & unit tests
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive 345
Merged-In: I708e9731da23658774e462968a6b9df648b0ed19
Change-Id: I708e9731da23658774e462968a6b9df648b0ed19
(cherry picked from commit e19cdef475)