Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Public Attributes | List of all members
io.flutter.embedding.engine.systemchannels.AccessibilityChannel Class Reference

Classes

interface  AccessibilityMessageHandler
 

Public Member Functions

 AccessibilityChannel (@NonNull DartExecutor dartExecutor, @NonNull FlutterJNI flutterJNI)
 
 AccessibilityChannel ( @NonNull BasicMessageChannel< Object > channel, @NonNull FlutterJNI flutterJNI)
 
void onAndroidAccessibilityEnabled ()
 
void onAndroidAccessibilityDisabled ()
 
void setAccessibilityFeatures (int accessibilityFeatureFlags)
 
void dispatchSemanticsAction (int virtualViewId, @NonNull AccessibilityBridge.Action action)
 
void dispatchSemanticsAction (int virtualViewId, @NonNull AccessibilityBridge.Action action, @Nullable Object args)
 
void setAccessibilityMessageHandler (@Nullable AccessibilityMessageHandler handler)
 

Public Attributes

final BasicMessageChannel< Object > channel
 
final FlutterJNI flutterJNI
 
final BasicMessageChannel.MessageHandler< Object > parsingMessageHandler
 

Detailed Description

System channel that sends accessibility requests and events from Flutter to Android.

See AccessibilityMessageHandler, which lists all accessibility requests and events that might be sent from Flutter to the Android platform.

Definition at line 20 of file AccessibilityChannel.java.

Constructor & Destructor Documentation

◆ AccessibilityChannel() [1/2]

io.flutter.embedding.engine.systemchannels.AccessibilityChannel.AccessibilityChannel ( @NonNull DartExecutor  dartExecutor,
@NonNull FlutterJNI  flutterJNI 
)
inline

Constructs an AccessibilityChannel that connects Android to the Dart code running in dartExecutor.

The given dartExecutor is permitted to be idle or executing code.

See DartExecutor.

Definition at line 98 of file AccessibilityChannel.java.

98 {
99 channel =
100 new BasicMessageChannel<>(
101 dartExecutor, "flutter/accessibility", StandardMessageCodec.INSTANCE);
103 this.flutterJNI = flutterJNI;
104 }
final BasicMessageChannel.MessageHandler< Object > parsingMessageHandler
void setMessageHandler(@Nullable final MessageHandler< T > handler)

◆ AccessibilityChannel() [2/2]

io.flutter.embedding.engine.systemchannels.AccessibilityChannel.AccessibilityChannel ( @NonNull BasicMessageChannel< Object >  channel,
@NonNull FlutterJNI  flutterJNI 
)
inline

Definition at line 107 of file AccessibilityChannel.java.

108 {
109 this.channel = channel;
110 this.flutterJNI = flutterJNI;
111 }

Member Function Documentation

◆ dispatchSemanticsAction() [1/2]

void io.flutter.embedding.engine.systemchannels.AccessibilityChannel.dispatchSemanticsAction ( int  virtualViewId,
@NonNull AccessibilityBridge.Action  action 
)
inline

Instructs Flutter to perform the given action on the SemanticsNode referenced by the given virtualViewId.

One might wonder why Flutter would need to be instructed that the user wants to perform an action. When the user is touching the screen in accessibility mode, Android takes over the touch input, categorizing input as one of a many accessibility gestures. Therefore, Flutter does not have an opportunity to react to said touch input. Instead, Flutter must be notified by Android of the desired action. Additionally, some accessibility systems use other input methods, such as speech, to take virtual actions. Android interprets those requests and then instructs the app to take the appropriate action.

Definition at line 153 of file AccessibilityChannel.java.

154 {
156 }
void dispatchSemanticsAction(int nodeId, @NonNull AccessibilityBridge.Action action)

◆ dispatchSemanticsAction() [2/2]

void io.flutter.embedding.engine.systemchannels.AccessibilityChannel.dispatchSemanticsAction ( int  virtualViewId,
@NonNull AccessibilityBridge.Action  action,
@Nullable Object  args 
)
inline

Instructs Flutter to perform the given action on the SemanticsNode referenced by the given virtualViewId, passing the given args.

Definition at line 162 of file AccessibilityChannel.java.

163 {
165 }
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

◆ onAndroidAccessibilityDisabled()

void io.flutter.embedding.engine.systemchannels.AccessibilityChannel.onAndroidAccessibilityDisabled ( )
inline

Informs Flutter that the Android OS currently has accessibility disabled.

Given that accessibility is not required at this time, this method instructs Flutter to deactivate its semantics tree.

Definition at line 129 of file AccessibilityChannel.java.

129 {
131 }
void setSemanticsEnabled(boolean enabled)

◆ onAndroidAccessibilityEnabled()

void io.flutter.embedding.engine.systemchannels.AccessibilityChannel.onAndroidAccessibilityEnabled ( )
inline

Informs Flutter that the Android OS currently has accessibility enabled.

To accommodate enabled accessibility, this method instructs Flutter to activate its semantics tree, which forms the basis of Flutter's accessibility support.

Definition at line 119 of file AccessibilityChannel.java.

119 {
121 }

◆ setAccessibilityFeatures()

void io.flutter.embedding.engine.systemchannels.AccessibilityChannel.setAccessibilityFeatures ( int  accessibilityFeatureFlags)
inline

Instructs Flutter to activate/deactivate accessibility features corresponding to the flags provided by accessibilityFeatureFlags.

Definition at line 137 of file AccessibilityChannel.java.

137 {
138 flutterJNI.setAccessibilityFeatures(accessibilityFeatureFlags);
139 }

◆ setAccessibilityMessageHandler()

void io.flutter.embedding.engine.systemchannels.AccessibilityChannel.setAccessibilityMessageHandler ( @Nullable AccessibilityMessageHandler  handler)
inline

Sets the AccessibilityMessageHandler which receives all events and requests that are parsed from the underlying accessibility channel.

Definition at line 171 of file AccessibilityChannel.java.

171 {
172 this.handler = handler;
174 }
void setAccessibilityDelegate(@Nullable AccessibilityDelegate accessibilityDelegate)

Member Data Documentation

◆ channel

final BasicMessageChannel<Object> io.flutter.embedding.engine.systemchannels.AccessibilityChannel.channel

Definition at line 23 of file AccessibilityChannel.java.

◆ flutterJNI

final FlutterJNI io.flutter.embedding.engine.systemchannels.AccessibilityChannel.flutterJNI

Definition at line 24 of file AccessibilityChannel.java.

◆ parsingMessageHandler

final BasicMessageChannel.MessageHandler<Object> io.flutter.embedding.engine.systemchannels.AccessibilityChannel.parsingMessageHandler

Definition at line 27 of file AccessibilityChannel.java.


The documentation for this class was generated from the following file: