am d9c99124: Merge "Incorrect temporary detach of accessibility focused view may lead to a crash." into jb-mr1-dev

* commit 'd9c99124d4870361c7c1e28fb78adf245eb1305a':
  Incorrect temporary detach of accessibility focused view may lead to a crash.
This commit is contained in:
Svetoslav Ganov
2012-10-05 20:06:50 -07:00
committed by Android Git Automerger
2 changed files with 7 additions and 3 deletions

View File

@@ -3912,7 +3912,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* @see #removeDetachedView(View, boolean)
*/
protected void detachViewFromParent(View child) {
child.clearAccessibilityFocus();
removeFromArray(indexOfChild(child));
}
@@ -3934,7 +3933,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* @see #removeDetachedView(View, boolean)
*/
protected void detachViewFromParent(int index) {
getChildAt(index).clearAccessibilityFocus();
removeFromArray(index);
}

View File

@@ -2324,7 +2324,13 @@ public final class ViewRootImpl implements ViewParent,
mAccessibilityFocusedHost.getDrawingRect(bounds);
if (mView instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) mView;
viewGroup.offsetDescendantRectToMyCoords(mAccessibilityFocusedHost, bounds);
try {
viewGroup.offsetDescendantRectToMyCoords(mAccessibilityFocusedHost, bounds);
} catch (IllegalArgumentException iae) {
Log.e(TAG, "Temporary detached view that was neither removed not reattached: "
+ mAccessibilityFocusedHost);
return;
}
}
} else {
if (mAccessibilityFocusedVirtualView == null) {