Commit Graph

810 Commits

Author SHA1 Message Date
Ryan Lin
1f8a87d8cf Merge "Fix touchexploration multi-finger gesture conflict" 2021-02-25 09:23:13 +00:00
ryanlwlin
cb49d47bc6 Fix touchexploration multi-finger gesture conflict
WindowMagnificationGestureHandler has higher priority to address
motion events. When the user put two fingers down on the screen,
magnification gesture detector will intercept all motion events.
It ends up the user couldn't perform any multi-finger gestures.

To fix it, we make magnification gesture detection more accurate:
1. swiping gesture sucesses only with one finger.
2. Regarding two-finger gesture, only swipe or stay on the screen
over a duration will be recognized.

Bug: 163016948
Test: manually test: enable Talback and perform 3-finger swipe gesture
      atest com.android.server.accessibility.magnification
Change-Id: I310cf6e3fb2cb2b5b6fbc6a0ba9f0aa1d219b4df
2021-02-25 13:39:00 +08:00
Phil Weaver
c7c7cadb7a Merge "Fix concurrent modify exception for A11y" am: 2dcd402cdc am: 0b6b68b0ae am: 6881bf4a6e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1593751

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id80754eb08e878e16e1e1f9b738c0baf749d23aa
2021-02-23 23:47:17 +00:00
Phil Weaver
0b6b68b0ae Merge "Fix concurrent modify exception for A11y" am: 2dcd402cdc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1593751

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie98305d5930ee7426bb8169d8f4a70d76e5383f6
2021-02-23 23:28:16 +00:00
TreeHugger Robot
e463a7d440 Merge "Fix NullPointerException in AccessibilityServiceConnection#dispatchGesture" into sc-dev 2021-02-22 02:44:35 +00:00
Minche Li
966a1b152f Merge "Adjusts the default magnification settings for config_magnification_area" into sc-dev 2021-02-19 05:17:45 +00:00
liulvping
8f22ff722e Fix concurrent modify exception for A11y
Bug: 180524510
Test: manual test

Change-Id: I9f0087c99872633f27a7e5b8355087d03ea2cb00
Signed-off-by: liulvping <liulvping@xiaomi.com>
2021-02-18 12:39:32 +08:00
Hiroki Sato
20fee32acc Fix NullPointerException in AccessibilityServiceConnection#dispatchGesture
Previous change [1] accidentally deleted null check.
This change restores it.

[1] I8a1e4884d1283705d409ed38e35047ec2dcd89f0

Bug: 180554945
Bug: 180056331
Test: CtsAccessibilityServiceTestCases
Change-Id: Ia32ce1da41bcf3fda1476dd8a49ba363d1ad850f
2021-02-18 03:13:29 +00:00
Hongming Jin
687bdff9b5 Add shell command to enable/disable trace.
Bug: 157601519
Test: adb shell cmd accessibility start-trace
      adb shell cmd accessibility stop-trace
Change-Id: I8c21f15e35b8031ee1cdfef02082e9aa07bb070c
2021-02-14 21:15:18 -08:00
TreeHugger Robot
0170af7b47 Merge "Move Gesture ID 43 from two-finger single tap and hold to two-finger triple tap and hold." into sc-dev 2021-02-09 20:20:15 +00:00
TreeHugger Robot
e418222e6a Merge "Dispatch accessibility gesture if device supports touch" into sc-dev 2021-02-09 05:36:36 +00:00
Hiroki Sato
b45af76b3d Dispatch accessibility gesture if device supports touch
This change fixes the issue where AccessibilityService was not able to
dispatch a gesture if a device doesn't have a touchscreen hardware
feature, resulting the behavior gap between CTS and framework.

With this CL, AccessibilityService can dispatch a gesture if the device
declares touchscreen or faketouch hardware features.

Bug: 177021722
Test: AccessibilityManagerServiceTest AccessibilityServiceConnectionTest
Test: CtsAccessibilityServiceTestCases on crosshatch and kindred
Change-Id: I8a1e4884d1283705d409ed38e35047ec2dcd89f0
2021-02-08 23:41:50 +00:00
Charles Chen
b80fdde45f Remove addWindowTokenWithOptions
Since WindowContext won't add WindowToken from the client side,
addWindowTokenWithOption is no more needed. Also remove the logic
to invoke removeWindowToken from the client side.

