fix coordinate calculation of A11yEndToEndTest

Currently,
testTouchDelegateWithEbtBetweenView_ReHoverDelegate_FocusTargetAgain is
using relative coordinate as absolute coordinate.
This makes this test fail when the application is not full screen.
Fix it to use absolute coordinate.

Bug: 161191238
Test: AccessibilityEndToEndTest.testTouchDelegateWithEbtBetweenView_ReHoverDelegate_FocusTargetAgain

Change-Id: Iebd834d2c442634e3f1faca3e79791efb3a6e60d
diff --git a/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java b/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java
index 648c963..4166213 100644
--- a/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java
+++ b/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java
@@ -863,9 +863,11 @@
         final int buttonY = button.getHeight() / 2;
         final int hoverY = buttonLocation[1] + buttonY;
         final Button buttonWithTooltip = mActivity.findViewById(R.id.buttonWithTooltip);
+        final int[] buttonWithTooltipLocation = new int[2];
+        buttonWithTooltip.getLocationOnScreen(buttonWithTooltipLocation);
         final int touchableSize = 48;
-        final int hoverRight = buttonWithTooltip.getLeft() + touchableSize / 2;
-        final int hoverLeft = button.getRight() + touchableSize / 2;
+        final int hoverRight = buttonWithTooltipLocation[0] + touchableSize / 2;
+        final int hoverLeft = buttonLocation[0] + button.getWidth() + touchableSize / 2;
         final int hoverMiddle = (hoverLeft + hoverRight) / 2;
         final View.OnHoverListener listener = CtsMouseUtil.installHoverListener(button, false);
         enableTouchExploration(sInstrumentation, true);