Commit Graph

736 Commits

Author SHA1 Message Date
Ryan Lin
9f706792cb Merge "Move magnification-relatd stuff to MagnificationController" 2020-09-28 04:56:48 +00:00
ryanlwlin
7c2a525ec0 Move magnification-relatd stuff to MagnificationController
We moved most of magnification-related stuff to MagnificationController
to centeralize the common magnification logic and the interaction
between magnification modes.

Test: atest CtsAccessibilityServiceTestCases
      atest com.android.server.accessibility
      atest com.android.server.accessibility.magnification
Change-Id: I30face9d94a29844dfa1d4a98139628bf1d79fec
2020-09-23 22:51:30 +08:00
Ryan Lin
847994807c Merge "Make mirror window Accessible (1/2)" 2020-09-23 00:01:24 +00:00
TreeHugger Robot
45704f3173 Merge "Adding new A11y window type to A11y services" 2020-09-22 01:24:40 +00:00
ryanlwlin
8c1c511125 Make mirror window Accessible (1/2)
Hide all non-important child nodes and make the root
could the ability to get accessibility focus.

Test: manually test with Talkback
Bug: 143852371
Change-Id: I89155ce969e4688e5a07f0b427b0fe99626cfc8a
2020-09-21 13:26:16 +08:00
Ryan Lin
28a10589ef Merge changes Ic12d6d90,Iecd5e1bc
* changes:
  Implement transitn animation while switching the mode
  Change magnification animation callback (2/2)
2020-09-16 01:13:03 +00:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
ryanlwlin
379e238c6b Implement transitn animation while switching the mode
First we get the current center of magnification bounds and the scale,
then apply them after the disabling animation is completed.

If disabling animation is interrupted, we will fall back to previous
mode or force to switch the mode directly.

Bug: 161669184
Test: atest com.android.server.accessibility.magnification
      atest AccessibilityManagerServiceTest
Change-Id: Ic12d6d907f91bf251aa67a6ab959d4fbcf660f63
2020-09-15 15:07:36 +08:00
ryanlwlin
6c4ffacb47 Change magnification animation callback (2/2)
We send callback when the animation is canceled/reversed due to
the new quest while animating.

Bug: 161669184
Test: atest com.android.systemui.accessibility
      atest com.android.server.accessibility.magnification
Change-Id: Iecd5e1bcf0ac097d4271ff0d277872b1dab0c63d
2020-09-15 13:35:33 +08:00
Jeff Sharkey
487d394296 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I79488866c538bf9e76d0a6429e30262978f6fdab
2020-09-15 00:13:08 +00:00
Jeff Sharkey
10fc5bc904 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: Ic93fe142433b1aa9035a72031b80e875d14c9cc0
2020-09-14 10:00:16 -06:00
Jeff Sharkey
05e513d1c5 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I8aa4186f44957fc69aebceeeff1e6584b4eebd5a
2020-09-14 10:00:12 -06:00
mincheli
c58ce9a867 Prevents the broadcastReceiver unregistered when it's not registerd
WindowMagnificationManager monitors the screen state.
And when requestConnection(false) is called before
requestConnection(true), the broadcastReceiver would be unregistered
even it is not registered yet. And it may lead to crash.

Bug: 167804868
Test: atest WindowMagnificationManagerTest
Change-Id: Ib61b00afe79d21a5e944affe8c5492aef90f0399
2020-09-14 09:49:09 +08:00
TreeHugger Robot
1a1a8d4c61 Merge "UiAutomation supports new flag, FLAG_DO_NOT_USE_ACCESSIBILITY" 2020-09-11 13:01:30 +00:00
Jacky Kao
f5e820058b Adding new A11y window type to A11y services
Two window types, INPUT_METHOD and INPUT_METHOD_DIALOG are group
into a single A11y window type, TYPE_INPUT_METHOD, at A11y
framework such that A11y services could not do correct behavior
when the input method dialog shows. Splitting out the
INPUT_METHOD_DIALOG and mapping it to TYPE_APPLICATION to fix
this issue.

