summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorQasid Sadiq <qasid@google.com>2019-03-28 19:55:43 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-03-28 19:55:43 +0000
commit46b5d13a54bf7bbe0090c172e8baa20a2c984364 (patch)
tree42fa52b2fa253bb66fd3d3ab4126e2b2ef925ab2 /core/java/android
parent20309bb9c3c734d260297506e00883b94d16a2db (diff)
parent31d0cedcc40df60359e28799925b21aa2b48840e (diff)
Merge "Deprecate boundsInParent in favor of boundInScreen."
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/accessibility/AccessibilityNodeInfo.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index 385d491f49ef..774a359e5d6c 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -1682,17 +1682,29 @@ public class AccessibilityNodeInfo implements Parcelable {
}
/**
- * Gets the node bounds in parent coordinates.
+ * Gets the node bounds in the viewParent's coordinates.
+ * {@link #getParent()} does not represent the source's viewParent.
+ * Instead it represents the result of {@link View#getParentForAccessibility()},
+ * which returns the closest ancestor where {@link View#isImportantForAccessibility()} is true.
+ * So this method is not reliable.
*
* @param outBounds The output node bounds.
+ * @deprecated Use {@link #getBoundsInScreen(Rect)} instead.
+ *
*/
+ @Deprecated
public void getBoundsInParent(Rect outBounds) {
outBounds.set(mBoundsInParent.left, mBoundsInParent.top,
mBoundsInParent.right, mBoundsInParent.bottom);
}
/**
- * Sets the node bounds in parent coordinates.
+ * Sets the node bounds in the viewParent's coordinates.
+ * {@link #getParent()} does not represent the source's viewParent.
+ * Instead it represents the result of {@link View#getParentForAccessibility()},
+ * which returns the closest ancestor where {@link View#isImportantForAccessibility()} is true.
+ * So this method is not reliable.
+ *
* <p>
* <strong>Note:</strong> Cannot be called from an
* {@link android.accessibilityservice.AccessibilityService}.
@@ -1702,7 +1714,9 @@ public class AccessibilityNodeInfo implements Parcelable {
* @param bounds The node bounds.
*
* @throws IllegalStateException If called from an AccessibilityService.
+ * @deprecated Accessibility services should not care about these bounds.
*/
+ @Deprecated
public void setBoundsInParent(Rect bounds) {
enforceNotSealed();
mBoundsInParent.set(bounds.left, bounds.top, bounds.right, bounds.bottom);