Commit Graph

616 Commits

Author SHA1 Message Date
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
Ryan Lin
bf82de29cf Merge "Fix didn't bypass touch events with non-empty passthrough Region" into rvc-dev 2020-04-28 02:43:59 +00:00
Minche Li
4ce06dff0a Merge "Adjust down event location when two-finger dragging in TouchExplorer" into rvc-dev 2020-04-28 01:43:57 +00:00
sallyyuen
93edd11724 Fix system action API issues in SystemActions
1) Actions are only registered when the service starts. If the locale
changes, the labels need to be translated, so re-register the actions
when this happens.

2) When its shortcut isn't visible the a11y menu action is a no-op. The
list should be an accurate representation of what actions are available.
Pass SystemActions into NavigationBarFragment, which keeps track of the
shortcut availability,  to unregister/register the action.

To do this, SystemActions exposes register/unregister to the fragment
and makes SYSTEM_ACTION_ID_ACCESSIBILITY_MENU public.

3) Remove Toggle Split Screen from SystemActions. The trigger isn't
system-level but is rather buried in the Recents UI in a button for each
app, and the a11y user can access this like everyone else.
SystemActionPerformer will still handle the legacy action call in
performSystemAction.

4) Rename "Accessibility Menu" to "On-screen Accessibility Shortcut"

Bug: 152636060, 152635646, 154833492
Test: Manual TalkBack test
Change-Id: I9b037f91c8d3b6f193fc9aee95ef73b7f3fbf315
2020-04-27 13:05:57 -07:00
ryanlwlin
5534ac32da Fix didn't bypass touch events with non-empty passthrough Region
When the action down motion event contains in the
mTouchExplorationPassthroughRegion, Touchxplorer didn't bypass the
motion event due to enabled multi-finger gesture.

Bug: 152597224
Test: manual test with set mult-finger-gesture enabled non-empty
      passthrough region
      atest CtsAccessibilityServiceTestCases:TouchExplorerTest
      atest FrameworksServicesTests:TouchExplorerTest
Change-Id: Ifef6a4da98aca8144bfd6deaceb1a110cfdbe5df
2020-04-27 20:00:31 +08:00
mincheli
004bed2801 Adjust down event location when two-finger dragging in TouchExplorer
The bug is happened because the slope between the down event and the
move event of the swipe gesture dispatched from TouchExplorer is
not smooth. So we also ajust the down event position as the moving
event. And we will update the corrupted CTS test case later.

Bug: 152931647
Test: none
Change-Id: I4d4b1ff2975f440dad0babb87d0af1b6ce348f93
2020-04-27 11:07:53 +08:00
Bernardo Rufino
78b06a4129 Merge "Allow sysUI to send a11y events for other package and user" into rvc-dev 2020-04-24 12:16:07 +00:00
Jason Hsu
ea2d4bf1fd Merge changes from topic "rhedjao_a11y_button_rollback" into rvc-dev
* changes:
  Rollback chooser menu to version Q behavior for accessibility button (2/n).
  Rollback chooser menu to version Q behavior for accessibility button (1/n).
2020-04-24 03:07:39 +00:00
Jason Hsu
f6e6cb119e Merge changes from topic "rhedjao_a11y_button_rollback" into rvc-dev
* changes:
  Rollback the changes of a11y button
  Migrates the navi-bar magnification setting key
2020-04-24 03:07:39 +00:00
Peter_Liang
0589ab0ae3 Rollback chooser menu to version Q behavior for accessibility button (2/n).
Allow separate Activities to handle the multiple-target case for the hardware and software shortcuts. Migrate from an extra to an explicit class so the Intent dispatch will launch the correct Activity for the particular shortcut.

Bug: 151294664
Test: manual test
Change-Id: I54bb1d3ab91e2757c465e8763786d0234f6d4ea8
2020-04-23 16:25:17 +00:00
Bernardo Rufino
c7988a90c7 Allow sysUI to send a11y events for other package and user
As discussed, we:
* Allow apps with INTERACT_ACCROSS_USERS(_FULL) to specify an explicit
user (instead of just USER_CURRENT).
* Introduce new signature permission ACT_AS_PACKAGE_FOR_ACCESSIBILITY
and grant it to sysUI. This permissions allow holders to specify another
package on behalf of which they can perform a11y operations.

This is for toasts since now sysUI renders toasts on behalf of the app
for apps targeting R+.

Bug: 152839254
Test: atest FrameworksServicesTests:AccessibilitySecurityPolicyTest
      FrameworksServicesTests:AccessibilityWindowManagerTest
      android.widget.cts.ToastTest