Bug: 154315649
Test: a11y CTS & unit tests
Change-Id: I263398b20e75f48afebbe8d002994a00a110abdc
2020-09-10 08:02:14 +08:00
ryanlwlin
e4d954337f Change magnification animation callback (1/2)
To handle the transition issue, we would like to add this callbck
both in full-screen and window magnification.

Bug: 161669184
Test: atest FullScreenMagnificationControllerTest
Change-Id: I590871386f885827126a1f21937780d3e6e918d0
2020-09-09 08:38:44 +08:00
mincheli
40c9baad6b UiAutomation supports new flag, FLAG_DO_NOT_USE_ACCESSIBILITY
UiAutomation should have an option not to engage accessibility.
go/uiautomation_not_use_a11y

Bug: 93087044
Test: atest UiAutomationManagerTest, atest CtsUiAutomationTestCases
Change-Id: Icc6c359844817a07869a18345fe44ef3b2813dae
2020-09-08 17:29:44 +08:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
ryanlwlin
56e0b8c4eb Fix Accidently trigger A11y button long pressed
We used the original down location while injecting all down events.
It accidently increases the velocity in the beginning and cause
Launcher detect the wrong gesture.

To fix it, we adjust the down time to real downTime.
Test: manually test
Bug: 165896230

Change-Id: I318dbc2af04298a21b9efe99278285911f56b1a0
2020-08-31 21:05:33 +08:00
Ryan Lin
568e05582c Merge "Add callback for enabling/disabling window magnification" 2020-08-28 00:08:34 +00:00
TreeHugger Robot
8a736d3718 Merge changes I990693ac,Ibcae2a5a
* changes:
  MultiFingerSwipe: scale touch slop to number of fingers.
  Use correct touch slop value for two-finger passthrough.
2020-08-26 16:46:52 +00:00
ryanlwlin
6045db95e6 Add callback for enabling/disabling window magnification
To support switching magnification mode, we add callback to know
when the animation is finished. We only invoke the newest callback
when the animation is end successfully or the spec didn't change

Bug: 161669184
Test: atest com.android.systemui.accessibility
      atest com.android.server.accessibility.magnification
      Enable window magnification to see if it works normally
Change-Id: I34ce39d133a000964d1089946b7bcf510a618b40
2020-08-26 17:35:13 +08:00
Minche Li
dcc92705fb Merge "Window magnifier state is incorrect after screen is off" 2020-08-26 06:24:12 +00:00
ryanlwlin
ae92e25ce8 Fix sometime couldn't trigger A11y button with 3-finger
We inject the down events from where we detect the 3-finger swipe
gesture. It may not trigger the A11y Button if the event is not inside
the system gesture detection area.

We inject the original down location to injection all down events.

Bug: 166187595
Test: manually test
Change-Id: I0c0f84047fc24e40724332d51d7e3dc414bd0186
2020-08-26 11:25:12 +08:00
Ameer Armaly
0d110b236b MultiFingerSwipe: scale touch slop to number of fingers.
Test: manual
Change-Id: I990693ac07f4653f7d8ff9c097b5720593235afb
2020-08-25 19:05:55 -07:00
Ameer Armaly
0b50ece33d Use correct touch slop value for two-finger passthrough.
Throughout the gesture system we scale the touch slop radius to the number of fingers that are down at any given moment. Therefore the correct value to
trigger two-finger passthrough should be 2 * mTouchSlop.
This should make three-finger taps less problematic.
Bug: 163438921
Bug: 162521649
Test: manual
Change-Id: I4b36b5575bf11ad767d83effd6292dc84eadb27d
Change-Id: I9fb9d58ef679151c9fc595bcb375f6209ea3a5af

Change-Id: Ibcae2a5a3fde37b97859165efabf2b0df13ded9b
2020-08-25 19:03:19 -07:00
mincheli
cf5cb8e2cb Window magnifier state is incorrect after screen is off
The root cause is that the enabled state is not updated when
screen is off.
So correct to use disableWindowMagnifier(displayId, false) to
disable window magnifier. And it can update the enabled state,
mEnabled, when it is called.

