1package io.flutter.embedding.engine.systemchannels;
3import androidx.annotation.NonNull;
4import androidx.annotation.Nullable;
5import androidx.annotation.VisibleForTesting;
7import io.flutter.embedding.engine.FlutterJNI;
8import io.flutter.embedding.engine.dart.DartExecutor;
9import io.flutter.plugin.common.BasicMessageChannel;
10import io.flutter.plugin.common.StandardMessageCodec;
11import io.flutter.view.AccessibilityBridge;
12import java.util.HashMap;
21 private static final String TAG =
"AccessibilityChannel";
30 public void onMessage(
34 if (handler ==
null) {
39 @SuppressWarnings(
"unchecked")
40 final HashMap<String, Object> annotatedEvent = (HashMap<String, Object>)
message;
41 final String
type = (String) annotatedEvent.get(
"type");
42 @SuppressWarnings(
"unchecked")
43 final HashMap<String, Object>
data = (HashMap<String, Object>) annotatedEvent.get(
"data");
48 String announceMessage = (String)
data.get(
"message");
49 if (announceMessage !=
null) {
50 handler.announce(announceMessage);
55 Integer nodeId = (Integer) annotatedEvent.get(
"nodeId");
57 handler.onTap(nodeId);
63 Integer nodeId = (Integer) annotatedEvent.get(
"nodeId");
65 handler.onLongPress(nodeId);
71 Integer nodeId = (Integer) annotatedEvent.get(
"nodeId");
73 handler.onFocus(nodeId);
79 String tooltipMessage = (String)
data.get(
"message");
80 if (tooltipMessage !=
null) {
81 handler.onTooltip(tooltipMessage);
172 this.handler = handler;
static void v(@NonNull String tag, @NonNull String message)
void setSemanticsEnabled(boolean enabled)
void setAccessibilityDelegate(@Nullable AccessibilityDelegate accessibilityDelegate)
void dispatchSemanticsAction(int nodeId, @NonNull AccessibilityBridge.Action action)
void setAccessibilityFeatures(int flags)
final BasicMessageChannel< Object > channel
void dispatchSemanticsAction(int virtualViewId, @NonNull AccessibilityBridge.Action action, @Nullable Object args)
void setAccessibilityFeatures(int accessibilityFeatureFlags)
AccessibilityChannel( @NonNull BasicMessageChannel< Object > channel, @NonNull FlutterJNI flutterJNI)
final BasicMessageChannel.MessageHandler< Object > parsingMessageHandler
void dispatchSemanticsAction(int virtualViewId, @NonNull AccessibilityBridge.Action action)
final FlutterJNI flutterJNI
void onAndroidAccessibilityEnabled()
void setAccessibilityMessageHandler(@Nullable AccessibilityMessageHandler handler)
void onAndroidAccessibilityDisabled()
AccessibilityChannel(@NonNull DartExecutor dartExecutor, @NonNull FlutterJNI flutterJNI)
void setMessageHandler(@Nullable final MessageHandler< T > handler)
static final StandardMessageCodec INSTANCE
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
void onLongPress(int nodeId)
void announce(@NonNull String message)
void onTooltip(@NonNull String message)
std::shared_ptr< const fml::Mapping > data