Accessibility focus on temporary detached view not cleared.
1. When a view that has accessibility focus is temporary detached
we try to draw the focus highlight and crash. Since the detached
view will be modified and then either attached or detached from
the window we should not keep accessibility focus on a temporary
detached view. Otherwise, we may have a scenario where the user
thinks he is in one item scroll acound and being in completely
different item because of the view being recycled but the user
has no clue.
2. Clearing accessibility focus when the view is removed from the
parent as opposed as when it is detached from the window. Since
we may have transitioning views for removal we do not want
accessibility focus on such views during the anumation.
bug:6457339
Change-Id: I62287a089ec6850fb1d691ae26dea54e1da39c94
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 2972774..4d2bc42 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -6665,6 +6665,7 @@
* @hide
*/
public void dispatchStartTemporaryDetach() {
+ clearAccessibilityFocus();
onStartTemporaryDetach();
}
@@ -11279,7 +11280,6 @@
resetResolvedLayoutDirection();
resetResolvedTextAlignment();
resetAccessibilityStateChanged();
- clearAccessibilityFocus();
}
/**