140 Commits

Author SHA1 Message Date
Phil Weaver
8c8e55904a Merge "Control magnification only with the setting." into nyc-dev 2016-02-26 20:57:46 +00:00
Phil Weaver
6cb67af65f Control magnification only with the setting.
Don't turn off magnification if gestures are enabled.

Bug: 26571116
Change-Id: I8dafcd4eef50bfa8f9474bf98637f8e54f3527e1
2016-02-26 11:34:35 -08:00
Phil Weaver
8ca583b29f Merge "Accessibility to toggle multiwindow mode" into nyc-dev 2016-02-25 23:16:52 +00:00
Phil Weaver
315c34e7d6 Accessibility to toggle multiwindow mode
Encapsulating the logic to toggle multiwindow mode from recents,
and plumbing it through to accessibility global actions. Sending
accessibility events when windows bounds change. Exposing the
dock divider window type to accessibility services.

Bug: 27250995
Change-Id: Ib7491f1f853dc7f01bf5c5a4ac1f914f55d0608a
2016-02-25 15:13:11 -08:00
Jeff Sharkey
e88e266547 Update accessibility to be encryption-aware.
Look for both EA and non-EA accessibility services, but when the user
is locked only bind to EA services.  Once the user is unlocked, we
take another pass and bind to any non-EA services.

We only consider disabling accessibility once the user is unlocked,
since there could be non-EA services waiting in the wings.

Bug: 25860579
Change-Id: I97bd019661457c3577d629ba12290d02f026011a
2016-02-23 20:15:15 -07:00
Svetoslav Ganov
1b5d292fbb Merge "Clear binder id before creating pending intent as the system." into nyc-dev 2016-02-20 01:26:38 +00:00
Svet Ganov
c42d933b56 Clear binder id before creating pending intent as the system.
bug:19349693

Change-Id: I989441ac32b89d313ec7a006373faa90f58fc89d
2016-02-19 17:24:58 -08:00
Zachary Kuznia
0bc3cc9c2f Fix crash when cancelling an accessibility gesture with ACTION_UP.
b/27090049

Change-Id: I7a5b65c4e96513539d820c9a2bef99272fb24680
(cherry picked from commit 3951e3547f2ebb5ec228b8776855e9f244b1e9e9)
2016-02-18 17:57:18 +00:00
Phil Weaver
e7b198353c Protect MotionEvent stream when a11y changes.
I found this hole while looking for a solution to a bug when
magnification was enabled when TalkBack was running. I believe
what was happening was that enabling/disabling magnification
resets the AccessibilityInputFilter. The filter batches MotionEvents
for processing with a choreographer, but the disable/enable cycle
when magnification gets enabled could disrupt the event stream.
This change flushes the batched events before objects using them
are disabled.

I've tried a variety of things, but I'm not able to reproduce the
bug on NYC using the same procedure. I suspect that either the
timing of the events is different, or the newer gesture detection
in TalkBack is protecting it somehow. The hole remains, though,
and could create invalid streams of MotionEvents without this fix.

Bug: 26613222
Change-Id: Ie9f3da459929397596e0a80a61d5c7f191001ee8
2016-02-17 15:02:35 -08:00
Zachary Kuznia
c8e941f4ba Update the timeout values for accessibility gestures.
Change-Id: I1e6ed7bbec46b848c1278922be3110733a64dcb6
(cherry picked from commit 0522205fd5fdc460fb7af78a3ac4a17fcb988ac5)
2016-02-12 21:20:36 +00:00
Phil Weaver
cc494765fa Merge "Clean up UiAutomation working alongside a11y." into nyc-dev 2016-02-09 16:59:26 +00:00
Phil Weaver
78d2e2ddf0 Clean up accessibility gestures.
Closing two small holes in the implementation:
1. The gesture was dispatched before the callback was registered. It
was possible for gestures that failed quickly to fail to report any
status.
2. Gestures could be dispatched before the input filter was
installed. Adding a wait to give the filter a chance to install
before reporting a failure.

Also removing an unused method on the input filter.

Change-Id: I77cd80dcd2cec6c72b3761169aba5eaecf62250b
(cherry picked from commit 03465fb874ccf35ead2228b66ec03afc31d7694e)
2016-02-09 00:51:18 +00:00
Phil Weaver
f564afa4cd Clean up UiAutomation working alongside a11y.
Fix two bugs: one where Instrumentation did not properly
handle destroyed UiAutomations, another where UiAutomation
did not properly disable running accessibility services.

