Commit Graph

232 Commits

Author SHA1 Message Date
PETER LIANG
c0570cf0a8 Merge "Change the attribute format of htmlDescription." 2020-02-14 08:47:47 +00:00
Jacky Kao
075a8094b4 Merge "Improvement for takeScreenshot() API" 2020-02-14 04:35:01 +00:00
Jacky Kao
5519738da5 Improvement for takeScreenshot() API
1. Modify the related documentations.
2. Make the timestamp got from framework side.
3. Use the ParcelableColorSpace class.

Bug: 149271120
Test: a11y CTS & unit tests
Change-Id: I2aedf67f8ed7d949322b23b59eaa383e53ecb594
2020-02-14 09:36:00 +08:00
Ameer Armaly
259daddeea Add multi-finger double tap and hold gestures.
This CL includes two, three and four finger double-tap and hold.

Bug: 136131815
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest
Change-Id: I4c0a95a4ac2d13e0a7e2c7920df619063ec1cfc0
2020-02-13 11:23:36 -08:00
Peter_Liang
515b989fb8 Change the attribute format of htmlDescription.
After the discussion, shouldn't let developers use the general
string which is non resource id. And only support the resource id string.

Bug: 142532186
Test: manual test
Change-Id: I912effc500c72d2ac83cc344f4e4099f6f469652
2020-02-13 21:08:39 +08:00
Rhed Jao
0132d90b3f Merge "Support rich content for accessibility shortcut target" 2020-02-11 00:18:28 +00:00
Rhed Jao
649b2fb00a Support rich content for accessibility shortcut target
Two attributes are added in AccessibilityShortcutInfo:
- animatedImageDrawable
- htmlDescription

Bug: 148929247
Test: atest AccessibilityShortcutInfoTest
Change-Id: Ibf41775cbfee0fdd946541bbae45ac088d11d693
2020-02-07 18:56:56 +08:00
Jacky Kao
76c7f54d15 Merge "Changing the return type of takeScreenshot() (2/n)" 2020-02-07 00:01:49 +00:00
Jacky Kao
2fffd22b76 Changing the return type of takeScreenshot() (2/n)
Implementing the new return type for A11y services to take
the screenshot of the specified display.
boolean takeScreenshot(int displayId,
@NonNull @CallbackExecutor Executor executor,
@NonNull Consumer<ScreenshotResult> callback)
The return type is a new class, ScreenshotResult, including
hardwareBuffer, colorSpace, and timestamp. A11y services could
use the method, Bitmap#wrapHardwareBuffer, to obtain the bitmap.

Bug: 10931661
Test: a11y CTS & unit tests
Change-Id: I03eae10f0970d0e11e02c9d3f4031c4096b7b5b4
2020-02-06 16:29:05 +08:00
Ameer Armaly
ec5eb82a6d Add four-finger gestures.
This CL includes the following gestures:
1) Four-finger single / double / triple tap.
2) Four-finger swipe up / down / left / right.

Bug: 136131815
Test: atest GestureManifoldTest AccessibilityGestureDetectorTest TouchExplorerTest
Change-Id: If5b4bfc680423f0672452b9aa440c8f18333f565
2020-02-05 11:13:12 -08: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
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
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