Commit Graph

589 Commits

Author SHA1 Message Date
ryanlwlin
b0d7008dab Request connection for window magnification
request window magnification connection through IstatusBar only
when magnification mode is window and magnification state is enabled.

Bug: 152578960
Test: WindowMagnificationManagerTest

Change-Id: I4e00448d9b64f9fd04fa5a5758bd41b2d2c8352f
2020-04-10 04:24:09 +00:00
Ryan Lin
2b7aed88fe Merge "Change MagnificationGestureHandler based on the magnificaotion mode" 2020-04-09 02:12:14 +00:00
Qasid Sadiq
b844bccd18 Merge "Use current user isntead of system user if no --user parameter is passed" into rvc-dev am: 693c69ca30 am: 9c20cc0ec7 am: d69466ff9e am: 4be0fbaef4
Change-Id: Ida93baeb56ad1f9ef78d25912ff33c3e7dfd4985
2020-04-08 21:37:07 +00:00
Qasid Sadiq
693c69ca30 Merge "Use current user isntead of system user if no --user parameter is passed" into rvc-dev 2020-04-08 20:40:11 +00:00
Qasid Ahmad Sadiq
d0129ce59b Use current user isntead of system user if no --user parameter is passed
This is relevant when running cts tests in instant mode.
Certain tests were failing in non-system users in instant mode, which is particularlly consquential to auto.
THis fix will be cherry-picked back to their repo
Test: CTSAccessibility*, in both instant/non-instant, and with both system and secondary users.
Bug:146218533

Change-Id: I89937bd552d372adc5d96c51b24d1a2bb4a034e3
2020-04-08 01:51:05 -07:00
ryanlwlin
3a817a5f4a Change MagnificationGestureHandler based on the magnificaotion mode
When the magnification mode is changed, create the correspoding
MagnificationGestureHandler based on the magnification mode and
replace it with the old one.

Bug: 152578960
Test: AccessibilityUserStateTest
Test: AccessibilityInputFilterTest
Change-Id: Ifbcb771762b660183235292d3d35de3213064573
2020-04-08 14:29:21 +08:00
ryanlwlin
d3e313ea4c Add WindowMagnificationGestureHandler for magnification
WindowMagnificationGestureHandler detects gestures to determine the
user is going to manipulate window magnifier. If the user is going to
interact with current UI, it will sends the delayed events, otherwise
it will change the scale or move the window magnifer based on user's
gesture.

Bug: 146400227
Test: manual test & WindowMagnificationManagerTest
Test atest WindowMagnificationGestureHandlerTest

Change-Id: I185005d1ebb00a4d3956104fc78fab7d46777d4d
2020-04-08 14:12:20 +08:00
Rhed Jao
9551fdecb7 Merge "Fix a11y service targeting sdk version doesn't update" into rvc-dev am: 6651da4348 am: b9bd430d07 am: 0fe9229555 am: bb89745a6e
Change-Id: Ibf7e0e5dfdaa334f58147da3e36e29eea5d05c47
2020-04-08 02:45:20 +00:00
Rhed Jao
6651da4348 Merge "Fix a11y service targeting sdk version doesn't update" into rvc-dev 2020-04-08 01:54:46 +00:00
Sally Yuen
bd258aa3f0 Merge "Laziliy initialize SystemActionPerformer" into rvc-dev am: 63f5570796 am: 05153955f7 am: 12e1f17a9c am: b82d43f45f
Change-Id: I65968232fda49c40c831322f1652be5e6d3b625f
2020-04-07 01:02:07 +00:00
Sally Yuen
63f5570796 Merge "Laziliy initialize SystemActionPerformer" into rvc-dev 2020-04-06 23:55:54 +00:00
ryanlwlin
11aa986b5a Fix incorrect order of Accessibility events
The Accessibility events order for gesture end and touch interaction
end are exchanged in following conditons:
1. touching duration is very short.
2. Hover exit events comes right away after receving
action_up.
It leads to incorrect state of touchExplorer and sending incorrect
hoverevent in next touch-interaction.

In unit test part, there are two changes:
1. TestHandler used in current thread to reduce the execution time.
2. Add the created order of the mesaag to compare MsgInfo so that
it has correct order in the queue.

