Commit Graph

218 Commits

Author SHA1 Message Date
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
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
Jackal Guo
7fd8e937bf Merge "Support accessibility on embedded hierarchies (1/n)" 2020-01-15 05:40:36 +00: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
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
Daulet Zhanguzin
f783a5e059 Replace com.android.internal.util.Preconditions.checkNotNull with
java.util.Objects.requireNonNull

Bug: 126528330

Test: Treehugger
Change-Id: Ie079008722ed1d3423eef5d5391b273754b4ad10
2019-12-31 14:07:40 +00:00
Artur Satayev
c895b1b450 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
2019-12-18 16:37:37 +00: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
PETER LIANG
35fc4484fb Merge "Support the rich content for accessibility service (2/n)" 2019-12-05 06:41:31 +00:00
Dieter Hsu
2574b4a1dd Update test mappings for CtsAccessibilityServiceSdk29TestCases
Bug: 145096015
Test: make checkbuild
Change-Id: I45462071dfce5dca3df97c50a784c38e02b83ad6
2019-11-26 03:09:17 +00:00
Peter_Liang
d4d499cc99 Support the rich content for accessibility service (2/n)
New attributes for accessibility service
1. android:animatedImageDrawable
2. android:htmlDescription

Bug: 136292241
Test: Maunal
Change-Id: I59cafb44ae81aa64a3e28bdcdbf99fc5f283d29d
2019-11-25 14:23:36 +00:00
Rhed Jao
9acdb42cc9 Merge "Fix legacy a11y service fail to update a11y button flag" 2019-11-25 03:52:45 +00:00
Rhed Jao
b7d554f4a8 Merge "Revert "Accessibility shortcut improvement (2/n)"" 2019-11-22 08:04:04 +00:00
Rhed Jao
5ad3e01ba5 Fix legacy a11y service fail to update a11y button flag
Bug: 144889227
Test: atest AccessibilityButtonTest
Test: atest AccessibilityButtonSdk29Test
Change-Id: I7cb7041b016dab8ad8d98057b4675c0d19748fa5
2019-11-21 14:43:30 +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
Rhed Jao
29bab71e43 Revert "Accessibility shortcut improvement (2/n)"
This reverts commit 62ea99ca21.

Reason for revert: Design Changed
Bug: 136293963

Change-Id: I38035eefd462677951e5d3a975c1790b8d291679
2019-11-14 12:15:11 +00:00
ryanlwlin
dafef88472 Rename GesureType to GestureId
Bug: 139127300
Test: NA
Change-Id: If081d872064efef5e841ac93c6e49a9e46b68777
2019-11-11 20:21:31 +08:00
Jackal Guo
41c5b259e8 Merge "Allow restarting of crashed a11y services" 2019-10-17 06:21:10 +00:00
Rhed Jao
a59833d645 Merge "Accessibility shortcut improvement (2/n)" 2019-10-17 06:19:53 +00:00
TreeHugger Robot
45c3db2dcf Merge "Close memory leak in a11y gesture dispatch" 2019-10-17 02:15:35 +00:00
Phil Weaver
60219c136a Close memory leak in a11y gesture dispatch
Bug: 142785934
Test: atest AccessibilityGestureDispatchTest
Change-Id: I926ac49ec798eda7070f6e9b67b8eec1c6ea537a
2019-10-16 11:40:11 -07: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
Rhed Jao
62ea99ca21 Accessibility shortcut improvement (2/n)
New accessibility flag for accessibility shortcut.

Bug: 136293963
Test: atest AccessibilityServiceInfoTest
Change-Id: Ic545c551f148ef240a80fabc6af1d3587a93923b
2019-10-14 14:43:10 +08:00
Rhed Jao
c2653261c5 Merge "Accessibility shortcut improvement (3/n)" 2019-10-07 02:00:40 +00: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
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
Aurimas Liutikas
4d1699da48 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-29 17:15:44 -07:00
RyanlwLin
ed124d0f41 Make jdoc explicit for a11y window API in multi-display case
bug: 133597330
Test: NA
Change-Id: Ia553b48931743452b4e40820f58cfcfab1b23bf3
2019-08-28 02:17:10 +00: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
Kevin Hufnagle
d301c83169 Merge "docs: Fixed typo in SERVICE_META_DATA" into qt-dev am: d2e0e31dbb am: 5e787019a5 am: a9cad41130
am: 81e460604c

