Commit Graph

535 Commits

Author SHA1 Message Date
Phil Weaver
a8486be97d Merge "Add tests for ending TouchExplorer dragging" 2020-02-03 18:41:41 +00:00
Ameer Armaly
b66d226377 One-finger swipe: remove unnecessary allocations.
Part of the old swipe code, which was copied over to the new swipe detector, used GesturePoint objects because it needed to track the time of each entry in the gesture path. This is no longer necessary because we use handlers to cancel the gesture on a delay. This change makes the whole class use PointF which avoids allocating a new PointF for some subset of the GesturePoints during the gesture recognition process.

Bug: 136131815
Test: atest GestureManifoldTest AccessibilityGestureDetectorTest TouchExplorerTest
Change-Id: I1c89122d7f27b52a25e777667e34fec246d5c21f
2020-02-02 03:56:29 +00:00
Ameer Armaly
8fa1dd2aad Add one-direction multi-finger swipes.
Bug: 136131815
Bug: 142277518
Bug: 142277280
Test: atest GestureManifoldTest AccessibilityGestureDetectorTest TouchExplorerTest
Change-Id: I3e6997c863d50e3f2d8638ca57b508676f0909a1
2020-02-02 03:56:05 +00:00
Phil Weaver
a5bfdb2df5 Add tests for ending TouchExplorer dragging
Increasing test coverage.

In the process, found a bug in dispatching up events for
multiple fingers. It was sending an action_up for each
pointer rather than a pointer up.

Bug: 148690104
Test: atest TouchExplorerTest
Change-Id: I04353bd4ad222d6bc4096a62de48b1fe00363b3a
2020-01-31 17:40:45 -08:00
Hongming Jin
6b62158ad5 Allow recents components to register/unregister system action.
Bug: 136286274
Test: atest AccessibilityManagerServiceTest
      atest AccessibilitySecurityPolicyTest
Change-Id: I8926f8c52995d6997c7ed601ebe30d1a1f209347
2020-01-29 13:38:08 -08:00
Dieter Hsu
3cbd098e7a Implement multi-finger multi-tap gesture matchers for accessibility
This matcher would detect following gestures when accessibility flag
flagRequestMultiFingerGestures enabled:

- 2-finger single tap
- 2-finger double tap
- 2-finger triple tap
- 3-finger single tap
- 3-finger double tap
- 3-finger triple tap

Bug: 142277684
Bug: 142276516
Bug: 136131815
Test: atest AccessibilityGestureDetectorTest TouchExplorerTest GestureManifoldTest

Change-Id: I0aa6e858520d0b36c81df6fe08fd86d7d0803d5a
2020-01-28 13:24:12 -08:00
Ameer Armaly
bb9b8d4d5a Add flag for services to request multi-finger gestures.
Bug: 136131815

Test: atest GestureManifoldTest AccessibilityGestureDetectorTest TouchExplorerTest
Change-Id: Ia6eac44f467963856ca7b8ba561794fa5e49b953
2020-01-24 15:41:52 -08:00
Ameer Armaly
ab60f20fda Add flag for accessibility services to request that double tap gestures be dispatched to the service.
When disabled, double tap and double tap and hold will be handled by the framework. Specifically, they will perform ACTION_CLICK and ACTION_LONG_CLICK on the item with accessibility focus.

Bug: 136131815
Test:  atest GestureManifoldTest TouchExplorerTest  AccessibilityGestureDetectorTest
Change-Id: I19f8f2650e383f136ae9f4d0423d86721c27265b
2020-01-24 15:41:52 -08:00
Ryan Lin
e21d279ba8 Merge "Gesture detection for window magnification (1/n)" 2020-01-21 02:48:56 +00:00
Charles Chen
eb0ebddc1a Merge "Split status bar window (1/N)" 2020-01-20 17:23:36 +00:00
Hongming Jin
60d32dbf5d Merge "API on AccessibilityService side to support customized system actions." 2020-01-17 19:09:11 +00:00
wilsonshih
e832194dd0 Split status bar window (1/N)
This is the first step to create another new window for status bar.

Small window => TYPE_STATUS_BAR: The bar on top of screen.
Large window => TYPE_NOTIFICATION_SHADE: Anything else.

Bug: 136993073
Test: build then flash
Test: atest WmTests SystemUITests
Test: atest RegisterStatusBarResultTest InsetsFlagsTest