Bug: 152265599
Test: atest FrameworksServicesTests:com.android.server.accessibility.gestures
Test: atest android.accessibilityservice.cts.TouchExplorerTest
Test: manual test
Change-Id: Ia60d51414dd63a2a30be61372e8fbd2e3d9f723f
2020-04-06 21:48:19 +08:00
Jacky Kao
aa8f5cb671 Merge "Supporting multi-display for takeScreenshot()" into rvc-dev 2020-04-06 09:03:42 +00:00
sallyyuen
d3ef403fc3 Laziliy initialize SystemActionPerformer
Tests indicate starting up AccessibilityManagerService takes 5ms longer
than expected and may be due to ag/9726764. Unsure how that change
could cause it, but we can take action and avoid initializing
SystemActionPerformer on start up.

Bug: 145909124
Test: builds and registers actions
Change-Id: Id7b8d5bfc450f96691b1810bf701644a0b1ef637
2020-04-03 14:50:02 -07:00
Rhed Jao
f74e5ccbe5 Fix a11y service targeting sdk version doesn't update
The accessibility service connection uses old service info
to create connection while the system is trying to rebind the
enabled services after packages finished updated. The root
cause is we always reloaded the installed service info after
the a11y services were rebound. To fix this issue, always
reloads the installed service info before rebinds the services.

Bug: 152817355
Test: All a11y related cts tests
Change-Id: Iab424940fc47b5a5f44096d67dc7bdfe2d43c5be
2020-04-02 12:11:52 +08:00
JW Wang
6009ac668b mService.unlinkToDeath might be called without having linkToDeath
See b/152932464#comment1 for the analysis.

Fix a race where #unlinkToDeath might be called without a preceding
call to #linkToDeath and result in an exception.

Bug: 152932464
Test: presubmit
Change-Id: I061b314ebd895a400b1bb2e2956233775d5816e5
2020-04-01 15:04:24 +08:00
Leon Scroggins
2a1b63c7df Merge "Convert ScreenshotGraphicBuffer to ScreenshotHardwareBuffer" 2020-03-26 17:29:14 +00:00
Menghan Li
ec65a6a138 Merge "Accessibility Service & Shortcut Redesign - Remove “volume key shortcut” setting (5/n)" into rvc-dev am: fea8d184c2 am: 5664cb5315 am: 21f36c7bfb am: b10fbb7a4e
Change-Id: I995d4e7e20d12235d6fd57c8e8d437c8cb727fb6
2020-03-26 01:27:47 +00:00
Menghan Li
fea8d184c2 Merge "Accessibility Service & Shortcut Redesign - Remove “volume key shortcut” setting (5/n)" into rvc-dev 2020-03-26 00:21:50 +00:00
Leon Scroggins III
46c927ed33 Convert ScreenshotGraphicBuffer to ScreenshotHardwareBuffer
Bug: 150395371
Test: make && flashall

Bitmap is replacing methods that use a hidden GraphicBuffer with ones
that use the public HardwareBuffer. ScreenshotGraphicBuffer is just a
holder for GraphicBuffer and some metadata; switch it to hold a
HardwareBuffer (and rename to match).

Remove GraphicBuffer#createFromExisting, which was only called by
ScreenshotGraphicBuffer#createFromNative. Also remove JNI references to
that method, which were no longer in use.

Switch uses of GraphicBuffer that retrieve it from a
ScreenshotGraphicBuffer to HardwareBuffer.

Changes are almost entirely mechanical:
- (Screenshot)GraphicBuffer -> (Screenshot)HardwareBuffer
- GraphicBuffer#destroy -> HardwareBuffer#close
- getGraphicBuffer -> getHardwareBuffer

When creating a Snapshot in SurfaceFreezer, use the ColorSpace of the
ScreenshotHardwareBuffer.

Remove GraphicBuffer#createFromExisting. This is no longer necessary,
and although it was marked UnsupportedAppUsage, go/nonsdk-dash shows no
usage.

Change-Id: I41cb03fb65432d208820a428783de82a9f152035
2020-03-25 13:45:12 -04:00
Jacky Kao
316477c399 Supporting multi-display for takeScreenshot()
Creating a new API, screenshotWithoutSecureLayer(), to get the
graphic buffer of screenshot for all displays including non-default
display and virtual one. We can use it to support multi-display
of takeScreenshot() API.

Bug: 145893483
Test: a11y CTS & unit tests
Test: manual testing to take screenshot of second display which is a
monitor with chrome cast

