Files
frameworks_base/core/java/android/accessibilityservice
Charles Chen 0adcce60ad 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
2021-05-19 09:06:03 +00:00
..
…