summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/ViewParent.java
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2013-06-04 17:22:14 -0700
committerSvetoslav <svetoslavganov@google.com>2013-06-05 15:16:05 -0700
commit6254f4806dd3db53b7380e77fbb183065685573e (patch)
tree554ff88119ae63465cbd4bd51a7e26ef0869cddb /core/java/android/view/ViewParent.java
parent85de5f420efaaf20c9dcaf09035b0fb3980b76ab (diff)
downloadframeworks_base-6254f4806dd3db53b7380e77fbb183065685573e.zip
frameworks_base-6254f4806dd3db53b7380e77fbb183065685573e.tar.gz
frameworks_base-6254f4806dd3db53b7380e77fbb183065685573e.tar.bz2
Optimizing AccessibilityNodeInfo caching.
1. Before we were firing an accessibility event from the common predecessor of views with accessibility related state changes every X amount of time. These events designate that the tree rooted at the source is invalid and should not be cached. However, some of the state changes do not affect the view tree structure and we can just refresh the node instead of evicting and recaching nodes infos for views that did not change. Hence, we need a way to distinguish between a subtree changed over a node changed. Adding a new event type will not work since if say two siblings have local changes and their predecessor fires a window state change event, the client will drop the subtree rooted at the parent including the two views with changes. Subsequent, more specialized events emitted from the two changed siblings will be useless since the parent which did not changed is already evicted from the cache. Conversely, if the specialized events are fired from the two siblings with local changes and they are refreshed in the cache the subsequent window state change event from the common predecessor will force the refreshed nodes to be evicted. Hence, to enable distinction between node being changed and a subtree baing changed while not changing existing behavior, we will fire only window content change event with an additional argument specifying what changed - node or a subtree for now. Also if the changes are local to a view we fire the window content changed event from the view. So, the two siblings will fire such an event independently and the client will know that these are local changes and can just refresh the node. If the changes are structural, then we fire the window state change event from the common predecessor. 2. Added the input type of a text view as one of the properties reported by an AccessibilityNodeInfo. It is nice to prompt the user what input is expected. 3. Added a bundle for optional information to AccessiiblityNodeInfo. For example, it will be used for putting web specific properties that do not map cleanly to Android specific ones in WebView. 4. AccessibilityInteractionController was not taking into account whether the current accessibility focused node is shown before returing it. Hence, a disconnected node would be returned and caching it puts our cahche in an inconsistent state. Change-Id: I8ed19cfb4a70bdd7597c3f105487f1651cffd9e0
Diffstat (limited to 'core/java/android/view/ViewParent.java')
-rw-r--r--core/java/android/view/ViewParent.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/java/android/view/ViewParent.java b/core/java/android/view/ViewParent.java
index d79aa7e..2ebc1a1 100644
--- a/core/java/android/view/ViewParent.java
+++ b/core/java/android/view/ViewParent.java
@@ -292,13 +292,14 @@ public interface ViewParent {
public ViewParent getParentForAccessibility();
/**
- * A child notifies its parent that its state for accessibility has changed.
- * That is some of the child properties reported to accessibility services has
- * changed, hence the interested services have to be notified for the new state.
+ * A child notifies its parent that the accessibility state of a subtree rooted
+ * at a given node changed. That is the structure of the subtree is different.
+ *
+ * @param The root of the changed subtree.
*
* @hide
*/
- public void childAccessibilityStateChanged(View child);
+ public void childAccessibilityStateChanged(View root);
/**
* Tells if this view parent can resolve the layout direction.