Change-Id: I474c71f7e01d57b5a318b2a5bfb690a2e01c128c
2020-03-25 13:46:11 +08:00
menghanli
390f8f9be9 Accessibility Service & Shortcut Redesign - Remove “volume key shortcut” setting (5/n)
- Target to fix migration issue to support a user revoked the accessibility shortcut before upgrading to R, but wants to to apply new hardware shortcut design in R.
- The switchbar of accessibility_shortcut_enabled was removed in (1/n), so we should also remove related checker in controller.

Bug: 142529032
Test: atest AccessibilityShortcutControllerTest
Change-Id: I48f8d88c4192e894b9e210221e5dc7e701344623
2020-03-25 07:46:41 +08:00
ryanlwlin
443b8fb803 [DO NOT MERGE] Fix incorrect order of Accessibility events
The Accessibility events order for gesture end and touch interaction
end are exchanged in following conditons:
1. touching duration is very short.
2. Hover exit events comes right away after receving
action_up.
It leads to incorrect state of touchExplorer and sending incorrect
hoverevent in next touch-interaction.

Bug: 150171638
Test: atest FrameworksServicesTests:com.android.server.accessibility.gestures
Test: atest android.accessibilityservice.cts.TouchExplorerTest
Test: manual test
Change-Id: Ia60d51414dd63a2a30be61372e8fbd2e3d9f723f
2020-03-24 11:05:49 +08:00
Ryan Lin
8c8689eac7 Merge "Add MagnificationGesturesObserver for A11y magnification" 2020-03-20 07:03:36 +00:00
Automerger Merge Worker
1e4d1a21af Merge "Merge "Reply error through callback for takeScreenshot()" into rvc-dev am: 658dd8047d am: fb6396d142" into rvc-d1-dev-plus-aosp am: 85037cf41e am: 8ffcb4da20
Change-Id: I93ae8b55f739ee7bacdaf73825681b61b1221745
2020-03-20 04:55:29 +00:00
Jacky Kao
658dd8047d Merge "Reply error through callback for takeScreenshot()" into rvc-dev 2020-03-20 04:12:24 +00:00
Jacky Kao
6c8bdbb511 Reply error through callback for takeScreenshot()
Passing the error code through callback to the caller.

Bug: 150865445
Test: a11y CTS & unit tests
Change-Id: I8ca75908289a9fbd888689788a982f68cc7392ad
2020-03-20 08:40:55 +08:00
ryanlwlin
43988175d2 Add MagnificationGesturesObserver for A11y magnification
MagnificationGesturesObserver is used to detect the gestures when
users start to have interaction with the devices through fingers.
If users swipe, single tap or single tap and hold, it means users want
to interact with the UI. If users put two fingers down, it means users
are going to do gestures for magnification operation.

Test: MagnificationGesturesObserverTest
Bug: 149269335
Change-Id: I34ff0694b82ff76c462007f74938e79272d667b4
2020-03-19 14:04:44 +08:00
Ryan Lin
1640ddfe7d Merge "Add GesturesObserver to detect series of gestures" 2020-03-17 05:37:18 +00:00
Automerger Merge Worker
682231a580 Using parent windowId instead am: 8681ea30eb am: 4b5f18b9e2 am: 4c7b687ebc am: cdd2634918
Change-Id: I5a25e1216ed849ae7ee056e477aa41c2959e2f4e
2020-03-17 02:42:41 +00:00
ryanlwlin
0c17a76ea4 Add GesturesObserver to detect series of gestures
Adding GestureObserver for the gesture detection mechanism.

Bug: 149269335
Test: GesturesObserverTest, SimpleSwipeTest, TwoFingersDownTest
Change-Id: I052ede9ec0698c9811a6cf2b2a13333a313b2943
2020-03-16 20:16:52 +08:00
Jackal Guo
8681ea30eb Using parent windowId instead
AccessibilityWindowManager would get null interactive region since
embedded hierarchy doesn't have window. Because interactive region
is null, A11yInteractionController#adjustIsVisibleToUserIfNeeded
wouldn't adjust its visibility to false. This results in that the
visibility of A11yNodeInfo on embedded hierarchy may be incorrect.