Bug: 159767464
Bug: 153369119
Test: atest WindowManagerServiceTests WindowManagerPermissionTests
Change-Id: Ib0c948dca223cf8d056865ce3a0d4adaef07d247
2021-02-06 15:47:08 +08:00
mincheli
2e3f08b1e8 Adjusts the default magnification settings for config_magnification_area
Cnfig flag, config_magnification_area, determines if the device
supports magnification area or not.
If OEM doesn't support magnification area, we should adjust the
magnification capability setting and window magnification prompt
setting.

Bug: 177371954
Test: atest SettingsBackupTest
Change-Id: I67947285eb6a73b8e0e21d1db866c426a0ea49d7
(cherry picked from commit f9d7150a5c)
Merged-In: I67947285eb6a73b8e0e21d1db866c426a0ea49d7
2021-02-05 07:43:41 +00:00
Ameer Armaly
bc1a2bdc44 Move Gesture ID 43 from two-finger single tap and hold to two-finger triple tap and hold.
Bug: 178849493
Test: atest AccessibilityGestureDetectorTest

Change-Id: Ibb3826ba2afd2b932d8e1491b601157285f9d67a
2021-02-02 22:22:34 +00:00
Ameer Armaly
0551453e86 Fix incorrect logic in multi-finger multi-tap and hold.
Bug: 179168487
Test: atest AccessibilityGestureDetectorTest
Change-Id: I8592dbe7684d8d763821da0b883b9a7d74e3ebae
2021-02-02 22:21:00 +00:00
Sunny Goyal
4ee257ce72 Replacing some explicit recents components checks with permission checks
Bug: 177096054
Test: Presubmit for quickstep
Change-Id: Ia824ed21a3836548eccb186ee7c9a3f697e9ee66
2021-01-28 17:28:18 -08:00
Minche Li
d9ce52ec07 Merge changes from topic "magnification_switch"
* changes:
  Notifies updating magnification switch visibility when the magnification shortcut is triggered
  Notifies showing magnification switch when the touch interaction starts or ends
  Not need to show magnification switch UI when magnification scale is changed
2021-01-21 08:12:03 +00:00
Jacky Kao
068c567fdd Allow services enabled after force close
When an A11y service is enabled, it would be added into the list
of the crashed services after doing force close. Then users can't
enable this service until users disable this service again based
on our crashed mechanism now.

The A11y service would be removed from the list of enabled
services after doing force close. We need to remove this service
from the list of the crashed service at the same time to make sure
users can enable this service next time immediately.

Bug: 174616279
Test: a11y CTS & unit tests
Test: manual testing by the steps in the bug
Change-Id: Ie09a11dd2eb2ed7237b580e69c46751ef404b96a
2021-01-07 15:44:53 +08:00
Adam Wright
68e25d8da0 Merge "Revert "Prefetching can be interupted by other service requests."" 2020-12-23 13:48:53 +00:00
Jacky Kao
80401a0a1c Merge "Keep changed focus data after service disable" 2020-12-23 03:57:59 +00:00
Adam Wright
c3060eae38 Revert "Prefetching can be interupted by other service requests."
This reverts commit 103dd32a74.

Reason for revert: Looking for culprits for b/176078134

Change-Id: I1e2524411fcc91a2c212d4ee5a0f5b74cac0bda4
2020-12-22 16:06:09 +00:00
Jacky Kao
ad119d9a78 Keep changed focus data after service disable
Since in reality only one service at a time (and maybe ever) will care
about these focus data, letting services change these parameters and
leaving it alone even that service is disable.

Bug: 175732114
Test: a11y CTS & unit tests
Change-Id: Ic1f9d29c35ebccbabb6b35b9f113920b992af0df
2020-12-22 08:37:30 +08:00
Qasid Ahmad Sadiq
103dd32a74 Prefetching can be interupted by other service requests.
Slow prefetch requests would block user interactive requests, creating
noticeable sluggishness and unresponsiveness in accessibility services,
especially on the web.

