Commit Graph

643 Commits

Author SHA1 Message Date
Ameer Armaly
5e27076f33 [DO NOT MERGE ] Stop setting flag to enable two-finger passthrough swipes. am: 0295f94356
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12792551

Change-Id: I06eb8c5ac72bc34032324c0811ebc90b869bc93e
2020-10-13 20:51:02 +00:00
ryanlwlin
bf402bd698 [DO NOT MERGE] 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 gesture into unexpected state.

Test: manually
Bug: 162521649
Change-Id: I527f3e785ee1082f86ef1a60e57ccd825bdfeae9
2020-10-13 20:14:56 +00:00
Ameer Armaly
a070cca5e2 [DO NOT MERGE] MultiFingerSwipe: scale touch slop to number of fingers.
Bug: 162521649
Test: manual
Change-Id: I990693ac07f4653f7d8ff9c097b5720593235afb
2020-10-11 08:04:43 -07:00
Ameer Armaly
be8a943e46 [DO NOT MERGE] 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-10-11 08:04:43 -07:00
ryanlwlin
81570aa5ad [DO NOT MERGE] 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-10-11 08:04:43 -07:00
ryanlwlin
dd8ef30adf [DO NOT MERGE] 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-10-11 08:04:43 -07:00
Ameer Armaly
217bb3b1d2 [DO NOT MERGE] 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-10-11 08:04:43 -07:00
Ameer Armaly
a7da0f4f6d [DO NOT MERGE] Require both fingers to move before starting two-finger passthrough.
Bug: 162521649
Test: manual
Change-Id: Ia6b7bf84fd0c7777f21afbd0e0c09bf3f4a10fb2
2020-10-11 08:04:42 -07:00
Ameer Armaly
aa25d2041f [DO NOT MERGE] 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-10-11 08:04:42 -07:00
Phil Weaver
1f49d41a6a [DO NOT MERGE] 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-10-11 08:04:42 -07:00
Phil Weaver
c39597b634 [DO NOT MERGE] 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.
Change-Id: I4ac5023ef9b5c101748b870a01a425a1365fb85c
2020-10-11 08:04:42 -07:00
Ameer Armaly
abfaf269a9 [DO NOT MERGE] Enable two-finger passthrough swipes.
Bug: 162521649
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: I9e6b691295a0fa006578d7b8ad8468579c66939c
2020-10-11 08:04:42 -07: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
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
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
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
Catherine Shi
0c1b921923 linkToDeath exception cause system server crash
java.util.NoSuchElementException: Death link does not exist

when linkToDeath has remote exception, unlinkToDeath will fail and
throw NoSuchElementException, catch it in AbstractAccessibilityServiceConnection
to avoid system server crash.

Bug: 157580692
Test: manual
Change-Id: I42ce3a458e04539d76555679279d1368e0c61ae0
2020-07-09 15:11:28 -07:00
ryanlwlin
1145db5d8e [DO NOT MERGE] Clear properties after interaction is ended
The properties populated when double-tap and hold is detected is not
cleared after interaction end. It cuases an offset on hoverevent.

Bug: 160463594
Test: atest TouchExplorerTest
Change-Id: Id5115fe64e4bda9c7657f67bef62290858442de9
2020-07-08 09:39:51 +08:00
Ameer Armaly
b8544eab9f [DO NOT MERGE] Fix NPE from uninitialized object.
Bug: 159941636
Test: atest TouchExplorerTest
Change-Id: I691bf74ad35bb1af2776e3e6c7212dfbac9fa9fe
2020-06-26 14:04:55 -07:00
Ameer Armaly
4b8fac016d [DO NOT MERGE] TouchExplorer: do not use accessibility action to long click.
This got overlooked during the initial revert.
Bug: 159941636
Test: atest TouchExplorerTest

Change-Id: I257852d69e299c7f0302d15b23d96f302f922005
2020-06-26 14:04:46 -07:00
Ryan Lin
18905eb623 Merge "Fix the multi-fingers gesture conflict with TouchExplorer" into rvc-dev 2020-06-24 08:51:50 +00:00
ryanlwlin
2047cd4ba1 Fix the multi-fingers gesture conflict with TouchExplorer
TouchExplorer supports multi-finger gestures from R. However,
FullScreenMagnificationGestureHandler has higher priority of
receiving motion events than TouchExplorer. When the screen is
zoomed in, two pointersdown gesture makes it transiting to
PanningScalingState.

To fix it, We post a tap tmeout to transit to PanningScalingState
when receiving two pointers down. In this duration, any pointers
action will make it transiting to DelegatingState. We also add
a condition that is if the movement of any fingers exceeed the
touchSlope, it will transit to PanningScalingState.