Bug: 163784304
Test: atest WindowMagnificationManagerTest,atest WindowMagnificationGestureHandlerTest
Change-Id: I62a5aeaf45a3df62ef995906f25129125b4e85d5
2020-08-25 16:36:25 +08:00
ryanlwlin
a67afd3c01 Fix hardly to perform 3-finger swipe from the bottom
We accidentky checked invalid pointers down position.
In stead of checking all pointers, we check the pointer ids
from the motion event.

Bug: 165576902
Test: manually test
atest TouchExplorerTest

Change-Id: Id530bf4b760351215726b2afd781433b590f57ce
2020-08-25 12:30:48 +08:00
Ameer Armaly
9f26ae917b Require both fingers to move before starting two-finger passthrough.
Bug: 162521649
Test: manual
Change-Id: Ia6b7bf84fd0c7777f21afbd0e0c09bf3f4a10fb2
2020-08-20 10:41:20 -07:00
Ameer Armaly
d3e6dd1741 Start dragging where the fingers initially went down.
This does not apply when transitioning from touch exploration to dragging.
Bug: 162521649
Test: manual

Change-Id: I92022ca0359040a6563e6a48c110face574dc9df
2020-08-20 10:41:20 -07:00
jasonwshsu
7f6998afe2 Update language to comply with Android's inclusive language guidance
1. Rename isClientInWhitelist to isClientInAllowlist

See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 162536543
Test: Build & run
Change-Id: If9c5a2599e13633d6e99993d857e2101b4e6e4ec
Merged-In: Ibbd97bf31915d59b5110cbcc8f2126f7a7221060
Merged-In: I915e09e4e64d5c268630cec2d0ef05ea0592fd6f
Merged-In: I499c4574464862f3a1dcea2c6d51813e23ba4b82
2020-08-20 07:22:25 +00:00
Jason Hsu
04ddd768c2 Merge "Update language to comply with Android's inclusive language guidance" into rvc-d1-dev-plus-aosp am: 8dc88a6a46
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12371144

Change-Id: I64a93918ba6206c48a2416e53c0320dae41f8ce2
2020-08-19 05:15:46 +00:00
Ameer Armaly
65929fd549 Merge "Fix edge swipe logic." 2020-08-19 00:48:38 +00:00
Kaiqiang Wang
98c1d9f2cd Merge "Fix AccessibilityEmbeddedHierarchyTest failure" 2020-08-18 23:57:09 +00:00
jasonwshsu
bde40af6ca Update language to comply with Android's inclusive language guidance
1. Rename isClientInWhitelist to isClientInAllowlist

See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 162536543
Test: Build & run
Change-Id: I915e09e4e64d5c268630cec2d0ef05ea0592fd6f
Merged-In: Ibbd97bf31915d59b5110cbcc8f2126f7a7221060
2020-08-18 18:11:47 +00:00
jasonwshsu
cfb9bd346c Update language to comply with Android's inclusive language guidance
1. Rename isClientInWhitelist to isClientInAllowlist

See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 162536543
Test: Build & run
Change-Id: Ibbd97bf31915d59b5110cbcc8f2126f7a7221060
2020-08-13 15:21:57 +08:00
Ameer Armaly
91fa64652e Fix edge swipe logic.
1) Only start delegating upon first move event, if all three fingers went down on the bottom edge.
2) The previous logic only required one finger to be in the edge boundary. It now requires all fingers to be in the edge boundary.
Bug: 162521649
Test: manual

Change-Id: I829c463c63b384642d129ff3b5ccdb0db816ddcd
2020-08-12 19:48:57 -07:00
Ryan Lin
b5722d5f0c Merge "Address drag unreliability during touch exploration" 2020-08-12 02:16:02 +00:00
Ryan Lin
ba91c6c33f Merge "Add WindowMagnificationAnimationController for animation" 2020-08-11 12:57:59 +00:00
ryanlwlin
d1ee3afab0 Fix AccessibilityEmbeddedHierarchyTest failure
The visiblity calculation of the embedded node relies on the parent
window bounds.Unfortunately, we report it only if the window is
covered by other windows.

