- Maintain a static collection of caches (sCaches). Lock is
sConnectionCache
- Initialize a cache when a connection is added. (client.addConnection)
- Remove the cache when a connection is removed. (client.removeConnection)
- System server should not have its cache initialized, can remove
parameter in AccessibiltyInteractionClient constructor
I tried to maintain a local reference (mAccessibilityCache) to the
service cache for each client to avoid accessing the static
collection for each request. But since the process is not immediately
killed when the service is turned off, ensuring resources are cleared
correctly is big time investment that can be done later if desired.
Bug: 192489177
Test: Build and use talkback, do the slew of tests.
atest CtsAccessibilityServiceTestCases CtsAccessibilityTestCases
CtsUiAutomationTestCases
FrameworksServicesTests:com.android.server.accessibility
FrameworksCoreTests:com.android.internal.accessibility
FrameworksCoreTests:android.view.accessibiliity
Change-Id: Ic30f6915c7b3c186a512ed8b410bf6e842eff5fb
MagnificationConfig stores the magnification configuration of the
controlling magnifier, such as magnification mode, scale and center
postion.
And MagnificationProcessor uses the config to controll the magnifier for
AccessibilityService.
See
API review doc: go/b200769372
Design doc: go/a11yservice_control_magnification_in_t
The chapter at Proposal A and MagnificationConfig
CTS: ag/15824302
Bug: 199732498
Test: atest AbstractAccessibilityServiceConnectionTest,
atest MagnificationProcessorTest,
atest WindowMagnificationManagerTest,
atest MagnificationConfigTest
Change-Id: I20323865d2efe1b40626f0c86767848733856482
From Android R, using the WindowManager from non-ui context
violates the vm policy. It may cause incorrect window bounds
with the given floating window. AccessibilityService provides
Accesibility overlay usage that needs to set window token to
the windowManager. However, Setting it when the service is bounded
violates the policy.
To fixt it, we set the window token when developers get WindowManager
first time.
Bug: 175785781
Test: atest AccessibilityOverlayTest, use the test apk to check if
the warning message is shown in the log
manual test to see if SelectToSpeak works well
Change-Id: Ia873488626aa4da111499282d1971f836cf111cd
Change-Id: Ia87df60c393bb0e40d85ced4184c78a09d7b427b
Allow AccessibilityService instances to request screenshots more
frequently (up to three screenshots per second). This used to be capped
at one screenshot per second in Android R.
Test: cts
Bug: 188077373
Change-Id: I880e2d922db3ce2bd075efcb02466ea1f4914792
(cherry picked from commit 113436f49f)
Allow AccessibilityService instances to request screenshots more
frequently (up to three screenshots per second). This used to be capped
at one screenshot per second in Android R.
Test: cts
Bug: 188077373
Change-Id: I880e2d922db3ce2bd075efcb02466ea1f4914792
... AccessibilityService created WindowContext
In R, we introduce WindowContext to handle non-activity windows. When
developers want to add an accessibility overlay window on secondary
display, it is suggested to call
createDisplayContext(secondaryDisplay)
.createWindowContext(TYPE_ACCESSIBILITY_OVERLAY, null) or call
createWindowContext(secondaryDisplay, TYPE_ACCESSIBILITY_OVERLAY, null)
in S.
However, it doesn't work now because the WindowToken with type
TYPE_ACCESSIBILITY_OVERLAY is managed by system server, and Accessibility
app should obtain the WindowToken to attach the overlay window.
The current mechanism of AccessibilityService is to set default token to
WindowManager for created DisplayContext. This CL follows this mechanism
on WindowContext to set the default token.
Test: atest AccessibilityServiceTest
fixes: 186085801
Change-Id: I2ac2cf1c72adebf33eb6b6883437a7f13993d8a9
We added a flag to restore the passthrough for multifinger gestures, but left it hidden for the QPR. It should be made public for S so TalkBack doesn't continue to use non-public APIs.
Fix: 187458811
Test: manual
Change-Id: I02fa6b9e4dacec131aac86adc54386ad7b6249ad
In an effort to reduce unnecessary String operations and Binder calls
from AccessibilityInteractionClient, also add channels to propagate
tracing state to AccessibilityInteractionClient through
AccessibilityManager.
Bug: 157601519
Test: adb shell cmd accessibility start-trace
adb shell cmd accessibility stop-trace
Change-Id: Idfe220bc64a9c83679201b9a9a36b1c492f9d6cc
As discussed in b/159334261, although the current a11y use-cases for
closing the notification shade are already handled, it makes sense to
add an explicit global action for accessibility services to close the
notification shade (especially given there is one for opening the shade
already).
Added dependency to SystemActions, which required me to change add
SystemActions to SystemUIGoogleBinder (topic). I also added to
CarSystemUIBinder since SystemActions was also in their xml. I don't
know if I need to add to others (eg. Arc), please advise.
Bug: 159334261
Bug: 159105552
Test: With the shade opened, as a11y service send
GLOBAL_ACTION_DISMISS_NOTIFICATION_SHADE and verify shade is
closed.
Change-Id: If52a1763170d5a5efd6b4756794206fd8bfb18a0
AccessibilityService is a powerful service that could view the content
or control the device. However, some apps using it is not for
accessibility. We would like to add "isAccessibilityTool" property in
the xml to distinguish its purpose.
If the Accessibilityservices is not for users with disabilities,
system would inform the user after enabling for a period of time.
Bug: 176960226
Test: atest CtsAccessibilityTestCases#AccessibilityServiceInfoTest
Change-Id: I91327470ce39a28e701fa6841f9edccc1a92ffe4
This allows for better error reporting in tests and services.
Bug: 159651900
Test: atest GestureManifoldTest TouchExplorerTest AccessibilityGestureDetectorTest FrameworksServicesTests:TouchExplorerTest
Change-Id: Ic65ff7100ade77bbf26d538a033e9e000e6b9bcc
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
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
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Merged-In: I8285daa8530260251ecad6f3f38f98e263629ca7
Change-Id: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.
APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I
Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
Bug: 159651900
Test: manually enable the flag and turn on debugging. Observe motion events being dispatched as part of the AccessibilityGestureEvent.
Change-Id: Ia27dcfd3b3fe0af423d9b10054ba69a6914e0f78
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.
The change was generated by running
find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'
in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.
Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580