diff options
| author | 2012-04-13 12:05:51 -0700 | |
|---|---|---|
| committer | 2012-04-13 12:05:55 -0700 | |
| commit | 067b091d46c3c2d11a33d25e81c8348fb609b7ab (patch) | |
| tree | 304be02563132d15630dbf47f434b463af61a0e0 | |
| parent | f21bea245a7c305c75906f9c9228ac315e10cd9f (diff) | |
Accessibility query APIs report invisible views.
1. The accessibility querying APIs failed to check whether
all predecessors of a view are visible before reporting it.
bug:6291855
Change-Id: I364a6f08e8d02c7105c00c9fdff0fec033829554
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 2e3ff3841416..7a43cf11e886 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -5071,9 +5071,13 @@ public final class ViewRootImpl implements ViewParent, * @return Whether the view is visible on the screen. */ private boolean isDisplayedOnScreen(View view) { + // The first two checks are made also made by isShown() which + // however traverses the tree up to the parent to catch that. + // Therefore, we do some fail fast check to minimize the up + // tree traversal. return (view.mAttachInfo != null && view.mAttachInfo.mWindowVisibility == View.VISIBLE - && view.getVisibility() == View.VISIBLE + && view.isShown() && view.getGlobalVisibleRect(mTempRect)); } |