Commit Graph

496 Commits

Author SHA1 Message Date
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
Jacky Kao
81167407c4 Supporting windows updated per display [Part III]
1. Getting all valid displays and starting or stopping the window
tracking when accessibility service enabled or disabled.
2. Updating the window tracking when any display is added or removed.
3. Making DisplayWindowsObserver class to be plural for multiple display.

Bug: 132854721
Test: a11y CTS & unit tests
Test: manually test talkback AP at second display
Change-Id: I1691f5c2092393a6ed396623e437e5d27e0cee9a
2019-08-22 16:27:58 +08:00
wangmingming1
58dc31737c a11y: don't crash the system when illegal component name encounted
Bug: https://issuetracker.google.com/issues/139695999
Test: A11y unit tests (I did't find a way to reproduce the bug)

Change-Id: I0aa8f417b157ca3d96b61b8d9356dd65df360dae
Signed-off-by: wangmingming1 <wangmingming1@xiaomi.com>
2019-08-20 17:33:24 +08:00
Jackal Guo
76e2592392 Merge "Return false instead of throwing exception" 2019-08-20 06:04:34 +00:00
Rhed Jao
2b1f8ce42b Merge "More logs for UiAutomation" 2019-08-20 02:59:57 +00:00
Jackal Guo
b07d98eaac Return false instead of throwing exception
The method isCalledForCurrentedUserLocked() is used to check if
callers have privilege to perform some actions. However, calling
A11ySecurityPolict#resolveCallingUserIdEnforcingPermissionsLocked
may get SecurityException when calls from different users without
permissions directly. Checking the calling UID and user without
throwing SecurityException for active a11y service instead of the
original one.

Bug: 62958230
Test: a11y CTS & unit tests

Change-Id: I0062612bc73d507db21e151dccaf6609d9e0eaf4
2019-08-20 10:35:40 +08:00
Rhed Jao
8529293231 More logs for UiAutomation
Test: atest UiAutomationTest
Bug: 134536201
Change-Id: Ibab34b1908143d894076abf5d9f3692bc03c70db
2019-08-16 19:07:13 +08:00
Rhed Jao
92e4778b58 Merge "Fix a11y serivce cannot find profile user windows" 2019-08-16 08:02:53 +00:00
Ryan Lin
56d2342d3b Merge "Do not redispatch/inject motionevent to private virtual display" 2019-08-16 02:35:39 +00:00
RyanlwLin
4eccaf5e39 Do not redispatch/inject motionevent to private virtual display
The virtaul display with private flag can't be access by other process.
To prevent AceesibilityService redispatches/injects motionevents on it,
We don't add it to valid displayList.

Bug: 138637403
Test: AccessibilityInputFilterTest
Test: AccessibilityGestureDectorTest
Change-Id: I7b60e4eee87b0812d3c882d0e45bbf2016190e6a
2019-08-15 21:08:56 +08:00
Rhed Jao
8543cca929 Fix a11y serivce cannot find profile user windows
Bug: 138806677
Test: atest AccessibilityWindowManagerTest
Test: atest CrossProfileAppsHostSideTest
Change-Id: If67b6e520e594a7608d62959e316cb8644a14d1a
2019-08-15 11:11:56 +08:00
Minche Li
5f69c2ed0d Merge "Support A11y button on multi-display" 2019-08-13 01:14:31 +00:00
Ameer Armaly
d292439738 Remove unused remapping code from TouchExplorer.
Bug: 136131815
Test: atest CtsAccessibilityServiceTestCases CtsAccessibilityTestCases
Change-Id: I64ee27d2139cf1040410482bffe2b50234caddd7
2019-08-12 20:37:24 +00:00
Ryan Lin
c4d27393e8 Merge "make MotionEventInjector support multi-display" 2019-08-02 03:37:20 +00:00
Ameer Armaly
9339c598bb Move accessibility gesture code into its own package.
Given the number of classes that are going  to be created (gesture detectors, TouchExplorer state handlers) it made sense to put them into their own package.
Bug: 136131815
Test: atest CtsAccessibilityServiceTestCases CtsAccessibilityTestCases

Change-Id: Ie347424ecd7518a7c5a4fdefdca5b4886b1fd8e4
2019-08-01 10:39:00 -07:00
Jacky Kao
80c49d7ad6 Merge "Supporting windows updated per display [Part II]" 2019-08-01 05:33:24 +00:00
Jacky Kao
3f730ebfd1 Supporting windows updated per display [Part II]
Creating new class, DisplayWindowsObserver implementing
WindowManagerInternal.WindowsForAccessibilityCallback, receives
updated windows from window manager.

Bug: 132854721
Test: a11y CTS & unit tests
Test: atest AccessibilityWindowManagerTest
Change-Id: I211da59d72c284e4a87574d3fc1955f44036800a
2019-07-31 18:03:51 +08:00
mincheli
a52af2c0cf Support A11y button on multi-display
New api for a11y service to specify display id and return
accessibilitybutton controller per display.

Bug: 120762691
Test: a11y CTS & unit tests
Change-Id: I859c3b1257da3c3ad32dc23601134f42e11a4d07
2019-07-31 07:47:27 +00:00
RyanlwLin
9f4b83d272 make MotionEventInjector support multi-display
Although we have MotionEventInjector for each display but it always
inject events to default display. We set display id of the motion events
to make it correct.

Test: atest MotionEventInjectorTest
Test: atest AccessibilityGestureDetectorTest
Test: atest AccessibilityServiceConnectionTest
Bug: 138422679
Change-Id: I8cfbe9887109e001ea64ca0c250606684be370e7
2019-07-30 11:04:23 +00:00