Bug: 159508732
Test: atest FullScreenMagnificationGestureHandlerTest
atest MagnificationGestureHandlerTest

Change-Id: Ic72c0da68a6a4f1714da8d05f743d6218793a5da
2020-06-24 13:46:05 +08:00
Ameer Armaly
9e83d07824 [DO NOT MERGE] Bring back touch events for double tap and double tap and hold.
Bug: 159168795
Test: atest TouchExplorerTest
Change-Id: I427b98c71ce8a2ac5b9285b2f34c1864f48c4a32
2020-06-22 13:58:51 -07:00
ryanlwlin
1f913ea0dc Fix Hard to detect multi-finger multi-tap
The double-tap/touch slope is from system's double-tap detector.
This threshold is too narrow for multi-finger multi-tap. It ends up
canceling the detection when the movement exceed the slope.

We adjust the slopes by multiplying the target finger count.
The maxium slope in 4 fingers is around 4.48 mm is smaller than
the swipe threshold (1 cm)
Bug: 158725482
Test: atest GestureManifoldTest
atest TouchExplorerTest
atest AccessibilityGestureDetectorTest

Change-Id: If0927d15d61a9682da67721d0bf0bbbc1045078b
2020-06-22 11:24:17 +08:00
Jacky Kao
39e7cdc2b9 Make A11yServiceConnection PendingIntent immutable.
Require that the PendingIntent be immutable so that a malicious app is
not able to hijack and mutate any of the details.

Bug: 154913130
Test: a11y CTS & unit tests
Change-Id: Ib794fa9e80b2a6c5562c66a0c17ea7c92c500e19
(cherry picked from commit a0b630075a)
2020-06-10 23:44:06 +00:00
ryanlwlin
4ec7b5c3fb DO NOT MERGE: Map TYPE_TRUSTED_APPLICATION_OVERLAY to system window type for A11y
TYPE_TRUSTED_APPLICATION_OVERLAY is a system window type used in
Bubble. We map it to system window type for AccesibiltiyWindowInfo

Bug: 158066152
Test: Enable bubble window and observe its type of
AccessibilityWindowInfo

Change-Id: I597d360a79fc61dbf4a3d713004272d33d40e576
2020-06-04 16:04:06 +08:00
ryanlwlin
779b7a09c5 Fix Magnification Settings didn't restore via D2D transfer
ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED is replaced
with ButtonTargets setting value. We address it in data migration but
not in D2D

Consider D2D, we restore it to ButtonTargets value when the restored
sdk version of the received intent is below R.

Bug: 155943759
Test: manual test
     1. prepare an Android Q device and an Android R device
     2. backup settings value of Android Q device by the google account.
     3. Launch setupwizard to restore it by the google account.
Change-Id: I5df070dd1ef880ac1ee5c0867b42e88782348a1b
2020-05-29 11:30:15 +08:00
ryanlwlin
0a62017612 Fix Accessibility Menu setting is not restored by D2D
From Android R, we add ButtonTargets settings value for the shortcut feature.
It has dependency with enabled services requesting the Accessibility
button. In D2D case, we don't update it.

We mirgate the ButtonTargets value if enabled services are changed by D2D.

Bug: 156459064
Test: manual test:
     1. prepare an Android Q device and an Android R device
     2. backup settings value of Android Q device by google account.
     3. Launch setupwizard to restore it by google account.
Change-Id: I8924171162be84f9a24ca3ea124234118b1183f5
2020-05-27 20:13:39 +08:00
Ameer Armaly
cee5a21750 Merge "GestureManifold: fix null pointer exception in onGestureCompleted." into rvc-dev 2020-05-21 20:24:30 +00:00
TreeHugger Robot
2a5f86f78c Merge "MultiFingerMultiTap: reset the expiration clock when fingers go up." into rvc-dev 2020-05-21 00:06:47 +00:00
Ameer Armaly
b4eb89e468 MultiFingerMultiTap: reset the expiration clock when fingers go up.
We were resetting the expiration clock every time a finger went down, but were not resetting it when fingers went up. As a result the user had a super narrow window to get all the fingers up before the gesture canceled.
Bug: 156880174
Test: atest GestureManifoldTest
Change-Id: I81dd9cd67729cfae38952d44295c3340c5426028

Change-Id: I1b6323ac413bcbd46fd9292fbb4cf7ebdf2b6246
2020-05-20 14:48:52 -07:00
Jacky Kao
167804a645 Bubble's change could notify to A11y framework
The virtual display of the activity became private and A11y framework
won't track the windows of the private virtual display. Then the change
of bubbles using the activityView could not be notified to A11y
framework.

Due to the bubbles created from system ui, we made the private virtual
display created from system ui could track its windows.

