Fix crash when using list of enabled a11y services
AccessibilityManagerService#getEnabledAccessibilityServiceList had an optimization to always return the same, statically allocated object. This is almost safe if it's being called from another process, as Binder will copy it. When called from the same process, however, it's a lot less safe and seems to have caused a crash. I think the optimization was already problematic in Binder calls as well, though. The method grabs a lock, but I think it's still possible for another thread to call the method while Binder is making the copy. I'm removing the optimization and just allocating a new List to prevent such crashes. Bug: 36364829 Test: No repro case, so I just ran a11y CTS and unit tests. Change-Id: Ib64703a7bbed82c6ca000d8703d23819188b4b9b
Loading
Please register or sign in to comment