Bug: 151203875
Test: a11y CTS & unit tests
Change-Id: I7d61a15994bf726e708e597d0363904fdb32f183
2020-03-11 18:27:08 +08:00
Ameer Armaly
13ba0828af TouchExplorer: statically import event type constants.
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest
Change-Id: I0690789eb65b7e870a2ee4c1137fc1bccf844aa9
2020-03-10 14:00:37 -07:00
Heemin Seog
d1bbc14732 Merge "Replace TYPE_STATUS_BAR_PANEL with TYPE_STATUS_BAR_ADDITIONAL" into rvc-dev 2020-03-04 17:06:50 +00:00
Jacky Kao
4082aa2e19 Drop the hardware buffer
Closing the hardware buffer after sending over to the requesting app,
and adding the document that the app developer has to close the buffer
ASAP.

Bug: 150174095
Test: atest AccessibilityTakeScreenshotTest
Change-Id: I8e759a7d83c0a9adfd1b37d0bbf515c9babde7a4
2020-03-02 08:21:47 +08:00
Jacky Kao
979600dce1 Add a rate limitation of takeScreenshot() API
Adding the rate limitation of takeScreenshot() API is one time
per second to avoid the system health impact.

Bug: 149968870
Test: a11y CTS & unit tests
Change-Id: Iaedafda9b9a5a56941952df54e62d76a92936b1d
2020-03-02 08:21:11 +08:00
Heemin Seog
2cf45dd224 Replace TYPE_STATUS_BAR_PANEL with TYPE_STATUS_BAR_ADDITIONAL
Deprecate TYPE_STATUS_BAR_PANEL. Currently
TYPE_STATUS_BAR_ADDITIONAL maps to the same z order as
TYPE_NOTIFICATION_SHADE. This will be updated in a subsequent CL.

Also move everything in TYPE_STATUS_BAR_PANEL to
TYPE_STATUS_BAR_SUB_PANEL so that it remains above the notification
shade / keyguard layer. TYPE_STATUS_BAR_PANEL will no longer be valid.

As part of the work on having more flexible inset mapping (for Android
Automotive) we want to use the TYPE_STATUS_BAR_ADDITIONAL to be used
for system bars in different places (i.e. Status Bar on the left side of
the screen).

Bug: 140423092
Bug: 145242835
Test: boot (sdk_gphone_x86, hawk), existing tests (atest SystemUITests)
Change-Id: I0ce3c4152fd05a948c06ed1a96c3ba279bd7097a
2020-02-26 14:11:53 -08:00
TreeHugger Robot
fd33a24650 Merge "Fix failure in postsubmit" 2020-02-19 09:45:20 +00:00
Ryan Lin
687fb4bcc1 Merge "Don't notify display removed if it's a private virtual display" 2020-02-19 09:42:56 +00:00
ryanlwlin
6a34da5a64 Don't notify display removed if it's a private virtual display
Some operation will be done When displays are removed/Added,
but virtual private display should be excluded.

Bug: 148760652
Test: manual test:1.Enable the magnification from a11y setting
2. Enable the select to speak and read text on images
3.Tap the a11y shortcut to select to speak the content
4. check if the content is selected correctly.
Change-Id: I8e0fbc4da7cbb6b9c5bf5366115b3863be5243bb
2020-02-19 15:15:10 +08:00
Jackal Guo
1eac68b121 Fix failure in postsubmit
There are some package-pricate classes and methods in a11y framework
so we use DexmakerShareClassLoaderRule to mock them. However, this
results in some unexpected excpetions during testing. Change some of
them to public with @VisibleForTesting annotation, and remove the
DexmakerShareClassLoaderRule to avoid the exception.

Bug: 149362507
Test: atest FrameworksServicesTests:com.android.server.accessibility
Change-Id: I1e526ca79cf14b3d394ee132480dcd8c226ae69a
2020-02-19 13:57:36 +08: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
Minche Li
bd73dfa88e Merge "Update the current user id for MagnificationController" 2020-02-18 11:56:47 +00:00
mincheli
acf5b57d0a Update the current user id for MagnificationController
If the cached user ID is not updated after switching user,
the persistent magnification scale setting would be the
last user's manginification scale setting.

Bug: 148831149
Test: atest MagnificationControllerTest
Change-Id: Icef2834cb482bef753191feaf988b28831a2e691
2020-02-15 16:44:33 +08: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
Jackal Guo
a459b199c1 Support accessibility on embedded hierarchies (2/n)
Introduce AccessibilityEmbeddedConnection. This interface provides
to the host view to the latter can interact with the view hierarchy
in SurfaceControlViewHost.

Bug: 137593247
Test: a11y CTS & unit tests
Change-Id: I9c4f5478c5ecd3bda7f688fa23660f372b59512b
2020-02-11 08:56:10 +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