This is the short term solution, and only phases in rvc-dev branch. We
plan to track all private virtual displays as the long term solution at
master branch, but need to avoid this issue happened again, b/148760652.

Bug: 156685691
Test: a11y CTS & unit tests
Change-Id: I7a7e3d6040ce05f5d3769c14d34f906d8042c473
2020-05-20 15:52:38 +08:00
Ameer Armaly
3921cf7a9d GestureManifold: fix null pointer exception in onGestureCompleted.
Bug: 156987027
Test: atest GestureManifoldTest
Change-Id: I235d6ad6027960eb53ae89379e654dc32e2a65ff
2020-05-19 16:34:17 -07:00
TreeHugger Robot
9933478ea0 Merge "Avoid launching activity-based feature to force stop exist actiivty and recreate it." into rvc-dev 2020-05-16 01:09:05 +00:00
Rhed Jao
a0b9a209e1 Merge "Removes shortcut target when an a11y service is unbound" into rvc-dev 2020-05-15 01:52:23 +00:00
Rhed Jao
2d8bdb146a Removes shortcut target when an a11y service is unbound
The accessibility button and shortcut target is updated by
the Settings app when the user turn on/off the a11y service.
It worked fine before an a11y service disables and turns off
itself using disableSelf api. The accessibility button and
shortcut settings can not get update in this case. Removes
shortcut target if an a11y service is unbound to fix this
issue.

Bug: 156237174
Test: atest AccessibilityShortcutTest
Change-Id: Ie15f7fe06644bd35d30d87383b25df81bf29056d
2020-05-14 21:14:43 +08:00
Ryan Lin
22eadd2455 Merge "Swipe: use event times to check for expiration rather than handlers." into rvc-dev 2020-05-14 07:51:52 +00:00
menghanli
038488eab5 Avoid launching activity-based feature to force stop exist actiivty and recreate it.
Root cause: FLAG_ACTIVITY_CLEAR_TASK would cause the exist activity are finished and new one items to be started. It causes Live Transcribe main activity goes onStart call of new activity is followed by onStop call of old activity, which cause the mic stopping.

Solution: Remmove the FLAG_ACTIVITY_CLEAR_TASK.

Bug: 156455425
Test: Manual test
Change-Id: Ia5c490cc4816fe41b704ca8ed9dce2891cf44c9b
2020-05-14 10:32:46 +08:00
Minche Li
179321d5c7 Merge "Removes the a11y service from the cached service list when onPackageRemoved" into rvc-dev 2020-05-13 02:31:50 +00:00
mincheli
2b76abd763 Removes the a11y service from the cached service list when onPackageRemoved
The disabled a11y service is not removed from the cached service list
when the a11y service package is uninstalled.
To fix it, we have to remove the service from the service list.

Bug: 153507990
Test: manual test & adb shell dumpsys accessibility
Change-Id: Ic1d2ebe3a46faf7237123bcdfca96c79b2c35705
2020-05-12 17:54:51 +08:00
Ameer Armaly
b16b4486df Swipe: use event times to check for expiration rather than handlers.
This is a return to the original logic of the unified gesture detector.

Bug: 153584696
Bug: 153715903
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: I384ade72efa2971476561fe6e19cafbebb012c85

Change-Id: Ibaf2fe73632ff89a0f187fe58d60bbfe71da2206
2020-05-11 16:20:49 +08:00
Jason Hsu
5c8f27a56e Merge "Logs accessibility shortcut behavior." into rvc-dev 2020-05-10 03:06:30 +00:00
jasonwshsu
d9aa03245c Logs accessibility shortcut behavior.
* Uses the atom AccessibilityShortcutReported in westworld.

Bug: 151285965
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive 266
Change-Id: Iba9d829ae35c7a336c38007101bdddfcd3dc2ddb
2020-05-09 22:31:05 +08:00
Qasid Sadiq
d59670170f Merge "Give AccessibilityServices System Capabilities." into rvc-dev 2020-05-07 23:43:57 +00:00
Qasid Ahmad Sadiq
b8e8c095dd Give AccessibilityServices System Capabilities.
For now, this CL is for a conversation on how to give AccesibilityService particular capabilities.

Fixes: 154954447
Test: atest CTSAccessibility*.
Change-Id: I2e47d9a94fda04e60a5eb15a1ec54479c9322b1e
2020-04-29 23:34:47 -07:00
Sally Yuen
12a32f35d7 Merge "Initialize SystemActionPerformer lazily" into rvc-dev 2020-04-28 19:39:48 +00:00
sallyyuen
8146d24d04 Initialize SystemActionPerformer lazily
System health tests indicate regressions.

Bug: 145909124, 154547990
Test: builds
Change-Id: I855dc18ed68ba6cb98e7d921e3f25e4dee147fcb
2020-04-28 10:11:21 -07:00