Change-Id: I224c3de5a7df392893589b221bb1e2e565f7ebe5
2019-07-26 18:06:17 -07:00
Ryan Lin
74fc2c8d70 Merge "Added onGesture(AccessibilityGestureInfo) for mulit-display" 2019-07-26 05:49:30 +00:00
Ryan Lin
e1e3273b10 Merge "added setDisplayId in GestureDesicption.Builder to support multi-display" 2019-07-24 03:49:54 +00:00
RyanlwLin
a0daddd8d8 Added onGesture(AccessibilityGestureInfo) for mulit-display
We added a new API to help App developers know the gesture information
performed on specific display.

Bug: 133290787
Test: atest AccessibilityGestureDetectorTest
Change-Id: Ic98847691ba9f608f418408e9bef1c3116388f3c
2019-07-24 11:28:50 +08:00
RyanlwLin
8078813107 added setDisplayId in GestureDesicption.Builder to support multi-display
We add this API to support dispatching gesures on mulit-display. If the
display id is invalid or the assigned display is untouchable, this
action would be cancelled.

Test: atest AccessibilityServiceConnectionTest
Bug: 133290787
Change-Id: Ic0e265f7b0b2a9601a670e290d6d2dab27a92545
2019-07-22 11:22:44 +08:00
Kevin Hufnagle
b0becb2325 docs: Fixed typo in SERVICE_META_DATA
Test: make ds-docs

Bug: 137267707
Change-Id: I3f38362f028866f55b9009b6a0de15dcbcb96e0c
2019-07-18 20:20:34 +00:00
mincheli
5f435e70db Support A11y overlay on multi-display
To make an a11y overlay window available on a specific display, we need
to update window token and update the context with a specific display
information when AccessibilityServiceConnection or diplay is changed.

Bug: 133304985
Test: a11y CTS & unit tests
Change-Id: Ib8693978e2455b5f568e195167e319b5b6cc9f02
2019-07-18 17:37:50 +08:00
mincheli
7ab28d5126 Add null check for AccessibilityButtonController.isAccessibilityButtonAvailable
Just add a null check to reduce NullPointerException happening.

Bug: 110361782
Test: Test: a11y CTS & unit test
Change-Id: Ia4e39c5b3af4943fba2f9ad545b96d5983ee780d
2019-03-21 11:22:03 +08:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
If they were null, then the Parcelable would fail to work.

Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
2019-02-28 23:29:04 -07:00
Phil Weaver
f1c246619f Merge "Add owners for accessibility" am: bbbeba3c02 am: a525ea4436
am: c36e36b87e

Change-Id: Iaa5653b02e99a149186a99f3fda28111263aa2ad
2019-02-11 17:12:54 -08:00
Phil Weaver
c36e36b87e Merge "Add owners for accessibility" am: bbbeba3c02
am: a525ea4436

Change-Id: Ia828c34be1f1dac6ea58ce0e68cf032f058dbb0b
2019-02-11 16:53:13 -08:00
Phil Weaver
6ac1a60bf1 Add owners for accessibility
Test: Relying on treehugger. No functional changes.
Change-Id: I2511b04e56301bd34a8eaced7be8dd8582cc3cc7
2019-02-07 10:52:13 -08:00
Rhed Jao
02655dc38c Enable multi-display support for magnification controller
1) New api for a11y service to specify display id and return
per display magnification controller.
2) Updae MagnificationController to support multi-display.
3) Update AccessibilityController to support multi-display
magnifier.

Bug: 112273690
Test: atest MagnificationControllerTest
Test: atest MagnificationGestureHandlerTest
Test: atest CtsAccessibilityTestCases
Test: atest CtsAccessibilityServiceTestCases

Change-Id: I643a8f96e7d57f729daf8df7f26c9014b1dfd476
2019-01-18 16:53:32 +08:00
Gilbert Lee
0b2f7babbb Merge "Adjust maximum accessibility magnification scale from 5x to 8x" 2019-01-14 02:34:29 +00:00
Gilbert Lee
d38d699054 Adjust maximum accessibility magnification scale from 5x to 8x
Bug: 76414773
Test: Manual
      atest FrameworksServicesTests:com.android.server.accessibility

Change-Id: I558c641bc65ba07a6544d439c8616a7e5d6960b4
2019-01-08 13:04:27 +08:00
Rhed Jao
637c416153 Accessibility timeout: Update integer range to APIs
Bug: 120475200
Test: atest AccessibilityServiceInfoTest
Change-Id: Idd954ab61f5d2511cfdcdabaf2527f99f93c80fc
2018-12-24 16:06:40 +08:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00