Commit Graph

244 Commits

Author SHA1 Message Date
Peter_Liang
a2f7f84938 Remove the public APIs for allow rich content.
1. Mark @hide for "Drawable loadAnimatedImage(Context)" and "String loadHtmlDescription(PackageManager)".
2. Move common function into util.

Bug: 149516547
Bug: 142532186
Test: maunal test
Change-Id: I4f734a496938f64bcde990268e11a2d1a5be4771
2020-02-24 22:33:04 +08:00
Peter_Liang
c6e3836915 Fine-tune the public APIs of allow rich content in Accessibility Settings for security.
1. Add some checkers and java doc:
  - loadHtmlDescription
    It filters the <img> tag which do not meet the custom specification and the <a> tag.
  - loadAnimatedImage
    It checks the resource whether to exceed the screen size.

Bug: 149516547
Test: atest AccessibilityShortcutInfoTest & manual test
Change-Id: I8ecad186fc9e4bb6799ded296805cdc5353c5010
2020-02-21 15:34:10 +00:00
PETER LIANG
cd94c1871e Merge "Revise the parameter of public API for allow rich content." 2020-02-20 20:30:45 +00:00
Automerger Merge Worker
33b8bf685a Merge "Make me an owner of accessibility frameworks" am: 269d57b7da am: 6374aaf5c5 am: 865c89c5a3
Change-Id: I88fd0443d59c45ad625af9d72f05d8de8e4cb783
2020-02-20 04:29:31 +00:00
Peter_Liang
f532a2351b Revise the parameter of public API for allow rich content.
Change "loadAnimatedImage(PackageManager)" to "loadAnimatedImage(Context)"

Bug: 142532186
Test: manual test
Change-Id: I3a6f61fbcd06e73d17cc20ea60effa6e84f0db7b
2020-02-20 02:46:03 +00:00
PETER LIANG
2187f9e855 Merge "Revise the modifier and naming of public APIs for allow rich content." 2020-02-19 23:51:48 +00:00
Qasid Ahmad Sadiq
88d52e8ca6 Make me an owner of accessibility frameworks
Test: Relying on treehugger. No functional changes.
Change-Id: If0e88345001ec286bd0a9a01314dba53e45dc6ac
2020-02-19 14:02:07 -08:00
Peter_Liang
81332eff4a Revise the modifier and naming of public APIs for allow rich content.
Change "int getAnimatedImageRes()" to "Drawable loadAnimatedImage(PackageManager packageManager)"

Bug: 142532186
Test: atest AccessibilityShortcutInfoTest & manual test
Change-Id: I2583a5c2427449bca68af29a0a40215dd0cb9085
2020-02-19 21:41:10 +08:00
TreeHugger Robot
f348b9f3bf Merge "Increase granularity of gesture dispatch to 60fps" 2020-02-19 13:21:46 +00:00
Ameer Armaly
cc13292c06 Add passthrough functionality for touch exploration and gesture detection.
Bug: 136131815:
Test: atest GestureManifoldTest AccessibilityGestureDetectorTest TouchExplorerTest
Change-Id: I8c6b7a333dcb9a4949387a7a683e2dc229d2b18f
2020-02-18 23:52:44 +00:00
Robert Berry
a8c7d84013 Increase granularity of gesture dispatch to 60fps
This is essential if AccessibilityService instances want to animate the
gestures being dispatched (e.g., displaying an overlay showing where the
virtual "finger" is moving).

Test: manual
Bug: 149753602
Change-Id: Ic508c6bd8b4cefa052be9adcac749859c382147a
2020-02-18 17:37:30 -05:00
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
Artur Satayev
d9b11b058c 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
Merged-In: I8789f8499d4dca08580672e9e45ed9a7026dd686
2020-01-09 13:56:05 +00: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