OSDN Git Service

Fix a11y cache correctness bug
authorPhil Weaver <pweaver@google.com>
Tue, 17 Jul 2018 19:28:24 +0000 (12:28 -0700)
committerPhil Weaver <pweaver@google.com>
Tue, 17 Jul 2018 22:38:33 +0000 (15:38 -0700)
commita4002c8daf272f550787d94bed8e81749a891e66
treee98308c621d2151d95b276d3ab71dbcf12e3ba73
parente90533787db2f7157fad0cfb6e77d99d3b4d5cc5
Fix a11y cache correctness bug

If two views change, their common ancestor can send
a subtree_changed event. But the cache is dropping
events that come from views that it hasn't cached.

Now clearing the cache entirely when a node not in
the cache sends a subtree changed event, since we
don't know which nodes are descendents and which
may have changed.

I'm not thrilled with this change, since it may
degrade performance, but I want to fix the correctness
problem quickly.

Bug: 111554539
Test: atest AccessibilityCacheTest
Change-Id: Ib32d3622cddd7001663943eff71e823d21f5e500
core/java/android/view/accessibility/AccessibilityCache.java
core/tests/coretests/src/android/view/accessibility/AccessibilityCacheTest.java