We report it if this request is from an embedded hierarchy window.

Test: atest AccessibilityEmbeddedHierarchyTest on TV emulator
Bug: 155261657
Change-Id: I0033470cdeabf84dd2fa6158a9b7d46870aca556
2020-08-11 10:40:43 +00:00
Phil Weaver
86340be1a7 Address drag unreliability during touch exploration
The code was trying to set the location of the drag, but MotionEvent doesn't behave consistently when setting a single location to a multi-touch event.

All that's needed is to select the correct pointer, so removing messing with the location gives more consistent behavior.

Bug: 163105030
Change-Id: I6c315cf0a1e48847cc778ec8c34b382d13ce3555
Test: Manually testing at this point of the passthrough, and relying on treehugger.
2020-08-11 13:13:05 +08:00
Phil Weaver
c9b87c1daa Fix crash with multifinger touch exploration
Range check index into motion event x and y before using it.

Bug: 163107812
Test: Relying on treehugger. I can't reproduce the crash, so I'm just adding checks.
2020-08-08 00:37:19 +00:00
ryanlwlin
b2671ade8e Add WindowMagnificationAnimationController for animation
WindowMagnificationAnimationController provides same
functionality but it runs the animation while
enabling/disabling.

This new patch also fixs NPE excetion that happens
when device is in rotation but mirrorWindow is invisible.

Bug: 161669184 163026794 163035371
Test: atest com.android.systemui.accessibility
atest WindowMagnificationGestureHandlerTest
manual Test: enable window magnification to see it
        2. close mirroe window and rotate the device

Change-Id: I4531f5c96ea4b91b287cc8c5ffc4c98fc9611dd5
2020-08-07 15:06:23 +08:00
Ameer Armaly
2820f73943 Enable two-finger passthrough swipes.
Bug: 162521649
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: I9e6b691295a0fa006578d7b8ad8468579c66939c
2020-08-06 15:25:18 -07:00
Rhed Jao
7a6c8ce504 Merge "Fixes magnification settings did not restore" 2020-08-05 02:08:19 +00:00
Rhed Jao
e03de99a88 Fixes magnification settings did not restore
- A redundant a11y button migration was called during the period
  of enabled accessibility services restoring. It rewrited the
  settings of a11y button targets which is restored.
- User could enable a11y services in the SUW. Merges previous vales
  for a11y button targets after it's restored to avoid settings are
  lost.

Bug: 160752945
Test: atest AccessibilityShortcutTest
Test: Manual restore from SUW
Change-Id: If55f4839c6ab0c648a35d47c9032e4b9954c0d5c
2020-08-04 15:59:52 +08:00
ryanlwlin
9ec06e1229 Add callback for transition animation
To support transition animation while switching magnification mode,
We add the callback to know when the animation is finished.

Bug: 161669184
Test: FullScreenMagnificationControllerTest
Change-Id: I002e0a818a38d5928d98741284c68f6236745b6f
2020-08-03 12:46:49 +08:00
Ryan Lin
6fcbdf03b2 Merge "Add source bounds change callback" 2020-07-28 23:55:30 +00:00
ryanlwlin
d934df6bbd Add source bounds change callback
Add sourcebounds change callback so that A11yFramwork could know
the center. It is also for magnification public API callback

Bug: 161669184
Test: WindowMagnificationControllerTest
Change-Id: I08c1f9c6f9f5eb540d960c89388b93437d79871a
2020-07-28 12:53:46 +08:00
Ameer Armaly
4751228fc7 Bring back touch events for double tap and double tap and hold.
This CL includes all subsequent fixes that were caused by  the original change.
Bug: 159168795
Test: atest TouchExplorerTest
Change-Id: I416b90cf49a2804890246f2d52ee3a168059630f

Change-Id: Ibecc5f6cd1cdb682d1026869f6aa03da7f123e08
2020-07-15 09:42:20 -07:00