Let's make it so a user interactive requests stops prefetching.
We can't interupt an API call, but we can stop in between API calls.

On the service side, we have to seprate the prefetch callbacks from the
find callback. And we have to make it asynchrnous. It does dispatch into
the main thread, so the AccessibilityCache can remain single threaded.

When the calls are interupted on the application side, returnPendingFindAccessibilityNodeInfosInPrefetch checks the find requests that are waiting in the queue, to see if they can be addressed by the prefetch results. If they can be, we don't have to call into potentially imperformance application code.

Bug:30969887
Test: Performance measurements, tried it out by hand to see if their are any bugs. CTSAccessibility*

Change-Id: Ia8f1152afa3987f262f37ed4583775acdd32db43
2020-12-16 00:13:55 -08:00
mincheli
5909b00f8b Notifies updating magnification switch visibility when the magnification shortcut is triggered
When the magnification is off then a user toggles on magnification by the
magnification shortcut (a11y button or triple-tap gesture),
the switch button should be shown immediately.
When the magnification is on then a user toggles off magnification by the
magnification shortcut, the switch button should be removed immediately.

Bug: 170976389
Test: atest FullScreenMagnificationGestureHandlerTest WindowMagnificationGestureHandlerTest MagnificationControllerTest
Change-Id: I28869f0954d0befd5c675e5f22c303d128e8d8d3
2020-12-16 13:56:47 +08:00
mincheli
ed2f7d4b3d Notifies showing magnification switch when the touch interaction starts or ends
In the previous design, we notify syetem UI that magnification scale
is changed and it is time to show the magnification switch button.
While the new UX behavior is changed now, we want system UI get
the notification whenever a user touch interaction on the screen starts,
ends  or cancels when the magnification is activated.
Doc: go/window-magnify-ux ,page3

Bug: 172631612
Test: atest AccessibilityManagerServiceTest FullScreenMagnificationGestureHandlerTest
  MagnificationControllerTest WindowMagnificationGestureHandlerTest
Change-Id: Id3243702e8edea98da5c1230fd8d74973f002377
2020-12-16 13:56:13 +08:00
Qasid Sadiq
88f2c35b55 Merge "Remove recycling magnificationSpec and region." 2020-12-16 00:21:33 +00:00
Qasid Ahmad Sadiq
179a6b0683 Remove recycling magnificationSpec and region.
It doesn't seem like this would add a performance bump, but it does make
code quite ab it more complex (especially the prefetching CL).
Let's remove it to avoid bugs.

Test: CTSAccessibility* Tried it by hand.
Bug: 30969887
Change-Id: Ibc2fb856dbb1a0f7786882d4b89d71bbcb7e5af2
2020-12-14 18:35:45 -08:00
Sally Yuen
56ffbf68b0 Merge "Add support to play back MotionEvent data for gestures" 2020-12-15 01:27:15 +00:00
mincheli
fe1579e251 Not need to show magnification switch UI when magnification scale is changed
In the new design, we show the magnification switch UI when the touch
interaction starts, ends or cancels.
We don't need to notify showing the switch UI when the scale is changed
because the new design includes the case for scale changes.
So we can remove the implementation of onMagnificationScaleChanged.

Bug: 172631612
Test: atest FullScreenMagnificationGestureHandlerTest MagnificationControllerTest
Change-Id: I245b611d8a6a50aeff008257cbb87dfed8fd8962
2020-12-11 17:45:09 +08:00
Sally
172a5dd98e Add support to play back MotionEvent data for gestures
Also add debug logging for touch explore and pass through gestures

Bug: 173229079
Test: atest com.android.server.accessibility.gestures.TouchExplorerTest#testTouchExploreGestureLog
atest com.android.server.accessibility.gestures.TouchExplorerTest#testThreeFingerSwipeDownGestureLog
atest TouchExplorerTest