Change-Id: I3541045d574518571f348051d53e24ff1a4a67ef
2020-04-22 17:23:52 +00:00
Jacky Kao
538ee89f2b Merge "Obtain correct screenshot based on device orientation" into rvc-dev 2020-04-22 00:19:35 +00:00
Jacky Kao
333de4e7c3 Obtain correct screenshot based on device orientation
When taking the screenshot, passing the width and height
of the display, and the rotation according to the current
device orientation.

Bug: 153173726
Test: a11y CTS & unit tests
Test: manual test
Change-Id: I19eea2046da282155719b1dfdf9a3f53ad95e13b
2020-04-22 00:19:12 +00:00
Miranda Kephart
44cc1e274b Merge "Add screenshots logging" into rvc-dev 2020-04-21 16:58:54 +00:00
Winson Chung
18c1d27df9 Merge "Add shell command to trigger global action" into rvc-dev 2020-04-21 03:26:56 +00:00
Winson Chung
0f3a378bb5 Add shell command to trigger global action
Bug: 150817783
Test: adb shell cmd accessibility call-system-action <id>
Change-Id: Iaa85b7ada85d39305300b56b1a3725fcbfee4e95
2020-04-20 15:09:48 -07:00
sallyyuen
867c6d2786 Support sending KEYCODE_HEADSETHOOK KeyEvent from an a11y service
Add a private global action to be made public in S. A service can
trigger the event by calling performGlobalAction(10) in R.

Note: Currently 10 is being used by SystemActions for the Accessibility
shortcut. Update ag/10921262 to avoid a conflict.

Bug: 154038741
Test: Tested with modified TalkBack and Youtube play/pause
Change-Id: I3ca5d25948bfb3eb8520030484cb466ec7188784
2020-04-20 12:21:21 -07:00
Miranda Kephart
7b2c313da7 Add screenshots logging
Bug: 150710005
Test: manual
Change-Id: I54a37eb0a62234c6c53fc0f3c80e18e9ee269f12
2020-04-17 13:28:23 -04:00
Sally Yuen
1fb728d78e Merge "Revert "Laziliy initialize SystemActionPerformer"" into rvc-dev 2020-04-16 20:26:47 +00:00
Sally Yuen
73a4b26307 Revert "Laziliy initialize SystemActionPerformer"
This reverts commit d3ef403fc3.

Reason for revert: b/153947446
Bug: b/153947446, b/145909124

Change-Id: Idbab007a5e91361c019e206e37925656e710625f
2020-04-16 20:26:32 +00:00
Rhed Jao
8fcba0353e Fixes long press the a11y shortcut no response
An a11y service targeting sdk version > Q and requesting a11y button
should be turned on by the Settings when it's assigned to the a11y
shortcut by the user. An a11y button callback is sent to the a11y
service when the user long press the a11y shortcut.

This issue happened when an disabled a11y service is assigned to the
a11y shortcut, and upgraded to the target sdk version > Q. Framework
fails to send the callback and no response when user long press the
shortcut.

Turns on the a11y service and show up a toast to fix this issue.

Bug: 153517972
Test: atest AccessibilityShortcutControllerTest
Change-Id: Ie4fc9bbeaf08ba674cfe6382eab214b2a15c004c
2020-04-16 12:14:23 +08:00
Rhed Jao
d15058df55 Rollback the changes of a11y button
Single tap the a11y button should launch the shortcut target
or chooser activity if there are multiple targets assigned to
the a11y button and user does not specify one.

Rollback the channges of ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
and support a new setting key ACCESSIBILITY_BUTTON_TARGETS for
a11y button to maintain a list of targets which is assigned by
user in settings app.

Also, fix some potential issues, such as, disable a11y shortcut
(this is already not supported) and have more checks to verify
a11y button setting value when an a11y service package updated.

Bug: 152264133
Test: atest AccessibilityUserStateTest
Test: atest AccessibilityShortcutTest
Test: atest AccessibilityButtonSdk29Test
Change-Id: Ief7f44cb85eb75b45dc6ffb6e9a967b792959858
2020-04-15 18:02:56 +08:00
Qasid Sadiq
693c69ca30 Merge "Use current user isntead of system user if no --user parameter is passed" into rvc-dev 2020-04-08 20:40:11 +00:00
Qasid Ahmad Sadiq
d0129ce59b Use current user isntead of system user if no --user parameter is passed
This is relevant when running cts tests in instant mode.
Certain tests were failing in non-system users in instant mode, which is particularlly consquential to auto.
THis fix will be cherry-picked back to their repo
Test: CTSAccessibility*, in both instant/non-instant, and with both system and secondary users.
Bug:146218533

Change-Id: I89937bd552d372adc5d96c51b24d1a2bb4a034e3
2020-04-08 01:51:05 -07:00