Change-Id: I1773dbd373f4d5b0e7c9917ff18d8d9b1a0e07c7
(cherry picked from commit 846522cea043d3113b3b96daa8f3a1b70e3beb5e)
2016-02-09 00:08:59 +00:00
Zachary Kuznia
28239e8a61 Improve gesture recognition state change for TouchExplorer.
This increases the tolerace for detecting a user interaction as a
gesture in Touch exploration mode.  The detection should also be more
consistant between devices, as the threshold is based on physical
units.

Change-Id: Iec935e862d2634fba0fea6dc6d81e62ed2213cbc
2016-02-03 12:06:13 -08:00
Zach Kuznia
7647b678c2 Merge "Make AccessibilityGestureDetector handle gesture detection start and end." 2016-02-02 18:31:35 +00:00
Zachary Kuznia
9254b3e336 Make AccessibilityGestureDetector handle gesture detection start and end.
Change-Id: I2c1861d5d6c5c0dc921e62f03ee6283f1f7a62b6
2016-02-01 19:28:33 -08:00
Dan Sandler
8766c398df Make color matrix parsing more robust.
Bug: 26880793
Change-Id: I95e1b24ed949c6b341ecee7de5732a286c674824
2016-02-01 16:13:15 +00:00
Anna Galusza
f3e5d1d483 Merge "Add API for IME control by Accessibility Services." 2016-01-29 16:58:07 +00:00
Phil Weaver
1dd872260b Optionally support accessibility with UiAutomator
Adding a flag to AccessibilityServiceInfo that only works
for UIAutomator that supresses other services. This flag
is set by default for UIAutomation to match the current
behavior, but tests may clear the flag and enable other
services.

Needed to improve cts coverage of AccessibilityService.

Bug: 26592034
Change-Id: Icfc2833c1bd6546a22a169008d88a6b15e83989c
2016-01-28 10:09:05 -08:00
Anna Galusza
9b27811246 Add API for IME control by Accessibility Services.
Change-Id: I3bb806cf420e0551a2c9ef97d95613f73e362df9
2016-01-27 17:35:59 -08:00
Svetoslav Ganov
a3a1ea3dbe Merge "Clear binder calling identity before mutating secure settings." 2016-01-25 17:24:02 +00:00
Svet Ganov
81fcf7037b Clear binder calling identity before mutating secure settings.
The accessibility manager service changes secure settings without
clearing binder calling identnty. Luckily it worked for a long
time as the calls resulting in a secure setting change were not
made on a binder thread. Now we clear calling identity before
mutating secure settings - note that we alsways do this after
a security check, hece it is safe.

bug:26766532

Change-Id: Icb188e6de1a134f38de0bdb23c67fa4ff2806ba4
2016-01-25 09:12:44 -08:00
Jinsong Mu
a9e7a3bbe8 Accessibility services can turn themselves off b/22514381
Added disableSelf() method to AccessibilityService
This newly added api used used in
https://googleplex-android-review.git.corp.google.com/#/c/833857/

Change-Id: I5fe60181058ef90dd496318cf270e0825bcc411a
2016-01-20 21:56:50 -08:00
Fyodor Kupolov
e2239c9346 Explicitly pass userId to getWindowToken
UiAutomationConnection.clearWindowContentFrameStats method currently clears
calling identity before calling mAccessibilityManager.getWindowToken. This
doesn't work properly when a call is made by a secondary user, because it
wouldn't pass a check in getWindowToken. This is now fixed by explicitly
passing ID of the calling user.

Bug: 26498396
Change-Id: I8f0cdde33e18f04adb1833c6c0d0c329de921018
2016-01-12 16:46:13 -08:00
Zach Kuznia
7ef1e7ffbc Merge "Renable split tapping while in Touch Explore mode." 2016-01-12 19:34:48 +00:00
Zachary Kuznia
a70778f1c9 Renable split tapping while in Touch Explore mode.
b/26496116

Change-Id: I9c819e8d3fb2332120b143cf074c0d7cc3921eae
2016-01-11 16:50:30 -08:00
Phil Weaver
a6b64f5099 Gesture dispatch from accessibility services.
Add public APIs to describe gestures and dispatch them from
an accessibility service. Added a new capability that
services must declare to have this capability.

Bug: 22514086

Change-Id: I9bff2d9335f0310115112d14b7ed033a6d6c2393
2016-01-11 09:32:43 -08:00
Jason Monk
08e7fa9b69 Allow color matrix to be controlled by secure setting
Change-Id: Ia5518ad79fae502e814034edd7ae8d7a57b3eaeb
2015-12-08 07:27:15 -05:00
Phil Weaver
14ed6cf3e7 Ignore feedbackType in AccessibilityEvent dispatch
Send AccessibilityEvents to all accessibility services
that request them. No longer refuse to send them to
services with the same feedback type.