Change-Id: Ie66b7be4f2bc4fdfb35fce2540109a5b5465667c
2020-12-08 01:58:06 +00:00
Jacky Kao
9e73bfc2f3 Allow A11yService to customize accessibility focus
1. Define and implement new APIs to set and get the stroke width
and color of the A11y focus rectangle.
2. New an AccessibilityFocusApperanceData variable with the default
value in the A11yUserState class, and it would be used in the A11y
framework.
3. When A11y services sets the stroke width and color of the focus
rectangle, A11yUserState will apply the same value through
A11yServiceConnection and notify this change to A11yManager.
4. When A11y services customized the data is disabled, reseting the
data in the A11yUserState and notifying this change to A11yManager.
5. When the ViewRootImpl gets the A11yFocusDrawable, it changes the
strokewidth and the color of this drawable based on the value from
A11yManager.

Bug: 141144573
Test: a11y CTS & unit tests

Change-Id: I1493f17f7cc25744e1435c9070218c6f7efa8bcf
2020-12-04 09:55:11 +08:00
Ryan Lin
e65dbba05a Merge "Apply big text style to the notification" 2020-12-03 01:15:56 +00:00
mincheli
a8c9dd0809 Refactoring for magnification [2/n]
This change doesn't change any user behavior.
It's refactoring that reduce the common code and logic.
1. Moves the common logic of onMotionEvent to the parent
class, MagnificationGestureHandler.
2. Moves some of the debug flags to the parent class.

Bug: 174291719
Test: atest com.android.server.accessibility.magnification
Change-Id: If0a4a5e934a650b40e064dc3a0b72ce68780409b
2020-12-02 03:24:33 +00:00
mincheli
9f0f172a1a Refactoring for magnification [1/n]
This change doesn't change any user behavior.
It's refactoring that reduce the common code and logic.
1. Adds the common varibles to the parent class, MagnificationGestureHandler
for fullscreen and window MagnificationGestureHandler.
2. Moves the implementation of  onMagnificationScaleChanged() from
AccessibilityManagerService to MagnificationController.

Bug: 174291719
Test: atest AccessibilityManagerServiceTest FullScreenMagnificationGestureHandlerTest
  MagnificationControllerTest WindowMagnificationGestureHandlerTest
Change-Id: Ic4d6c966600a113fd06e7165353e014aca3189bf
2020-12-02 02:37:22 +00:00
ryanlwlin
530a79cefe Apply big text style to the notification
To ensure the user could see whole content, we apply big text style
Bug: 174131708
Test: adb shell settings put secure accessibility_show_window_magnification_prompt 1

Change-Id: I2ccec4e2e0167c1d0b2b7d81bafa8c38497388dc
2020-12-02 09:43:03 +08:00
Ryan Lin
00bca78ece Merge "Show notification to promote window magnification mode available" 2020-11-19 08:37:51 +00:00
Ameer Armaly
fd24f5cadb [DO NOT MERGE] Transition to clear state after gesture cancelation. am: a9027a7f9f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13036714

Change-Id: Idfc6d16c3048fdf1f49cbb3dc34ddef5cb6195b3
2020-11-18 19:34:04 +00:00
TreeHugger Robot
7e2a4e8c08 Merge "Remove speed requirements for multi-finger swipes" 2020-11-18 19:29:01 +00:00
Adam Bookatz
961f737505 Merge "Move UserManagerInternal out of android.os" 2020-11-18 17:38:06 +00:00
Adam Bookatz
e5140cc83b Move UserManagerInternal out of android.os
Moving this class out of android.os will reportedly
greatly reduce ART overhead.

Test: compiles
Test: atest FrameworksServicesTests FrameworksCoreTests
Bug: 165817914
Exempt-From-Owner-Approval: no-op refactoring
Change-Id: I1f3e77120979e2f336e5f42e4ec6e459d6492083
2020-11-17 20:43:46 +00:00
Ameer Armaly
09b9fb180d Remove speed requirements for multi-finger swipes
Once one of the fingers has moved more than (fingerCount * touchSlop), gesture detection will start and will not cancel no matter how slow the user moves. The reasoning behind speed requirements in one-finger swipes is to distinguish between touch exploration and gesture detection. There is no such problem here.
Bug: 172670126
Bug: 170902208
Bug:162521649
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: I760036415192cd1368a06b04355b775299c29d16

