237 Commits

Author SHA1 Message Date
Phil Weaver
9a14b56b60 Merge "Add null check to a11y interrupt." 2016-12-14 18:49:30 +00:00
Phil Weaver
867ad35d9c Add null check to a11y interrupt.
Also adding same robustness to interrupt that we have for
sending a11y events.

Bug: 32507871

Test: Ran a11y CTS. Verified manually with sample app
that sends interrupt and accessibility service that
crashes when started. That case used to crash the
app, and doesn't anymore.
Change-Id: I5cf05dcbb54ea23ae876cb3258dd206c55dce775
2016-12-05 14:57:48 -08:00
Phil Weaver
2f165944ce Support continuing dispatched a11y gestures.
Test: Ran the tests in this CL, as well as new CTS tests for
the new API.

Bug: 29477207
Change-Id: Ie5aba553286e954f7afe76ccfa97a7e8be9d75af
2016-12-02 15:52:38 -08:00
Phil Weaver
02ea9b7587 Merge "Add check for null manger for a11y recents action" 2016-11-04 19:37:40 +00:00
Phil Weaver
a46f009bbf Merge "Add tests for MagnificationController." 2016-11-03 23:11:55 +00:00
Phil Weaver
3cdd6c7654 Add check for null manger for a11y recents action
Bug: 31986988

Test: Ran A11y cts
Change-Id: Ia6a1e1b921d8b0008edbcf1f1a8d1d3d0eb969c6
2016-11-03 15:52:02 -07:00
Phil Weaver
89e3ffc66c Add tests for MagnificationController.
Also refactoring the class to make it easier to test and
chaning behavior where the current behavior seemed poorly
defined.

Refactoring:
- Combined all handlers into one.
- Simplified animation to use a ValueAnimator.
- Eliminated ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE
  setting. Move rest of settings reading into mockable class.
- Move callbacks from WindowManager into the main class.
- Pulled out my instrumented Handler from the
  MotionEventInjectorTest into its own class so I can reuse
  it.

Behavior changes:
- Always constraining out-of-bounds values rather than
  refusing to change them.
- Constraining offsets on bounds changes. We previously
  left them alone, even if they were out of bounds.
- Keeping track of the animation starting point. We were
  interpolating between the current magnification spec
  and the final one. This change means the magnification
  animates to a different profile.

Test: This CL adds tests. I've also run a11y CTS.

Bugs: 31855954, 30325691

Change-Id: Ie00e29ae88b75d9fe1016f9d107257c9cf6425bb
2016-11-03 13:00:47 -07:00
Wale Ogunwale
ac2561e820 Make window token add/remove APIs require displayId
Window tokens can now only be on one display, so we now require clients
that want to add/remove window tokens to specify the display they would
like the token to be created on. This simplifies the token handling code
in WM and will be useful moving forward for clients that want to add
windows to external displays.

Test: Existing tests pass
Change-Id: I6b2d8d58a913b3624f1a9a7bebbb99315613f103
2016-11-02 10:28:45 -07:00
Fyodor Kupolov
c413f7078d Switch UM to internal isUserUnlockingOrUnlocked
Internal version of UMS maintains a self-locking data-structure of user
states that  is pushed from ActivityManager. Previously there could
be discrepancies between UMS.isUserUnlockingOrUnlocked and
UM.isUserUnlockingOrUnlocked, which is calling a blocking version
in ActivityManager.

Test: manual + UserManagerTests

Bug: 31995235
Bug: 31833240
Change-Id: Ibafe403f57cd32d9052bb55fe7273a861be1d037
2016-10-13 10:07:20 -07:00
Phil Weaver
65097bf83f Move a11y event dispatch back to ui thread.
Test: Ran CTS

Bug: 31753900
Change-Id: I0ba096cb99dd8347a7e9d6c41ff0aa8293dc5d15
2016-10-05 11:08:20 -07:00
chchao
6286496f1e In AccessibilityGestureDetector.clear(), dispatch a MotionEvent.ACTION_CLEAR event to mGestureDetector to cancel the ongoing gesture. am: 37ee5c796e am: 60948808a8
am: e613d10837

