From 16cc390d7c694a00598d9bd2dc7dd56a8f5736b0 Mon Sep 17 00:00:00 2001 From: Zeyin Wu Date: Fri, 18 Nov 2022 21:01:06 +0000 Subject: [PATCH] Remove redundant constants for content change rate limiting. Bug: 222759137 Test: ran cts test Change-Id: I559f1a638aca92ee97865e31ad5c557eb3992bad --- core/api/current.txt | 2 -- core/api/test-current.txt | 1 - core/java/android/view/ViewConfiguration.java | 1 - .../accessibility/AccessibilityNodeInfo.java | 27 +++---------------- 4 files changed, 3 insertions(+), 28 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index e7194df0f97d5..04a9eb5edc816 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -52589,13 +52589,11 @@ package android.view.accessibility { field public static final int FOCUS_ACCESSIBILITY = 2; // 0x2 field public static final int FOCUS_INPUT = 1; // 0x1 field public static final int MAX_NUMBER_OF_PREFETCHED_NODES = 50; // 0x32 - field public static final int MINIMUM_MIN_MILLIS_BETWEEN_CONTENT_CHANGES = 100; // 0x64 field public static final int MOVEMENT_GRANULARITY_CHARACTER = 1; // 0x1 field public static final int MOVEMENT_GRANULARITY_LINE = 4; // 0x4 field public static final int MOVEMENT_GRANULARITY_PAGE = 16; // 0x10 field public static final int MOVEMENT_GRANULARITY_PARAGRAPH = 8; // 0x8 field public static final int MOVEMENT_GRANULARITY_WORD = 2; // 0x2 - field public static final int UNDEFINED_MIN_MILLIS_BETWEEN_CONTENT_CHANGES = -1; // 0xffffffff } public static final class AccessibilityNodeInfo.AccessibilityAction implements android.os.Parcelable { diff --git a/core/api/test-current.txt b/core/api/test-current.txt index 85d73ec7d65af..ec592c090b907 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -2955,7 +2955,6 @@ package android.view { method public static int getHoverTooltipHideTimeout(); method public static int getHoverTooltipShowTimeout(); method public static int getLongPressTooltipHideTimeout(); - method public static long getSendRecurringAccessibilityEventsInterval(); method public boolean isPreferKeepClearForFocusEnabled(); } diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java index 58aee61b98be5..f51d9bacc0a58 100644 --- a/core/java/android/view/ViewConfiguration.java +++ b/core/java/android/view/ViewConfiguration.java @@ -822,7 +822,6 @@ public class ViewConfiguration { * * @hide */ - @TestApi public static long getSendRecurringAccessibilityEventsInterval() { return SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS; } diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java index 88adb2e1b1f16..334a459f16c62 100644 --- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java +++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java @@ -127,16 +127,6 @@ public class AccessibilityNodeInfo implements Parcelable { /** @hide */ public static final long UNDEFINED_NODE_ID = makeNodeId(UNDEFINED_ITEM_ID, UNDEFINED_ITEM_ID); - /** - * The default value for {@link #getMinMillisBetweenContentChanges}; - */ - public static final int UNDEFINED_MIN_MILLIS_BETWEEN_CONTENT_CHANGES = -1; - - /** - * The minimum value for {@link #setMinMillisBetweenContentChanges}; - */ - public static final int MINIMUM_MIN_MILLIS_BETWEEN_CONTENT_CHANGES = 100; - /** @hide */ public static final long ROOT_NODE_ID = makeNodeId(ROOT_ITEM_ID, AccessibilityNodeProvider.HOST_VIEW_ID); @@ -889,8 +879,7 @@ public class AccessibilityNodeInfo implements Parcelable { private long mTraversalBefore = UNDEFINED_NODE_ID; private long mTraversalAfter = UNDEFINED_NODE_ID; - private int mMinMillisBetweenContentChanges = - UNDEFINED_MIN_MILLIS_BETWEEN_CONTENT_CHANGES; + private int mMinMillisBetweenContentChanges; private int mBooleanProperties; private final Rect mBoundsInParent = new Rect(); @@ -1799,12 +1788,6 @@ public class AccessibilityNodeInfo implements Parcelable { * content change events in accessibility services. * *

- * Note: - * This value should not be smaller than {@link #MINIMUM_MIN_MILLIS_BETWEEN_CONTENT_CHANGES}, - * otherwise it would be ignored by accessibility services. - *

- * - *

* Example: An app can set MinMillisBetweenContentChanges as 1 min for a view which sends * content change events to accessibility services one event per second. * Accessibility service will throttle those content change events and only handle one event @@ -1816,15 +1799,11 @@ public class AccessibilityNodeInfo implements Parcelable { */ public void setMinMillisBetweenContentChanges(int minMillisBetweenContentChanges) { enforceNotSealed(); - mMinMillisBetweenContentChanges = minMillisBetweenContentChanges - >= MINIMUM_MIN_MILLIS_BETWEEN_CONTENT_CHANGES - ? minMillisBetweenContentChanges - : UNDEFINED_MIN_MILLIS_BETWEEN_CONTENT_CHANGES; + mMinMillisBetweenContentChanges = minMillisBetweenContentChanges; } /** - * Gets the minimum time duration between two content change events. This method may return - * {@link #UNDEFINED_MIN_MILLIS_BETWEEN_CONTENT_CHANGES} + * Gets the minimum time duration between two content change events. */ public int getMinMillisBetweenContentChanges() { return mMinMillisBetweenContentChanges;