Manual Test:
- Bouncer can show when leave showWhenLocked activity.
- StatusBar can show when comes HUN in fullscreen mode.
- StatusBar can play enter/leave animation in fullscreen mode.
- Able to drag notification panel when bubble/glow existing.
- Switch to market launcher, and run above tests.
- Drag notification panel from launcher several times and observe it
  works fine.

Change-Id: Id9f72cd0e21f01b50d57f02ea60f97c6460926b7
2020-01-17 15:33:56 +00:00
Rhed Jao
18dcc695de Merge "Fix a11y shortcut failed to be disabled by the warning dialog." 2020-01-17 08:11:56 +00:00
Ryan Lin
be69a3b62f Merge "Added an interface between Sysui and system_server" 2020-01-17 07:40:04 +00:00
Hongming Jin
8302c6cd85 API on AccessibilityService side to support customized system actions.
Test: atest AbstractAccessibilityServiceConnectionTest
      atest AccessibilityServiceTest
      atest AccessibilityManagerServiceTest
Bug: 136286274
Change-Id: I6810cc9d2fff3f81f76b63fb075a68973e9757c8
2020-01-17 01:35:27 +00:00
PETER LIANG
6c3d66e313 Merge "Fix intent extra into showAccessibilityTargetsSelection function." 2020-01-16 16:41:39 +00:00
Ameer Armaly
da9a56b5fb Merge "Single-finger multi-tap: complete immediately rather than after a delay." 2020-01-15 18:54:40 +00:00
Rhed Jao
f3fbcf5d43 Fix a11y shortcut failed to be disabled by the warning dialog.
Bug: 147330765
Test: atest AccessibilityShortcutControllerTest
Change-Id: I0eed04c7892a22be3721ca08562fb9121a257847
2020-01-15 21:44:22 +08:00
Peter_Liang
c856e032ed Fix intent extra into showAccessibilityTargetsSelection function.
AccessibilityButtonChooserActivity can't get the
  extra value to display the corresponding dialog.

Test: manual test
Change-Id: I551416ba206170ca3f21a7ac9537592440c31444
2020-01-15 21:42:03 +08:00
ryanlwlin
6259298cd8 Gesture detection for window magnification (1/n)
To change the gesturehandler easily for different magnification mode,
we rename MagnificationGestureHandler to FullScreenMagnificationGestureHandler
and add a common class MagnificationGestureHandler. We will create
different MagnificationGestureHandler based on magnification mode.

Bug: 146400227
Test:FullScreenMagnificationGestureHandlerTest
Test: AccessibilityInputFilterTest.java
Change-Id: Ib7a45300a1f1323e1005b89694bb66932b22ab1b
2020-01-15 21:18:57 +08:00
ryanlwlin
2cc1d117a8 Added an interface between Sysui and system_server
This interface is used to interact between system UI and system
server for winodow magnification. When magnification mode is window
mode, system UI will set the connection to AccessibilityManagerService
to manipulate window magnification.

Bug: 146400227
Test: WindowMagnificationConnectionWrapperTest
Test: AccessibilityManagerTest
Test: WindowMagnificationManagerTest
Change-Id: I64b22eac3a7be2e1dbced0573988fe75ace921f6
2020-01-15 17:24:43 +08:00
Jacky Kao
873cbc0e14 Merge "Implementing new API : takeScreenshot()" 2020-01-15 08:29:49 +00:00
Jacky Kao
09789e4168 Implementing new API : takeScreenshot()
Implementing the new API for A11y services to take the screenshot
of the specified display.
Bitmap takeScreenshot(int displayId)
1. The main codes is moved from the UiAutomationConnection class and
let the UiAutomation change to use this API.
2. Add a capability at metadata to check whether the A11y services could use this
API or not.
3. This API is a async one for A11y services, but is a sync one for
UiAutomation.

Bug: 10931661
Test: a11y CTS & unit tests
Change-Id: I478bd93c60d4742bef20ae0e423ca9de1bda55d2
2020-01-15 16:23:52 +08:00
Rhed Jao
70cb293d44 Merge changes from topic "A11yShortcut_NeedWithUi"
* changes:
  Accessibility shortcut improvement (10/n)
  Accessibility shortcut improvement (9/n)
  Accessibility shortcut improvement (8/n)
2020-01-15 07:22:32 +00:00
Jackal Guo
7fd8e937bf Merge "Support accessibility on embedded hierarchies (1/n)" 2020-01-15 05:40:36 +00:00
Ameer Armaly
bb3cb2dad2 Single-finger multi-tap: complete immediately rather than after a delay.
We will not be implementing single-finger triple-tap for now.

