AccessibilityNodeInfo bounds in screen incorrect if application scale not one.
1. If the application does not accommodate different screen density the
system applies an application scale equal to the device density over
the a default density. The AccessibilityNodeInfo coordinates were not
reported after applying the compatibility scale, therefore the bounds
in parent and screen were not as perceived by the user.
bug:6764586
Change-Id: Iae2d6ea81049364194c7cb09df2240b5eda3d939
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index b6f0aa2..414bb50 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4820,10 +4820,14 @@
*/
void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) {
Rect bounds = mAttachInfo.mTmpInvalRect;
+ final float applicationScale = mAttachInfo.mApplicationScale;
+
getDrawingRect(bounds);
+ bounds.scale(applicationScale);
info.setBoundsInParent(bounds);
getBoundsOnScreen(bounds);
+ bounds.scale(applicationScale);
info.setBoundsInScreen(bounds);
ViewParent parent = getParentForAccessibility();