Change-Id: I137905c24fc75c075ab938175ecb6ea5f39112cf
2015-11-30 14:36:34 -08:00
Phil Weaver
b76bbd8e50 Merge "Dispatch key events to multiple a11y services." 2015-11-20 21:55:53 +00:00
Phil Weaver
5915658c88 Dispatch key events to multiple a11y services.
Introducing a new class to manage key event dispatch
that sends all events to all classes that request them.

Bug:22332500, 22515057
Change-Id: I8521f6257a4ac6c8f2eff14186789630d680ff11
2015-11-20 13:43:02 -08:00
Alan Viverette
214fb68767 APIs for querying and controlling display magnification
Also separates magnification state and touch event handling. Moves
callbacks for window manager changes and display state changes into
the magnification controller.

Bug: 22718911
Change-Id: I3a8ba060a07d8f1f51856855a5f85601766fd45d
2015-11-17 09:48:25 -05:00
Alan Viverette
590f2235d9 Prevent runtime restart on missing magnification spec accessors
The spec property requires an accessible getter and setter. This code
will be removed in a following CL that refactors magnification spec
animation.

Change-Id: Ia8fecf98700d18e62ae30aa437b81b061c9a9542
2015-11-12 12:43:15 -05:00
Alan Viverette
57525a7054 Refactor MagnificationController out to its own class
First step in moving ownership to AccessibilityServiceManager so that we
can implement the magnification control APIs.

The magnification Region and the current/sent MagnificationSpecs are now
private to the controller, and all access is handled through accessor
methods. Comments have been added to all public accessor methods.

Bug: 22718911
Change-Id: Ia50ee93513785585aac5424543fc1d730b84bd90
2015-10-30 15:24:51 -04:00
Zachary Kuznia
407df712e2 Move stroke buffer and gesture recognition out of TouchExplorer.
This also adds a return value to the callbacks on
AccessibilityGestureDetector.Listener, so that the listener can indicate if the
event has been consumed, and processing should be halted.

b/25021896

Change-Id: If4d366ff207c1cebd0e3f7dab5f27a2037ddb510
2015-10-20 17:22:47 -07:00
Zachary Kuznia
c18f2fdfcf Encapsulate a11y gesture detection in an external class.
Change-Id: I59e0c25c06ba296822c7afb9f8623989986fde96
2015-10-06 14:50:04 -07:00
Zach Kuznia
4d2a3e2ebd Merge "Use the standard GestureDetector to handle double tap and hold in TouchExplorer." 2015-10-02 19:31:05 +00:00
Toni Barzic
f3d78a2fa8 [a11y] Add default autoclick delay value to AccessibilityManager
The goal is to make this value shareable with Settings code (without
adding dependency on com.android.server)

Change-Id: Ic41af575dcf8081de69bdcdb20fba430bcf3257e
2015-10-01 12:26:24 -07:00
Zach Kuznia
ae25fa31ac Merge "Remove change to event time when sending delayed events in ScreenMagnifier." 2015-10-01 04:09:19 +00:00
Zachary Kuznia
c78d641322 Use the standard GestureDetector to handle double tap and hold in TouchExplorer.
b/24407329

Change-Id: I1cbd1a232bd642eb9bf87548b1a3d1afe48a9bed
2015-09-30 16:22:30 -07:00
Toni Barzic
94ce21094d Always reload AccessibiiltyInputFilter on user switch
Makes AccessibiilityInputFilter aware of current user ID, and pasess the
user ID to event stream filters that have per-user parameters:
- AutoclickController -> for per-user autoclick delay
- ScreenMagnifier -> for magnification scale

While doing this, make AccessibilityInputFilter.disableFeatures private,
and replace usage in AccessibilityManagerService with
setUserAndEnabledFeatures with feature flags set to 0:
Using disableFatures directly leaves input filter in inconsistent state
where internal mEnabledFeatures flags don't match real state of enabled
features.

BUG=23113412
BUG=24265227

Change-Id: Ib295f4c08de1a3743e55714459844b6d80787637
2015-09-29 10:31:08 -07:00
Zachary Kuznia
f5ee31d687 Remove change to event time when sending delayed events in ScreenMagnifier.
This was originally introduced in change id
Idd8539ffed7ba4892c5a916bd34910fd2ef50f75 to fix an issue with touch event
handling in TouchExplorer.  The original issue has been fixed, so this
workaround is no longer needed.

b/24470877

