Account for window bounds in accessibility view click point computation
BUG: 18177402
Change-Id: If591d1b9e5a8a7c4cade3ef4f3ec5e42d623b53c
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 1d09696..0d1a116 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -5901,6 +5901,12 @@
region.op(interactiveRegion, Region.Op.INTERSECT);
}
+ // Take into account the window bounds.
+ final View root = getRootView();
+ if (root != null) {
+ region.op(dx, dy, root.getWidth() + dx, root.getHeight() + dy, Region.Op.INTERSECT);
+ }
+
// If the view is completely covered, done.
if (region.isEmpty()) {
return false;