Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions shell/platform/android/io/flutter/view/AccessibilityBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,12 @@ void updateSemantics(ByteBuffer buffer, String[] strings) {
}
sendAccessibilityEvent(event);
}
if (object.hasFlag(Flag.IS_LIVE_REGION) && !object.hadFlag(Flag.IS_LIVE_REGION)) {
sendAccessibilityEvent(object.id, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
if (object.hasFlag(Flag.IS_LIVE_REGION)) {
String label = object.label == null ? "" : object.label;
String previousLabel = object.previousLabel == null ? "" : object.label;
if (!label.equals(previousLabel) || !object.hadFlag(Flag.IS_LIVE_REGION)) {
sendAccessibilityEvent(object.id, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
}
} else if (object.hasFlag(Flag.IS_TEXT_FIELD) && object.didChangeLabel()
&& mInputFocusedObject != null && mInputFocusedObject.id == object.id) {
// Text fields should announce when their label changes while focused. We use a live
Expand Down Expand Up @@ -851,17 +855,6 @@ public void onMessage(Object message, BasicMessageChannel.Reply<Object> reply) {
sendAccessibilityEvent(e);
break;
}
// Requires that the node id provided corresponds to a live region, or TalkBack will
// ignore the event. The event will cause talkback to read out the new label even
// if node is not focused.
case "updateLiveRegion": {
Integer nodeId = (Integer) annotatedEvent.get("nodeId");
if (nodeId == null) {
return;
}
sendAccessibilityEvent(nodeId, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
break;
}
}
}

Expand Down