Change-Id: I3dde2a0a3a21830b08611c642725e5477c35a8f4
2016-09-20 20:09:07 +00:00
chchao
60948808a8 In AccessibilityGestureDetector.clear(), dispatch a MotionEvent.ACTION_CLEAR event to mGestureDetector to cancel the ongoing gesture.
am: 37ee5c796e

Change-Id: I0f76484c70e08435494f9e9ff1223082c9a3ceac
2016-09-20 04:12:02 +00:00
Phil Weaver
151e88568f Fix bug in magnification coordinate calculation. am: 87d96992ea am: 77b279df94
am: 2967412d36

Change-Id: I964dbe0f850d3e7da23d1a07b9f65fa54043986b
2016-09-17 00:53:30 +00:00
chchao
37ee5c796e In AccessibilityGestureDetector.clear(), dispatch a MotionEvent.ACTION_CLEAR event to mGestureDetector to cancel the ongoing gesture.
b/30706806

Change-Id: I78954e5484d8deda2dadb7c0ae7e05d5c6b734f2
2016-09-14 17:15:35 -07:00
Phil Weaver
af5d0765db Change users without crashing a11y services.
Accessibility services crash when changing users for several
reasons. we were looking up permissions for the current
user, which wasn't the user who created the service. We also
end up resetting the accessibility state, which reads user-
specific settings and thus must be done with the calling
identity cleared.

Bug: 27594523
Change-Id: I2b910d77704a6054b3a591c38f54d3ed3a2dc427
2016-09-14 19:21:20 +00:00
Phil Weaver
87d96992ea Fix bug in magnification coordinate calculation.
We were checking if a coordinate was inside its window before
compensating for magnification.

Bug: 31054088
Change-Id: I4993d84e877fcf3d01382b3cf1c10e2fab58dbba
2016-09-13 14:34:22 -07:00
Phil Weaver
b0f9f77768 Fix crash when user changes after a11yservice dies am: e797b84ed2 am: 575e714616
am: ecf0962a64

Change-Id: I138041bd7f6781fd4ceaec52dff5e2bb9125574a
2016-08-29 21:52:48 +00:00
Phil Weaver
1bb2cc8cc3 Merge "Revert "Dispatch a11y events in separate thread."" into nyc-mr1-dev 2016-08-25 18:05:36 +00:00
Phil Weaver
5de2feab26 Revert "Dispatch a11y events in separate thread."
This reverts commit c34649411d053185b3572c4cd924e6f14295d8cd.

Dispatching accessibility events in their own thread is causing Chrome and gmail to crash. We've identified two issues: Chrome is allocating strings natively using references that aren't valid outside of their thread, and the text is being set to values that are changed in the UI thread. 

I'm going to resolve these issues on master by making deep copies of the strings, but that change will have its own performance implications.

Since we were bit almost immediately by an unexpected result of this change, and I need to erode its benefit by making deep copies, I think it's a bad bet to push it into MR1.

Bug: 31042124
Change-Id: I6f5c225a9197036db43fd0ac6008447b22617525
2016-08-25 16:31:25 +00:00
Phil Weaver
e797b84ed2 Fix crash when user changes after a11yservice dies
We were failing to create a death link for the service that
replaces the crashed a11y service. Adding an invariant that
mService is always linked to death if it is non-null.

Bug: 31044551
Change-Id: I98b6a3969cfacb0309e19938899a51c809249d6b
2016-08-24 17:30:46 -07:00
Phil Weaver
0dbf913d78 Merge ag/1290921 to master.
Original commit:
Dispatch a11y events in separate thread.

Moves the IPCs into a separate thread, where they should affect
jank a lot less.

Bug: 30183085
Change-Id: I7bc8a777fe76dd76f661cc3e3e1d45a2a28df0d2
2016-08-23 09:27:04 -07:00
Phil Weaver
c34649411d Dispatch a11y events in separate thread.
Moves the IPCs into a separate thread, where they should affect
jank a lot less.

