Commit Graph

512 Commits

Author SHA1 Message Date
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
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
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
Roshan Pius
20bce169a5 Merge "Window: Mark SHOW_FOR_ALL_USERS flag as @SystemApi" 2019-10-14 18:03:23 +00:00
Dieter Hsu
0036367e5a Fix get accessibility settings for wrong user
Bug: 138970298
Test: atest --test-mapping $ANDROID_BUILD_TOP/frameworks/base/services/accessibility:postsubmit
Change-Id: I1c34f13553e91ac0d504259b2091d1c35006fbfa
2019-10-14 13:07:48 +08:00
Dieter Hsu
4d2ece1b7a Split AccessibilityManagerService.UserState into its own class
Bug: 111889696
Test: atest --test-mapping $ANDROID_BUILD_TOP/frameworks/base/services/accessibility:postsubmit
Change-Id: I6bd02407fc8582409bc9f5a6dcd83969cd5069b9
2019-10-14 13:07:48 +08:00
Roshan Pius
a3f89c6882 Window: Mark SHOW_FOR_ALL_USERS flag as @SystemApi
Bug: 142090228
Test: Compiles
Change-Id: I850c7759dc909727f73e40fb6331871a9de25f20
2019-10-12 08:32:44 -07:00
Hongming Jin
54255d4862 Rename GlobalActionPerformer to SystemActionPerformer.
Bug: 136286274
Test: atest SystemActionPerformerTest
Change-Id: I6eb18300fa3173a96cef57fee3a68eba3145b9cd
2019-10-08 18:13:08 -07:00
Rhed Jao
c2653261c5 Merge "Accessibility shortcut improvement (3/n)" 2019-10-07 02:00:40 +00:00
Jacky Kao
61178c5f13 Merge "Implementing new API : getWindowsOnAllDisplays()" 2019-10-05 00:07:04 +00:00
Ameer Armaly
a7a15f1823 TouchExplorer: remove dependency on AccessibilityGestureDetector#firstTapDetected.
Since we have proper states now this only serves as extra coupling to the gesture detector.
Bug: 136131815
Test: atest CtsAccessibilityTestCases  CtsAccessibilityServiceTestCases
Test: atest FrameworksServicesTests:TouchExplorerTest
Change-Id: I3be0f05e6492abad6a79f5167aaa61325dc5e9e6
2019-10-04 10:12:23 -07:00
Rhed Jao
0090ad7fd4 Accessibility shortcut improvement (3/n)
- New class AccessibilityShortcutInfo to describe accessibility
  shortcut.
- New Intent category for the target of accessibility shortcut

Bug: 136293963
Test: atest AccessibilityShortcutInfoTest
Change-Id: Id47d397a03f3f710368550e551097214c7839943
2019-10-04 16:50:30 +08:00
Jacky Kao
c7be7b52a2 Implementing new API : getWindowsOnAllDisplays()
1. Implementing the new API for supporting multi-display.
SparseArray<List<AccessibilityWindowInfo>> getWindowsOnAllDisplays()
2. Modifying the documents of this API and its function is to get the window lists of
default display.
List<AccessibilityWindowInfo> getWindows()

Bug: 133279356
Test: a11y CTS & unit tests
Change-Id: Id4e874f43390bdf4196d106a44bbca18bf9fd1d6
2019-10-04 08:31:14 +08:00
Ameer Armaly
6d70fac912 TouchExplorer: pass raw events when sending events.
Right now we just send null. This was a todo to be fixed and will mean that the event stream operates consistently.
Bug: 136131815
Test: atest CtsAccessibilityTestCases  CtsAccessibilityServiceTestCases
Test: atest FrameworksServicesTests:TouchExplorerTest FrameworksServicesTests:MotionEventInjectorTest
Change-Id: I4578ef4ffe6d3c3e4fc2aa2d06fc0caaa8bb9713
2019-10-02 11:39:56 -07:00
Ameer Armaly
ea91511e63 Merge "Extract event sending code into EventDispatcher." 2019-09-20 17:23:13 +00:00
Ameer Armaly
4e23608d1e Extract event sending code into EventDispatcher.
Also combine event-sending code with what used to be the InjectedPointerTracker class because that class was used for sending events anyway.
Bug: 136131815:
Test: atest CtsAccessibilityTestCases  CtsAccessibilityServiceTestCases FrameworksServicesTests:TouchExplorerTest
Change-Id: I7fae3dc958642d8fae61b9120c732d27af16fca9
2019-09-19 17:11:50 -07:00
Dieter Hsu
4eab966c0a Fix NPE of A11yManagerService#getAccessibilityShortcutService
Add a null check before flattening the component name.