Change-Id: Ie2a782b162b837e9bdc4904a486ed292989f83d8
2015-09-28 16:21:09 -07:00
Zachary Kuznia
c052c635ee Use the standard GestureDetector for Double Taps in TouchExplorer
b/24339804

Change-Id: I96fa1287fa941178fb9970ceb34d95a3604e6815
2015-09-24 14:47:07 -07:00
Filip Gruszczynski
466f321650 Showing docked stack divider window.
When there is docked stack, we want to show a "handle" through which the
user will resize the docked stack. We add it from the system process,
because we want to avoid IPC calls.

Change-Id: If15fd2a0fcb7077446d1ba6c533acb3028a42039
2015-09-23 14:58:43 -07:00
Toni Barzic
a3a9194e46 Read autoclick delay from settings
Instead of hardcoding autoclick delay, use
Settings.Secure.ACCESSIBILITY_AUTOCLICK_DELAY value.
Adds logic for observing the setting's changes and updating the delay
that should be used when scheduling automatical click.

BUG=23113412

Change-Id: Iffe3df0cb64ab28f13d2803d01d581280aedf422
2015-09-21 10:52:23 -07:00
Toni Barzic
386f834970 Introduce settings for Automatic click when mouse pointer stops
Settings in question are:
- accessibility_autoclick_enabled -> Whether the feature is enabled
- accessibility_autoclick_delay -> Amount of time mouse pointer has to
    stay still before performing click

Enable/disabled AutoclickController event stream transformation (which
implements the feature) based on the accessibiilty_autoclick_enabled
value

BUG=23113412

Change-Id: I8178d10c09d86713bb4c725c95268a7c5f432eb4
2015-09-14 14:59:26 -07:00
Toni Barzic
c954760704 Implement EventStreamTrasformations for autoclick on mouse stop
The event stream transformer (AutoclickControlelr) observes motion
events from mouse in order to detect mouse movement. Once movement
is detected, a click event sequence gets scheduled with a delay. The
scheduled click gets rescheduled on every further detected mouse
movement, so the click is performed only when mouse movement stops.

Mouse movement detection has tolerance to jitter that may be caused
by user's poor motor control (that may prevent click ever being triggered
when mouse gets to target, or unwanted clicks when mouse is stationary).

Clicks are scheduled by posting delayed tasks to main loop. When
rescheduling click, previous tasks is not always removed and a new
created. Instead, if possible, new task is scheduled when previous,
delayed task is run. In order to do this, click scheduler keeps track
of scheduled click time and, when scheduled task is run, checks that
scheduled time is not greater than the current time (if it is, a new
delayed task is scheduled).

Detecting events from other input source types, or mouse events other
than movement (like clicks, scroll) cancels the scheduled click.

BUG=23113412

Change-Id: I8a72e768cd45cccb93c19476fe6e2c23e8e84f27
2015-09-11 14:50:16 -07:00
Toni Barzic
976724e81b Feed mouse and keyboard events to EventStreamTransformation
Updates AccessibilityInputFilter to pass keyboard and mouse events
through enabed EventStreamTransformations.

This is done in preparation for implementing Autoclick on mouse stop
feature, which depends on those events.

Existing EventStreamTransformation implementstions are modified to
non touchscreen motion events and key board events.

Adds stub EventStreamTransformation (AutoclickController) that will
be used to implement autoclick feature.

Implements key event filtering as a separate EventStreamTransformation
(instead of doing it directly in AccessibilityInputFilter).

Introduces private EventStreamState classes to AccessibilityInputFilter,
which keep track of whether event sequences for different input sources
have started, and help reduce code duplication when determining whether
an event should be fed to registered EventStreamTransformers.

BUG=23113412

Change-Id: If115799bbe4debce48689370ff5ea9fa6dab9639
2015-09-08 10:48:36 -07:00
Xiaohui Chen
a826b8c24c Cleanup USER_OWNER in a11y service and tests
I need to make some changes to get the tests pass.  First a11y service
will now disable when no service is specified, I need to re-enable
a11y after services are enabled.  Second the old event used in tests
seems to be filtered out by the service, I need to pick a new event.
Also the timeout waiting for mock service to start is extended, I hit
the old timeout quite often with N9.

Bug: 19913735
Change-Id: I8fe1b7b5d93b6a52df0a8940a08761ea5fbf5084
2015-09-02 13:15:21 -07:00
Jorim Jaggi
e85da2bad5 Add accessibility event for assist disclosure
Bug: 21568059
Change-Id: Ib51d4236fcc87acd54cb5d191197b9b2c6cc54ea
2015-06-30 00:27:14 +00:00