Bug: 136131815
Test: atest GestureManifoldTest TouchExplorerTest  AccessibilityGestureDetectorTest
Change-Id: I8a9bd62963bab86ba26bfa46e6f871105dca6d35
2020-01-14 16:49:04 -08:00
Rhed Jao
f526c9995b Accessibility shortcut improvement (10/n)
Update AccessibilityManagerService:
 - Enable multiple shortcut targets support for accessibility button.
 - Remove navibar magnification enabled setting key.

Bug: 136293963
Test: atest AccessibilityShortcutTest
Test: atest AccessibilityUserStateTest
Test: atest AccessibilityShortcutControllerTest
Change-Id: I69facd958307a22f3a0193dd769e595cef324f9f
2020-01-14 12:15:23 +08:00
Jackal Guo
79b182e752 Support accessibility on embedded hierarchies (1/n)
To support embedded hierarchies (leash):
1. Add new APIs for leashed child in AccessibilityNodeInfo.
2. SurfaceView needs to use this API to add such child when
   initializing the AccessibilityNodeInfo.

Bug: 137593247
Test: a11y CTS & unit tests
Change-Id: Ieaa57c6ad65f4c199175d929c3bcba7fb7e6ef26
2020-01-14 10:29:54 +08:00
Minche Li
b95dfee332 Merge "Add new switchToInputMethod API" 2020-01-13 02:31:53 +00:00
mincheli
850892b7fa Add new switchToInputMethod API
Make accessibility service able to set the current input method
for current user.

Bug: 145710994
Test: atest AccessibilitySoftKeyboardTest
   1. Get current enabled IMEs
   $ adb shell settings get secure enabled_input_methods
   com.google.android.googlequicksearchbox/com.google.android.voicesearch.ime.VoiceInputMethodService
   com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME
   2. Get current default IME
   $ adb shell settings get secure default_input_method
   3. Set current default IME
   $ adb shell settings put secure default_input_method
     com.google.android.googlequicksearchbox/com.google.android.voicesearch.ime.VoiceInputMethodService
Change-Id: I00aa2170ef2fcc4daf50d09a57b8e2ad16c0a6cb
2020-01-10 16:58:12 +08:00
Hongming Jin
bc76112e0b System action registration API for SystemUI
Bug: 136286274
Test: atest AccessibilityManagerTest
      atest AccessibilityManagerServiceTest
Change-Id: I6bbdf3627bfc9b39551cc7809dda1cf43d1d6ea4
2020-01-08 11:22:48 -08:00
Ameer Armaly
fd43c3151f Fix NullPointerException on double tap on hold.
We don't need to confirm that pointers are non-zero in TouchExplorer#onDoubleTapAndHold; it is the job of the gesture matcher and the gesture manifold to prevent weirdness.
Bug: 146997332
Test: atest AccessibilityGestureDetectorTest TouchExplorerTest GestureManifoldTest
Change-Id: I12eb42155c1e55b13840bacea962be4759354214
2020-01-02 16:56:42 -08:00
Ameer Armaly
c76eb982d8 Implement second-finger double-tap.
Bug: 142277194
Bug: 136131815
Test: atest TouchExplorerTest

Change-Id: I18a5cd5b55b27a1375b828e7aa2f4fafef8a2f0b
2019-12-20 14:47:24 -08:00
Ameer Armaly
c6222fabb3 Fix issues with swiping on some devices.
Some devices will send ACTION_MOVE events with the same coordinates as ACTION_DOWN. If so, we ignore them in order to correctly interpret the rest of the gesture.
Fix: 146472448
Test: Run talkback and swipe in all directions.
Test: atest AccessibilityGestureDetectorTest TouchExplorerTest GestureManifoldTest
Change-Id: I7c6ee32aa64cd9558afef4caf690f822f2541c5b
2019-12-19 10:58:31 -08:00
Ameer Armaly
51106a339e Implement existing gestures using the new architecture.
This includes the following gestures: double-tap, double-tap and hold, one-direction swipes, and two-direction swipes
including angle swipes.

Bug: 142277141
Bug: 136131815
Test: atest AccessibilityGestureDetectorTest TouchExplorerTest GestureManifoldTest
Change-Id: I47089b003ff4e49e96b2833931ec4006131f1bd4
2019-12-17 17:57:31 +00:00
Rhed Jao
d85e2b467c Merge "Accessibility shortcut improvement (5/n)" 2019-12-11 02:17:29 +00:00
Rhed Jao
6dad25dee6 Accessibility shortcut improvement (5/n)
- Adds support for magnification and multiple shortcut targets assigned
  to accessibility shortcut key in AccessibilityManagerService.