Bug: 30183085
Change-Id: Ib76159d158e7a867e76cdd5c8ea3a318949fcc5b
2016-08-19 09:22:10 -07:00
Phil Weaver
669340c785 Merge "Add null check in key event handling." 2016-08-18 15:50:37 +00:00
Phil Weaver
7f7588d3fb Restart accessibility services after they update. am: 1e6695bbd4 am: fff4a144de
am: f49d1bab46

Change-Id: I27d86acb98d9cf19f89af036202af9b0a911eea6
2016-08-18 01:01:17 +00:00
Phil Weaver
771f9aefdc Add null check in key event handling.
Bug: 30866905
Change-Id: I4bc4c984026d7d2be594b816e3d6de60410970ef
2016-08-17 17:52:38 -07:00
Chong Zhang
921f8e35d8 resolve merge conflicts of 9391bc5 to master
Change-Id: I6de231781233826b399688dc8ead70ba515b1ccb
2016-08-17 14:38:12 -07:00
Phil Weaver
fff4a144de Restart accessibility services after they update.
am: 1e6695bbd4

Change-Id: I10714ce8ebc0b9ca6dd206a4a11e283704d668ae
2016-08-17 20:56:02 +00:00
Phil Weaver
ee4ff424ea Merge "Restart accessibility services after they update." into nyc-mr1-dev 2016-08-17 20:52:06 +00:00
Chong Zhang
5e09ceb641 Add new window type TYPE_DRAWN_APPLICATION
am: fea963edee

Change-Id: If7acf1349b87d4be88a9b4f9fbd984bbd4aca8ad
2016-08-17 17:16:18 +00:00
Phil Weaver
1e6695bbd4 Restart accessibility services after they update.
In ag/1273924, we stopped restarting services that were
still bound. When the package changes, however, the system
unbinds from a service and has no way to tell us that it is
not going to restart it (as it would if the service
crashed.)

Now we listen for package updates and unbind affected
services. The services will then be restarted as there will
be enabled services that are no longer bound.

Bug: 30866905
Change-Id: I375edfd6a37ed25f959ec354930cec8f288deb6b
2016-08-16 16:51:45 -07:00
Chong Zhang
f925b8df92 Merge "Add new window type TYPE_DRAWN_APPLICATION" into nyc-mr1-dev 2016-08-16 19:49:29 +00:00
Phil Weaver
2a0e48aaf5 Add null check to KeyEventDispatcher.
Make sure we don't try to dispatch key events to services
that have died. Doing so crashes the device.

Bug: 30866905
Change-Id: I1cc0515cca8924b0c2744de98ac75a901b94246d
2016-08-15 17:49:55 -07:00
Chong Zhang
fea963edee Add new window type TYPE_DRAWN_APPLICATION
This type behaves like a normal TYPE_APPLICATION, except that WM
will always wait for it to be drawn before starting a transition.

WM always waits for TYPE_BASE_APPLICATION (main window), but for
TYPE_APPLICATION, it only waits if the window relayouts to visible
and gets a surface before the main window is drawn. If main window
itself is ready very fast, transition could start without the other
window.

bug: 30830849
Change-Id: Ife71a9812db7c8eba6ee4ead10ce4f31d9e93b40
2016-08-15 17:36:40 -07:00
Phil Weaver
30cf918c4b Limit capabilities of a11y gesture dispatch. am: a8918f23c7 am: 0e97bb6c1a
am: 3d40beacfd

Change-Id: I006b848679d7e605740e1e1e9eecddad7878873b
2016-08-11 21:11:57 +00:00
Phil Weaver
0e97bb6c1a Limit capabilities of a11y gesture dispatch.
am: a8918f23c7

Change-Id: I8c14c8b8ada7e7c53b17be2df63c14c4e0e10c83
2016-08-11 20:53:44 +00:00
Phil Weaver
364580d20a Merge "Limit capabilities of a11y gesture dispatch." into nyc-mr1-dev 2016-08-11 20:35:12 +00:00
Phil Weaver
a8918f23c7 Limit capabilities of a11y gesture dispatch.
Changing the service side to accept descriptions of
motion events, not motion events themselves, so we can
control their creation.

