Commit Graph

608 Commits

Author SHA1 Message Date
Jacky Kao
cebd109abb Merge "Obtain correct screenshot based on device orientation" 2020-04-22 00:41:54 +00:00
Jacky Kao
4b4eec7813 Obtain correct screenshot based on device orientation
When taking the screenshot, passing the width and height
of the display, and the rotation according to the current
device orientation.

Bug: 153173726
Test: a11y CTS & unit tests
Test: manual test
Change-Id: I19eea2046da282155719b1dfdf9a3f53ad95e13b
2020-04-22 08:33:49 +08:00
Automerger Merge Worker
878795c6ba Merge "Merge "Add screenshots logging" into rvc-dev am: 44cc1e274b am: e0efd49ef3" into rvc-d1-dev-plus-aosp am: a1adfd1dfc am: ac6e16bcc9
Change-Id: Ie4d8f1e8a6e808f7f23aac38c0c1e29b20c572ea
2020-04-21 17:59:58 +00:00
Miranda Kephart
44cc1e274b Merge "Add screenshots logging" into rvc-dev 2020-04-21 16:58:54 +00:00
Winson Chung
8c45367d86 Merge "Add shell command to trigger global action" into rvc-dev am: 18c1d27df9 am: 755ad932da am: 3d5533d7f1 am: 2fdd19cdf6
Change-Id: I6e7b8a7e39079fd46f5360b48f707588aeb364ba
2020-04-21 04:30:04 +00:00
Winson Chung
18c1d27df9 Merge "Add shell command to trigger global action" into rvc-dev 2020-04-21 03:26:56 +00:00
Minche Li
35e113b523 Merge "Adds interface to show magnification button for System UI" 2020-04-21 00:35:47 +00:00
Jacky Kao
5dc99c6f58 Merge "Supporting multi-display for takeScreenshot() on master" 2020-04-20 23:35:58 +00:00
Sally Yuen
ebbaa23cef Merge "Support sending KEYCODE_HEADSETHOOK KeyEvent from an a11y service" into rvc-dev am: fdea871287 am: 2e4c291096 am: 319cee5020 am: 8b724cd5e2
Change-Id: I10c4cdd229c45b9e02963af7b657585c198ec3ac
2020-04-20 23:26:58 +00:00
Winson Chung
0f3a378bb5 Add shell command to trigger global action
Bug: 150817783
Test: adb shell cmd accessibility call-system-action <id>
Change-Id: Iaa85b7ada85d39305300b56b1a3725fcbfee4e95
2020-04-20 15:09:48 -07:00
sallyyuen
867c6d2786 Support sending KEYCODE_HEADSETHOOK KeyEvent from an a11y service
Add a private global action to be made public in S. A service can
trigger the event by calling performGlobalAction(10) in R.

Note: Currently 10 is being used by SystemActions for the Accessibility
shortcut. Update ag/10921262 to avoid a conflict.

Bug: 154038741
Test: Tested with modified TalkBack and Youtube play/pause
Change-Id: I3ca5d25948bfb3eb8520030484cb466ec7188784
2020-04-20 12:21:21 -07:00
Miranda Kephart
7b2c313da7 Add screenshots logging
Bug: 150710005
Test: manual
Change-Id: I54a37eb0a62234c6c53fc0f3c80e18e9ee269f12
2020-04-17 13:28:23 -04:00
Jacky Kao
3ff343554a Supporting multi-display for takeScreenshot() on master
Based on the change of this patch, ag/10633571,
Convert ScreenshotGraphicBuffer to ScreenshotHardwareBuffer, on
master branch only, re-porting this CL, ag/10700743, from rvc-dev
to master.

Bug: 153398112
Test: a11y CTS & unit tests
Change-Id: Iee1ed715f8912569c8db4a7297ee5ef4990e9e70
2020-04-17 07:46:26 +08:00
Sally Yuen
84fc50b261 Merge "Revert "Laziliy initialize SystemActionPerformer"" into rvc-dev am: 1fb728d78e am: 4dd35c5c37 am: 76482d1641 am: ee86e5b25a
Change-Id: I8db663c1c6647e9c77a735cace2c7052e6c5e46c
2020-04-16 21:40:03 +00:00
Sally Yuen
1fb728d78e Merge "Revert "Laziliy initialize SystemActionPerformer"" into rvc-dev 2020-04-16 20:26:47 +00:00
Sally Yuen
73a4b26307 Revert "Laziliy initialize SystemActionPerformer"
This reverts commit d3ef403fc3.

Reason for revert: b/153947446
Bug: b/153947446, b/145909124

Change-Id: Idbab007a5e91361c019e206e37925656e710625f
2020-04-16 20:26:32 +00:00
Rhed Jao
a790f45c28 Merge "Fixes long press the a11y shortcut no response" into rvc-dev am: 2a58cd105d am: 17a2941ec6 am: 388710c7ad am: 4276848f19
Change-Id: I4f892ca07934bd05c1d90465df8f5bd82e58b90c
2020-04-16 07:23:39 +00:00
mincheli
0898b63caa Adds interface to show magnification button for System UI
This change just add the interface and the method.
We'll apply this change in the later change.
So that magnification button UI will be updated by
showMagnificationButton() when magnification mode or
capability settings changed.

Bug: 145780606
Test: atest WindowMagnificationConnectionWrapperTest WindowMagnificationManagerTest
Change-Id: I544b03f62a0a67318585620db61caaa6dc213206
2020-04-16 13:31:24 +08:00
Rhed Jao
8fcba0353e Fixes long press the a11y shortcut no response
An a11y service targeting sdk version > Q and requesting a11y button
should be turned on by the Settings when it's assigned to the a11y
shortcut by the user. An a11y button callback is sent to the a11y
service when the user long press the a11y shortcut.

This issue happened when an disabled a11y service is assigned to the
a11y shortcut, and upgraded to the target sdk version > Q. Framework
fails to send the callback and no response when user long press the
shortcut.

Turns on the a11y service and show up a toast to fix this issue.

Bug: 153517972
Test: atest AccessibilityShortcutControllerTest
Change-Id: Ie4fc9bbeaf08ba674cfe6382eab214b2a15c004c
2020-04-16 12:14:23 +08:00
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