- New extra field in ACTION_CHOOSE_ACCESSIBILITY_BUTTON intent to
  support accessibility shortcut key.

Bug: 136293963
Test: atest AccessibilityShortcutControllerTest
Test: atest AccessibilityUserStateTest
Test: atest AccessibilityShortcutTest
Change-Id: If0a446dfd269e82ec0d09db92e86f859cdae50d8
2019-12-09 15:20:45 +08:00
TreeHugger Robot
57bb01c720 Merge "Set accessibility ID to window surface" 2019-12-05 22:22:58 +00:00
Hongming Jin
92b57232e2 Merge "SystemActionPerformer implementation for new API." 2019-12-05 19:38:04 +00:00
Hongming Jin
2d49456c9a SystemActionPerformer implementation for new API.
Implmentation details of Accessibility framework SystemActionPerformer.
Will be accessed by AccessibilityManagerService to provide API
implementation support for system action registration and system action
access.

Bug: 136286274
Test: atest SystemActionPerformerTest

Change-Id: Ic0adbb6fc21d262fb2949f616ca28940fd6f1f53
2019-12-04 11:35:41 -08:00
Daichi Hirono
1d56ce3731 Set accessibility ID to window surface
The change allowes HAL to access accessibility ID.

Bug: 143734779
Test: TBD
Change-Id: Ib4ad2b2c62264bb8ea73dd3e663b9ff797c62a7a
2019-12-04 16:27:26 +09:00
Jackal Guo
113617887c Update accessibility focus correctly in AccessibilityWindowManager
The accessibility focus node id isn't updated if the focus window id
doesn't change.

Bug: 144958088
Test: a11y CTS & unit tests
Change-Id: I67e57fb036efa4b89c7b5148fb7cef9dbdd37b7b
2019-11-22 17:29:41 +08:00
Rhed Jao
56af673035 Merge "Accessibility shortcut improvement (6/n)" 2019-11-20 10:51:14 +00:00
Rhed Jao
acde6c9ab1 Accessibility shortcut improvement (6/n)
Flag request accessibility button can't be updated at runtime
dynamically.

Bug: 136293963
Test: atest AccessibilityButtonTest
Change-Id: I2227eaefe3686c99d1c804ef2a949c975de4e685
2019-11-20 16:30:49 +08:00
Alex.tc Huang
24ef87d5f1 Allow app switches for accessibility services
Set allow app switches so the accessibility service can start activity
without delay.

Bug: 141873810
TEST: atest AccessibilityServiceConnectionTest
Change-Id: I4204c4cf0baa1f66d6d2d73d56a342ae803d24dd
2019-11-14 02:16:40 +00:00
Phil Weaver
22c2c46b88 Merge "a11y: don't crash the system when illegal component name encounted" am: f4d1789b81 am: 411b523373
am: 015fe4ff3e

Change-Id: Id23f04ae4bd5c3c622e64525a89303bb79ba24ec
2019-10-30 19:07:09 -07:00
Phil Weaver
015fe4ff3e Merge "a11y: don't crash the system when illegal component name encounted" am: f4d1789b81
am: 411b523373

Change-Id: Idb8ffd83b4d8b89ebba52ad6fe5e7037ac61b4b7
2019-10-30 18:59:00 -07:00
Phil Weaver
f4d1789b81 Merge "a11y: don't crash the system when illegal component name encounted" 2019-10-31 01:29:30 +00:00
Jackal Guo
41c5b259e8 Merge "Allow restarting of crashed a11y services" 2019-10-17 06:21:10 +00:00
Jackal Guo
fbac83822e Allow restarting of crashed a11y services
After an accessibility service crashes a few times in a short period
of time, framework would add it into a “blacklist”. User wouldn’t be
able to use (re-enable) it. If users express an intent in them working
again, we remove the crashed accessibility service from the blacklist.

Bug: 129689483
Test: a11y CTS & unit tests
Test: manual
      1. Install and enable an intentional crashed a11y service.
      2. After it's crashed and malfunctioning, re-enable it.
      3. Check if it's bound again.

Change-Id: Ia89121f11bc5e05fc829e0e3ecb266150409678b
2019-10-16 10:15:30 +08:00