Bug: 30647115
Change-Id: Ia6772a1fc05df91818e3f88959d1e2b4a35fe0cc
2016-08-08 10:23:17 -07:00
Phil Weaver
ba5b372d96 Improve handling of crashing a11y services. am: a8cfb3733d am: 32c6f10a7f
am: 5468790629

Change-Id: I34570f56688194857b61cf7163dfcf5494019c2a
2016-08-05 23:55:25 +00:00
Phil Weaver
32c6f10a7f Improve handling of crashing a11y services.
am: a8cfb3733d

Change-Id: I303d1dfdb328b787b4315d846dfb4d9bbc747b75
2016-08-05 23:44:40 +00:00
Phil Weaver
f861b916e4 Merge "Improve handling of crashing a11y services." into nyc-mr1-dev 2016-08-05 23:28:48 +00:00
Phil Weaver
0b59a14311 Only filter a11y motion events if needed. am: dc5dedeaa2 am: a83d1ca796
am: 7bd4a5a36f

Change-Id: I6bffe258d2e7cdfb78070a242b37f34da38c5287
2016-08-05 01:14:40 +00:00
Phil Weaver
dc5dedeaa2 Only filter a11y motion events if needed.
We've seen some jitter in motion events with accessibility
enabled. We can eliminate it by not passing motion events
through the filter if we know they won't be affected.

Bug: 30183085

Change-Id: I0ecc8d5a39c8e370fc3a8ab85c6357251a31f8ad
2016-08-04 15:58:44 -07:00
Phil Weaver
a8cfb3733d Improve handling of crashing a11y services.
We were confusing handling of services that were unbound with
those that had crashed. We would lose track of services that
has crashed, start new ones, and then when the system restarted
a killed services we would have multiple instances running. It
was possible for this to get very out of hand.

Bug: 30306689
Change-Id: I4e63d25b6d2fec3ec68f450a4602898c43a2b2ad
2016-08-04 15:45:13 -07:00
Phil Weaver
140df85b13 Merge "Add tests for accessibility motion event injector." 2016-07-20 16:45:47 +00:00
Svetoslav Ganov
f6d56f92ff Merge "Update windows before sending a window state change event" 2016-07-18 21:54:14 +00:00
Phil Weaver
a7dcedc65f Add tests for accessibility motion event injector.
Change-Id: If871f0a67d9265683fcbbabea382d54f3898a4c5
2016-07-15 14:35:35 -07:00
Justin Klaassen
290c38567e Merge \\"Refactor display color transforms\\" into nyc-mr1-dev am: 94673f0b7c
am: 5f3bf63121

Change-Id: I06a60ef4a1fa23e0c1f5b6ab97462811b6aaf239
2016-07-14 20:09:52 +00:00
Justin Klaassen
22eb19939d Refactor display color transforms
- Removed Secure.ACCESSIBILITY_DISPLAY_COLOR_MATRIX, it's not desirable
  to persist the actual color transformation matrix.
- Refactored all SurfaceFlinger transforms to DisplayTransformManager,
  which allows color transforms to be set independently from the a11y
  manager service.

Bug: 30042357
Change-Id: Iefa477dedb66aac90e1218e327802a3fab6899ed
2016-07-14 11:28:07 -07:00
Svetoslav Ganov
fd138896d5 Update windows before sending a window state change event
Change-Id: Ie25b75ccc739dcacbbffd2b3a32fe65086882c64
2016-07-14 01:24:37 +00:00
Phil Weaver
8c1e36b440 Add tests for KeyEventDispatcher.
Some minor but needed changes to the class under test to
gain visibility for tests to do things like make events
on Handlers happen on demand to verify various event ordering.

Change-Id: I5096de697906f8d28b47f47dc2be2f8199ee4e19
2016-07-01 15:57:42 -07:00