Commit Graph

603 Commits

Author SHA1 Message Date
TreeHugger Robot
9933478ea0 Merge "Avoid launching activity-based feature to force stop exist actiivty and recreate it." into rvc-dev 2020-05-16 01:09:05 +00:00
Rhed Jao
a0b9a209e1 Merge "Removes shortcut target when an a11y service is unbound" into rvc-dev 2020-05-15 01:52:23 +00:00
Rhed Jao
2d8bdb146a Removes shortcut target when an a11y service is unbound
The accessibility button and shortcut target is updated by
the Settings app when the user turn on/off the a11y service.
It worked fine before an a11y service disables and turns off
itself using disableSelf api. The accessibility button and
shortcut settings can not get update in this case. Removes
shortcut target if an a11y service is unbound to fix this
issue.

Bug: 156237174
Test: atest AccessibilityShortcutTest
Change-Id: Ie15f7fe06644bd35d30d87383b25df81bf29056d
2020-05-14 21:14:43 +08:00
Ryan Lin
22eadd2455 Merge "Swipe: use event times to check for expiration rather than handlers." into rvc-dev 2020-05-14 07:51:52 +00:00
menghanli
038488eab5 Avoid launching activity-based feature to force stop exist actiivty and recreate it.
Root cause: FLAG_ACTIVITY_CLEAR_TASK would cause the exist activity are finished and new one items to be started. It causes Live Transcribe main activity goes onStart call of new activity is followed by onStop call of old activity, which cause the mic stopping.

Solution: Remmove the FLAG_ACTIVITY_CLEAR_TASK.

Bug: 156455425
Test: Manual test
Change-Id: Ia5c490cc4816fe41b704ca8ed9dce2891cf44c9b
2020-05-14 10:32:46 +08:00
Minche Li
179321d5c7 Merge "Removes the a11y service from the cached service list when onPackageRemoved" into rvc-dev 2020-05-13 02:31:50 +00:00
mincheli
2b76abd763 Removes the a11y service from the cached service list when onPackageRemoved
The disabled a11y service is not removed from the cached service list
when the a11y service package is uninstalled.
To fix it, we have to remove the service from the service list.

Bug: 153507990
Test: manual test & adb shell dumpsys accessibility
Change-Id: Ic1d2ebe3a46faf7237123bcdfca96c79b2c35705
2020-05-12 17:54:51 +08:00
Ameer Armaly
b16b4486df Swipe: use event times to check for expiration rather than handlers.
This is a return to the original logic of the unified gesture detector.

Bug: 153584696
Bug: 153715903
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: I384ade72efa2971476561fe6e19cafbebb012c85

Change-Id: Ibaf2fe73632ff89a0f187fe58d60bbfe71da2206
2020-05-11 16:20:49 +08:00
Jason Hsu
5c8f27a56e Merge "Logs accessibility shortcut behavior." into rvc-dev 2020-05-10 03:06:30 +00:00
jasonwshsu
d9aa03245c Logs accessibility shortcut behavior.
* Uses the atom AccessibilityShortcutReported in westworld.

Bug: 151285965
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive 266
Change-Id: Iba9d829ae35c7a336c38007101bdddfcd3dc2ddb
2020-05-09 22:31:05 +08:00
Qasid Sadiq
d59670170f Merge "Give AccessibilityServices System Capabilities." into rvc-dev 2020-05-07 23:43:57 +00:00
Qasid Ahmad Sadiq
b8e8c095dd Give AccessibilityServices System Capabilities.
For now, this CL is for a conversation on how to give AccesibilityService particular capabilities.

Fixes: 154954447
Test: atest CTSAccessibility*.
Change-Id: I2e47d9a94fda04e60a5eb15a1ec54479c9322b1e
2020-04-29 23:34:47 -07:00
Sally Yuen
12a32f35d7 Merge "Initialize SystemActionPerformer lazily" into rvc-dev 2020-04-28 19:39:48 +00:00
sallyyuen
8146d24d04 Initialize SystemActionPerformer lazily
System health tests indicate regressions.

Bug: 145909124, 154547990
Test: builds
Change-Id: I855dc18ed68ba6cb98e7d921e3f25e4dee147fcb
2020-04-28 10:11:21 -07:00
Ryan Lin
bf82de29cf Merge "Fix didn't bypass touch events with non-empty passthrough Region" into rvc-dev 2020-04-28 02:43:59 +00:00
Minche Li
4ce06dff0a Merge "Adjust down event location when two-finger dragging in TouchExplorer" into rvc-dev 2020-04-28 01:43:57 +00:00
sallyyuen
93edd11724 Fix system action API issues in SystemActions
1) Actions are only registered when the service starts. If the locale
changes, the labels need to be translated, so re-register the actions
when this happens.

2) When its shortcut isn't visible the a11y menu action is a no-op. The
list should be an accurate representation of what actions are available.
Pass SystemActions into NavigationBarFragment, which keeps track of the
shortcut availability,  to unregister/register the action.

To do this, SystemActions exposes register/unregister to the fragment
and makes SYSTEM_ACTION_ID_ACCESSIBILITY_MENU public.

