Skip to content
Commit 0adcce60 authored by Charles Chen's avatar Charles Chen Committed by Xin Li
Browse files

Fix Accessibility apps crash when adding view by

... 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
parent 26cf681a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment