Add CONTENT_CHANGE_TYPE_ENABLED flag

Bug: 191884508
Test: ran cts tests and verified on talkback_tests
Change-Id: I38b56c034e3291b4c11b79066be694c962c48e97
This commit is contained in:
Zeyin Wu
2022-10-05 21:37:13 +00:00
parent 9eef24a570
commit 7099112bd3
3 changed files with 17 additions and 0 deletions

View File

@@ -51754,6 +51754,7 @@ package android.view.accessibility {
field public static final int CONTENT_CHANGE_TYPE_DRAG_CANCELLED = 512; // 0x200
field public static final int CONTENT_CHANGE_TYPE_DRAG_DROPPED = 256; // 0x100
field public static final int CONTENT_CHANGE_TYPE_DRAG_STARTED = 128; // 0x80
field public static final int CONTENT_CHANGE_TYPE_ENABLED = 4096; // 0x1000
field public static final int CONTENT_CHANGE_TYPE_ERROR = 2048; // 0x800
field public static final int CONTENT_CHANGE_TYPE_PANE_APPEARED = 16; // 0x10
field public static final int CONTENT_CHANGE_TYPE_PANE_DISAPPEARED = 32; // 0x20

View File

@@ -12454,6 +12454,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (!enabled) {
cancelPendingInputEvents();
}
notifyViewAccessibilityStateChangedIfNeeded(
AccessibilityEvent.CONTENT_CHANGE_TYPE_ENABLED);
}
/**

View File

@@ -707,6 +707,18 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
*/
public static final int CONTENT_CHANGE_TYPE_ERROR = 0x0000800;
/**
* Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event:
* The source node changed its ability to interact returned by
* {@link AccessibilityNodeInfo#isEnabled}.
* The view changing content's ability to interact should call
* {@link AccessibilityNodeInfo#setEnabled} and then send this event.
*
* @see AccessibilityNodeInfo#isEnabled
* @see AccessibilityNodeInfo#setEnabled
*/
public static final int CONTENT_CHANGE_TYPE_ENABLED = 1 << 12;
/** Change type for {@link #TYPE_SPEECH_STATE_CHANGE} event: another service is speaking. */
public static final int SPEECH_STATE_SPEAKING_START = 0x00000001;
@@ -834,6 +846,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
CONTENT_CHANGE_TYPE_DRAG_CANCELLED,
CONTENT_CHANGE_TYPE_CONTENT_INVALID,
CONTENT_CHANGE_TYPE_ERROR,
CONTENT_CHANGE_TYPE_ENABLED,
})
public @interface ContentChangeTypes {}
@@ -1103,6 +1116,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
case CONTENT_CHANGE_TYPE_CONTENT_INVALID:
return "CONTENT_CHANGE_TYPE_CONTENT_INVALID";
case CONTENT_CHANGE_TYPE_ERROR: return "CONTENT_CHANGE_TYPE_ERROR";
case CONTENT_CHANGE_TYPE_ENABLED: return "CONTENT_CHANGE_TYPE_ENABLED";
default: return Integer.toHexString(type);
}
}