Change-Id: I796d6e5476cb5dc60aa85ba33c04ad62dce88eba
2020-11-16 15:48:06 -08:00
Ameer Armaly
a9027a7f9f [DO NOT MERGE] Transition to clear state after gesture cancelation.
The agreed-upon behavior has always been that after gesture cancelation, touch explorer would exist in essentially a dead state.
It should not be possible to execute a two-finger passthrough gesture for example after doing an invalid gesture.
This is likely why we see GESTURE_PASSTHROUGH in cases where we expect GESTURE_UNKNOWN.
Fix: 171421786
Bug: 162521649
Test: manual
Change-Id: Idce921c5278dea174ec5dad5cecf046f12ab113d

Change-Id: Ic71246adc613ea60d3f25974e4085814c4b3211d
2020-11-12 19:04:50 +00:00
ryanlwlin
3badad790d Show notification to promote window magnification mode available
The magnification mode is full-screen when the migrating deivce turns on
magnification settings.
We show a notification prompt the user that new window magnifier to
guide the user to take a look.

Bug: 168635084
Test: 1. adb shell settings put secure \
      accessibility_show_window_magnification_prompt 1
      2. use full-screen magnification to see if it works well.
      atest WindowMagnificationPromptControllerTest
      atest FullScreenMagnificationGestureHandlerTest
Change-Id: I40dfc49307d2dad380f1e662960d35f5cc5e7524
2020-11-12 22:53:55 +08:00
Ameer Armaly
eafe1e9e3e Transition to clear state after gesture cancelation.
Under some circumstances, remaining in gesture detecting state after gesture cancelation can render TouchExplorer unresponsive to touch input. The clear state is unresponsive to everything but ACTION_DOWN.
Bug: 171421786
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: I9516d3613e92baf16186c24a269866a4143cafc3

Change-Id: I42780f5c733f20b99cb95952d9035109e57750cd
2020-11-11 17:43:16 +00:00
Jacky Kao
30c09098eb Merge "Fix the focus not move to the place where the finger clicks" into rvc-qpr-dev am: f7396a4e5b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13015377

Change-Id: Ib74c9763fd1c9e8586da4e91f049a7883d4b9916
2020-11-10 23:50:15 +00:00
Jacky Kao
750b659bb2 Fix the focus not move to the place where the finger clicks
User does the triple tap operation, but the gesture detection
becomes to doubleTapAndHold because the timing of the motion
event. Then the long pressing data is created but not be cleared
when the state returns to STATE_CLEAR.
Adding the long pressing data reset to fix this issue.

Bug: 162521649 and 163298552
Test: a11y CTS & unit tests
Change-Id: I40d89ea958bee619c64799de591be96bf92efbfc
Merged-In: I5fc23a14b0a4ae3c7c012cb4ed8dc924c00e7fe9
2020-11-09 23:57:25 +00:00
Ameer Armaly
1cd4bd9ccf Do not transition from gesture detection state after gesture cancelation.
The agreed-upon behavior has always been that after gesture cancelation, touch explorer would exist in essentially a dead state.
It should not be possible to execute a two-finger passthrough gesture for example after doing an invalid gesture.
This is likely why we see GESTURE_PASSTHROUGH in cases where we expect GESTURE_UNKNOWN.
Fix: 171421786
Test: manual
Change-Id: Idce921c5278dea174ec5dad5cecf046f12ab113d

Change-Id: If9aeb611417bba08edd9f5a11f3d107c0b477bb8
2020-11-06 10:36:34 -08:00
Jacky Kao
06cb4221e8 Merge "Fix the focus not move to the place where the finger clicks" 2020-11-05 07:51:28 +00:00
Jacky Kao
bc96e7ef33 Fix the focus not move to the place where the finger clicks
User does the triple tap operation, but the gesture detection
becomes to doubleTapAndHold because the timing of the motion
event. Then the long pressing data is created but not be cleared
when the state returns to STATE_CLEAR.
Adding the long pressing data reset to fix this issue.

Bug: 163298552
Test: a11y CTS & unit tests

Change-Id: I5fc23a14b0a4ae3c7c012cb4ed8dc924c00e7fe9
2020-11-05 13:26:55 +08:00