Release the A11yManagerService#mLock before calling WMS#addWindowToken.
To enable the flag:
adb shell device_config put accessibility \
com.android.server.accessibility.add_window_token_without_lock true
Bug: 297972548
Test: Perform the below tests with flag disabled & enabled...
Test: Use a service with an overlay; observe behavior is unchanged
Test: atest CtsAccessibilityServiceTestCases
Test: atest FrameworksServicesTests:com.android.server.accessibility
Change-Id: I8599bc9bf26ba86c9aef35cf027408868cfece53
diff --git a/services/accessibility/accessibility.aconfig b/services/accessibility/accessibility.aconfig
index 0480c22..11189cf 100644
--- a/services/accessibility/accessibility.aconfig
+++ b/services/accessibility/accessibility.aconfig
@@ -25,5 +25,12 @@
name: "send_a11y_events_based_on_state"
namespace: "accessibility"
description: "Sends accessibility events in TouchExplorer#onAccessibilityEvent based on internal state to keep it consistent. This reduces test flakiness."
-bug: "295575684"
-}
\ No newline at end of file
+ bug: "295575684"
+}
+
+flag {
+ name: "add_window_token_without_lock"
+ namespace: "accessibility"
+ description: "Calls WMS.addWindowToken without holding A11yManagerService#mLock"
+ bug: "297972548"
+}