Bug: 132345003
Test: Null check. Existing unit tests still pass.
Change-Id: I1df04f97d5cad1cecc503b068e3036913aa46811
2019-09-19 12:56:49 +08:00
Ryan Lin
a5cd980c37 Merge "Rename AccessibilityGestureInfo" 2019-09-18 08:53:06 +00:00
Jacky Kao
f67c710a89 Merge "Passing correct displayId to modified API" 2019-09-11 04:07:31 +00:00
James O'Leary
6d7edf933e Merge "Add completion handler for ScreenshotHelper" into qt-qpr1-dev am: 8a91775d3f
am: 8de0b9defe

Change-Id: Ie6d578faa84c0ba0ddd4613db0025dfd80bfcfb4
2019-09-06 21:25:32 -07:00
James O'Leary
fa5bb7af25 Add completion handler for ScreenshotHelper
The Next-Generation Assistant can call SysUI to request a screenshot.
Adding an indicator that a screenshot has completed successfully enables
the Next-Generation Assistant to show the assistant UI again once the
screenshot has completed.

Bug: 137201206
Bug: 131082115
Test: Wired up SysUIG's NGA integration's touch outside handler to call
take screenshot, confirmed it behaved as expected when a touch outside
occurred.
Change-Id: Ie83af6c9dd8e93b3e18a820d79c02125a19bd62a
2019-09-06 18:11:38 +00:00
Jacky Kao
29a727d93b Passing correct displayId to modified API
1. Passing the correct displayId when calling API,
AccessibilityWindowManager#getWindowListLocked().
(The method, getWindows(), only returns the windows of default display)
2. Passing the correct displayId when calling API,
WindowManagerService#computeWindowsForAccessibility().

Bug: 134891479
Test: a11y CTS & unit tests
Test: manually test talkback AP at second display
Change-Id: I1141521d383f3c3efcf1ee32af54e12d0fcf4231
2019-09-04 16:38:13 +08:00
RyanlwLin
0d17f046bc Rename AccessibilityGestureInfo
Rename AccessibilityGestureInfo to AccessibilityGestureEvent

Bug: 139127300
Test: atest AccessibilityGestureDetectorTest
Test: atest AccessibilityGestureEventTest
Change-Id: I1f08d89fbb6df30d48d424ff62cfa6b35d5e9430
2019-09-03 16:36:36 +08:00
Ameer Armaly
5edb796833 Add STATE_CLEAR and STATE_TOUCH_INTERACTING to TouchExplorer.
STATE_CLEAR represents an initial state where no fingers are down. STATE_TOUCH_INTERACTING is where we try to detect the user's intent.

Bug: 136131815
Test: atest CtsAccessibilityServiceTestCases FrameworksServicesTests:TouchExplorerTest
Change-Id: Ifac5ab2556d5d16e6326fec1f92064cb6987b519
2019-08-27 15:33:00 -07:00
Jacky Kao
2d1e0f2239 Merge "Supporting windows updated per display [Part III]" 2019-08-23 05:34:48 +00:00
Jackal Guo
f13dbd5c4b Fix FrameworksServicesTests fail
Using default instead of private results in an unexpected fail on
FrameworksServicesTests. Change to public to fix it.

Fix: 139853891
Test: a11y CTS & unit tests
Change-Id: I307d4f0da96310c310cbd407249b410608e0d0cd
2019-08-22 19:29:25 +08:00