3) Remove Toggle Split Screen from SystemActions. The trigger isn't
system-level but is rather buried in the Recents UI in a button for each
app, and the a11y user can access this like everyone else.
SystemActionPerformer will still handle the legacy action call in
performSystemAction.

4) Rename "Accessibility Menu" to "On-screen Accessibility Shortcut"

Bug: 152636060, 152635646, 154833492
Test: Manual TalkBack test
Change-Id: I9b037f91c8d3b6f193fc9aee95ef73b7f3fbf315
2020-04-27 13:05:57 -07:00
ryanlwlin
5534ac32da Fix didn't bypass touch events with non-empty passthrough Region
When the action down motion event contains in the
mTouchExplorationPassthroughRegion, Touchxplorer didn't bypass the
motion event due to enabled multi-finger gesture.

Bug: 152597224
Test: manual test with set mult-finger-gesture enabled non-empty
      passthrough region
      atest CtsAccessibilityServiceTestCases:TouchExplorerTest
      atest FrameworksServicesTests:TouchExplorerTest
Change-Id: Ifef6a4da98aca8144bfd6deaceb1a110cfdbe5df
2020-04-27 20:00:31 +08:00
mincheli
004bed2801 Adjust down event location when two-finger dragging in TouchExplorer
The bug is happened because the slope between the down event and the
move event of the swipe gesture dispatched from TouchExplorer is
not smooth. So we also ajust the down event position as the moving
event. And we will update the corrupted CTS test case later.

Bug: 152931647
Test: none
Change-Id: I4d4b1ff2975f440dad0babb87d0af1b6ce348f93
2020-04-27 11:07:53 +08:00
Bernardo Rufino
78b06a4129 Merge "Allow sysUI to send a11y events for other package and user" into rvc-dev 2020-04-24 12:16:07 +00:00
Jason Hsu
ea2d4bf1fd Merge changes from topic "rhedjao_a11y_button_rollback" into rvc-dev
* changes:
  Rollback chooser menu to version Q behavior for accessibility button (2/n).
  Rollback chooser menu to version Q behavior for accessibility button (1/n).
2020-04-24 03:07:39 +00:00
Jason Hsu
f6e6cb119e Merge changes from topic "rhedjao_a11y_button_rollback" into rvc-dev
* changes:
  Rollback the changes of a11y button
  Migrates the navi-bar magnification setting key
2020-04-24 03:07:39 +00:00
Peter_Liang
0589ab0ae3 Rollback chooser menu to version Q behavior for accessibility button (2/n).
Allow separate Activities to handle the multiple-target case for the hardware and software shortcuts. Migrate from an extra to an explicit class so the Intent dispatch will launch the correct Activity for the particular shortcut.

Bug: 151294664
Test: manual test
Change-Id: I54bb1d3ab91e2757c465e8763786d0234f6d4ea8
2020-04-23 16:25:17 +00:00
Bernardo Rufino
c7988a90c7 Allow sysUI to send a11y events for other package and user
As discussed, we:
* Allow apps with INTERACT_ACCROSS_USERS(_FULL) to specify an explicit
user (instead of just USER_CURRENT).
* Introduce new signature permission ACT_AS_PACKAGE_FOR_ACCESSIBILITY
and grant it to sysUI. This permissions allow holders to specify another
package on behalf of which they can perform a11y operations.

This is for toasts since now sysUI renders toasts on behalf of the app
for apps targeting R+.

Bug: 152839254
Test: atest FrameworksServicesTests:AccessibilitySecurityPolicyTest
      FrameworksServicesTests:AccessibilityWindowManagerTest
      android.widget.cts.ToastTest
Change-Id: I3541045d574518571f348051d53e24ff1a4a67ef
2020-04-22 17:23:52 +00:00
Jacky Kao
538ee89f2b Merge "Obtain correct screenshot based on device orientation" into rvc-dev 2020-04-22 00:19:35 +00:00
Jacky Kao
333de4e7c3 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 00:19:12 +00:00
Miranda Kephart
44cc1e274b Merge "Add screenshots logging" into rvc-dev 2020-04-21 16:58:54 +00:00
Winson Chung
18c1d27df9 Merge "Add shell command to trigger global action" into rvc-dev 2020-04-21 03:26:56 +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
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
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
Rhed Jao
d15058df55 Rollback the changes of a11y button
Single tap the a11y button should launch the shortcut target
or chooser activity if there are multiple targets assigned to
the a11y button and user does not specify one.

Rollback the channges of ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
and support a new setting key ACCESSIBILITY_BUTTON_TARGETS for
a11y button to maintain a list of targets which is assigned by
user in settings app.

Also, fix some potential issues, such as, disable a11y shortcut
(this is already not supported) and have more checks to verify
a11y button setting value when an a11y service package updated.

Bug: 152264133
Test: atest AccessibilityUserStateTest
Test: atest AccessibilityShortcutTest
Test: atest AccessibilityButtonSdk29Test
Change-Id: Ief7f44cb85eb75b45dc6ffb6e9a967b792959858
2020-04-15 18:02:56 +08: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
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
63f5570796 Merge "Laziliy initialize SystemActionPerformer" into rvc-dev 2020-04-06 23:55:54 +00: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
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
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
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
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
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