Skip to content

Commit 88ae2e2

Browse files
sganovAndroid Git Automerger
authored andcommitted
am d9c9912: 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.
2 parents 0a12b8e + d9c9912 commit 88ae2e2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

core/java/android/view/ViewGroup.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3912,7 +3912,6 @@ protected void attachViewToParent(View child, int index, LayoutParams params) {
39123912
* @see #removeDetachedView(View, boolean)
39133913
*/
39143914
protected void detachViewFromParent(View child) {
3915-
child.clearAccessibilityFocus();
39163915
removeFromArray(indexOfChild(child));
39173916
}
39183917

@@ -3934,7 +3933,6 @@ protected void detachViewFromParent(View child) {
39343933
* @see #removeDetachedView(View, boolean)
39353934
*/
39363935
protected void detachViewFromParent(int index) {
3937-
getChildAt(index).clearAccessibilityFocus();
39383936
removeFromArray(index);
39393937
}
39403938

core/java/android/view/ViewRootImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2324,7 +2324,13 @@ private void drawAccessibilityFocusedDrawableIfNeeded(Canvas canvas) {
23242324
mAccessibilityFocusedHost.getDrawingRect(bounds);
23252325
if (mView instanceof ViewGroup) {
23262326
ViewGroup viewGroup = (ViewGroup) mView;
2327-
viewGroup.offsetDescendantRectToMyCoords(mAccessibilityFocusedHost, bounds);
2327+
try {
2328+
viewGroup.offsetDescendantRectToMyCoords(mAccessibilityFocusedHost, bounds);
2329+
} catch (IllegalArgumentException iae) {
2330+
Log.e(TAG, "Temporary detached view that was neither removed not reattached: "
2331+
+ mAccessibilityFocusedHost);
2332+
return;
2333+
}
23282334
}
23292335
} else {
23302336
if (mAccessibilityFocusedVirtualView == null) {

0 commit comments

Comments
 (0)