TYPE_WINDOWS_CHANGED events have meant that "something"
changes with the system windows, so a single event would be
fired for a single small window change or a bunch of window
changes. Services were required to cache the windows and
compare the old ones to the new ones to find out what
changed.
Since AccessibilityEvents are intended to communicate
changes to the UI, this CL sends one TYPE_WINDOWS_CHANGED
for each window that has changed, and provides a way to
get the source of the changing window. It also adds a
windowChangeType field, which contains flags to indicate
what exactly has changed for the window.
Bug: 62231686
Test: Run all a11y unit and cts tests
Change-Id: I6c48e74da26be5ea485ac114a37f3c404a74940e
This change adds a special flag when binding to a service to request
instant apps to be considered as well (assuming the caller has the
permission to see instant apps). This flag is scoped only for the
platform to use and is intended only for development and testing.
Specifically, we have a class of CTS tests that has tests plus service
in the same APK (accessibility, printing, autofill, any other plugin
based sub-system).
Instead of doing the tediuous work split all these into one APK with
tests and one with the services where the latter exposes a remote
interface to the former, we will be adding shell commands to the
dedicated sub-system to allow temporary binding to plugins provided
by instant apps. The goal is not validating the plugin behavious,
rather a working plugin is required to test app side funcionality.
This change adds a shell command to allow the a11y manager serivce
to bind to plugins provided by instant apps. This is required to
be able to run relevant CTS test cases in instant mode.
Test: cts-tradefed run cts-dev -m CtsAccessibilityTestCases
cts-tradefed run cts-dev -m CtsAccessibilityServiceTestCases
Bug: 70978575
Change-Id: Ifced735a9a6e495747372dd8b00fdd64933a09c7
Together with checking isObservableEventType this will result in a11y events
not being generated for packages that are excluded form a11y-service(s)
package whitelist
Test: cts-tradefed run singleCommand cts -d --module CtsAccessibilityServiceTestCases
Change-Id: Id65607aaccc7af7d870d009d609917ff3c6d0712
The anchors are, in practice, always Views, but they may end up
being virtual views in the future, so we should have this done
right.
Also cleaning up picture in picture mode. I don't know why I made
it a separate boolean when I already had the boolean properties.
Bug: 70730136
Test: A11y unit tests and CTS
Change-Id: I916ec066dff12fab8b586371452b728af6be1271
CTS tests are now throwing security exceptions for accessibility actions.
This reverts commit 19eb58959b.
Change-Id: I2027ee4cca0fcc2b38bb615a58d992ef309e2d70
Bug: 63907873
Test: manually tested that the app op is being logged for TalkBack and a 3rd party accessibility service. Ran UIAutomator-based tests to check that they work as expected.
Change-Id: I1a40d4ead52ba2258cc7ddc8be594a13895d8340
When the binder died, the system wasn't finding out,
so it got into an inconsistent state and told client
apps that accessibility wasn't enabled when it actually
was.
Also fixing dumping of uiautomation, which was failing
with an NPE.
Fixes: 70338333
Fixes: 70227110
Test: Repro case in 70227110 no longer fails.
Ran a11y and UiAutomation CTS.
Ran a11y system server unit tests, and added one to verify
the new behavior.
Change-Id: I4fa6067f8316114a925de86d3fac611e6196da3e
Fix: 70585244
Test: Enable any accessibility service -> inflate work profile
-> Tap on any work app -> no longer crash
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.CrossProfileAppsHostSideTest.testPrimaryUserToManagedProfile
Change-Id: I80d18f4e2ab76a228cb0aa2c8312c323a9b5c84d
Bug: 63907873
Test: manually tested that the app op is being logged for TalkBack when it's being registered as an accessibility service.
Change-Id: I10f36a86067950ef57c7afc7bf2f01efff46689c
Enabling color inversion and color correction initially.
Not showing toast for the framework features, as both are
instantly visible changes and the extra reminder seems like
it will get in the way.
Moving AccessibilityShortcutController to a place where
it can be seen by Settings, so Settings can learn what
framework features to offer the user. Moving tests for that
class to match.
Currently don't have icons for the two framework features.
They will be added in a future CL once I get them.
Also tweaking the warning dialog to include summary
information, if we have it, for the target service.
Bug: 34621067
Bug: 36368472
Test: Adding unit tests for framework features
Change-Id: I32a10989db1c9ad9bf22aae9ad405771b789bc6f
Splits WindowManagerPolicy into a framework and a services part, preventing concepts that are
internal to the window manager from leaking out into the framework.
Test: make droid
Change-Id: I7b6a54f55f76f6fbb5f27090981b8f1d4d8be88b
Having an ACTION_CANCEL occur is a way to trigger b/68214834
Bug: 68214834
Test: Magnificastion CTS tests
Change-Id: I9b1ead33de100a18b37cc557c1111749a2bd9073
We need to unbind all services in unbindAllServicesLocked.
I was only unbinding all but one.
Fixes: 68814166
Test: Enabled Select to Speak, switched to guest, then
switched back. Previously S2S didn't restart. Now it does.
Change-Id: Ib6eb8ff7532a0c88faa3f14760dfd58774e3f5c2
Addressing previous commebnts on MagnificationGestureHandler
Test: ensure magnification still works as expected
Change-Id: I918a2db6549e8cf7e0b0907ce8758bab8abb7307
There was an opportunity for the UiAutomation's binder
to die before it was connected, which caused an
NPE when it tried to connect.
I also moved the message handling to a different handler
to make it easier to test.
Bug: 65474486
Test: UiAutomation CTS passes. I also added a unit test
that failed in the same way as the bug. That test now
passes.
Change-Id: I31036ace114b21fed64227b62212b95267039d9e
This is aimed at making MagnificationGestureHandler easier to understand
and reason about
Test: provided unit test + manual magnification test
Change-Id: I958ef0bdd2e6f857a2fab24962b1a06480685732
When enabling the magnifier feature it is possible to trigger
a system crash.
Problem:
On ACTION_DOWN a MESSAGE_ON_ACTION_TAP_AND_HOLD is sent to the
handler with a delay based on long-press timeout. If the user
then removes their finger while outside of the magnification area,
(ACTION_UP) this message is not removed. Then when the message
is handled on long-press timeout, it puts the state into
STATE_VIEWPORT_DRAGGING. If the user then taps the screen again
it is handled by the StateViewportDraggingHandler resulting in:
IllegalArgumentException: Unexpected event type: ACTION_DOWN
and a system server crash.
Bug: 65101895
Test: Manual:
1. Enable "Magnify with button" from accessibility settings
2. Tap accessibility button on the right navbar
3. Touch & hold bottom part of application area
4. Quickly drag down to the navbar and release
5. Touch anywhere
With this patch it should not crash
Change-Id: I7df8d2185f6db9d148d24d2b155cb357b3637a71
The driver here is to make UiAutomation work across users.
I decided to take the opportunity to pull Service out of
AccessibilityService, separate the code that is service- or
UiAutomation-specific, and then manage the UiAutomation
independently from the user's state.
Bug: 63115387
Test: Adding a few tests, which is much easier after the
refactor, and running existing A11y unit and cts tests,
including those for UiAutomation. Also running the test
at ag/2593458, a sample multiuser test.
Change-Id: I2c43984d9886cd798458c9bf683c6aaa953c1afd
Bug: 62344706
Test: Now able to bring up keyboard in split-screen mode.
Also a11y CTS and unit tests pass.
Change-Id: Ic4340425680c89e8fc5e586aa1d363b01fd69763
I've see flakiness in the gesture dispatch test with
magnification enabled. It turned out that the state
of the input filter was in flux when onServiceConnected
was called back. Now delaying that call until the
input filter's state is stable.
Also fixing the return value of getCenterX and Y when
a service isn't actively controlling magnification.
Test: A11y CTS and unit tests.
Change-Id: I64260ebb72ee95307d777a9e4b70876c14f99e9c
If the volume keys are being pressed to enable or disable
an accessibility service, the key events should not be
dispatched to accessibility services.
Bug: 62653966
Test: A11y CTS and unit tests. Adding a set of unit tests for
the expanded KeyboardInterceptor. Also verified that the
accessibility shortcut now works as designed with TalkBack.
Change-Id: Iaea58a5bfe6748d4b9a033f5b957e78298881c40
Bug: 62862624
Test: Enable magnification, then enable TalkBack with the
a11y shortcut. Verify that volume keys work.
A11y service CTS, a11y units tests.
Change-Id: I729ab17d24f758b5ce534ffde43d2126a1f9536c
- Unify logic for detecting availability of the accessibility button
- Ensure the initial visibility state is propagated to A11yMS
- Ensure services only receive availability callbacks for changes
Test: Manual, created test accessibility services
targeting specific breakages
Bug: 38345417
Change-Id: I2250b32830cdfc2ecdc1dff7b7130dced2c1db29
This mostly rolls back ag/710190, which caused
AccessibilityEvents to contain their source nodes. These
nodes were not completely accurate, and populating them
increases the overhead of AccessibilityEvents, particularly
when large numbers of content changes happen. Having the
service reload the node if it needs the update content
should be sufficient. I have fixed several bugs since this
change went in to address issues with the accessibility
cache containing stale data. I think ensuring that the newly
loaded data is up-to-date will fix whatever issues carrying
the node along was intended to fix.
Bug: 33961523
Test: A11y CTS still passes. I also tried TalkBack on a
couple of switch controls, which is where I have previously
seen the most issues with up-to-date announcements.
Change-Id: Ie5a70bb0e89d49255c6a4c1c83d32b755c06902f
We need to straighten out this state machine so we can
fix bugs in it without a high risk of creating others
(b/38246304). In the meantime, catching this exception at
least allows the device to keep operating.
Bug: 37338581
Test: Reproduced the conditions of the crash. Verified that
we now print the log message.
Change-Id: I1f4f84b5529b2bf638e225d474808e3d42484e78